Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70289

Fix AMOS translator backslash escaping

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • 3.5.15, 3.7.9, 3.8.6, 3.9.3, 3.10
    • Calendar, General, Language
    • MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE

      AMOS translator breaks translations when importing from file when the strings end in single quotes escaped by backslashes. Example in slovenian:

      Local (already fixed) translation in Moodle for string

      'core_completion/completionexpectedfor':
      Pričakovana zaključenost za '{$a->modulename}' dejavnost '{$a->instancename}'

       

      Saved PHP file moodledata/lang/sl_local/completion.php:

      $string['completionexpectedfor'] = 'Pričakovana zaključenost za \'{$a->modulename}\' dejavnost \'{$a->instancename}\'';

       

      Text to be imported to AMOS from said file:

      Pričakovana zaključenost za '{$a->modulename}' dejavnost '{$a->instancename}\
      

       When I searched for strings ending with a backslash in AMOS, I found 317 hits in default English. We stumbled across this problem, when the Timeline started throwing an error described in this issue and fixed it by changing the local translations and running the query on the database manually:

      UPDATE mdl_event SET name = REGEXP_REPLACE( name,"\\\\$","'") WHERE name LIKE "%\\";
      

       

            Unassigned Unassigned
            tjazbec Timotej Jazbec
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.