Moodle Community Sites
  1. Moodle Community Sites
  2. MDLSITE-941

AMOS does not recognize strings with {$a} as outdated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a bug
    • Component/s: lang.moodle.org
    • Labels:
      None
    • Rank:
      25727

      Description

      When translating strings, I noticed AMOS does not recognize strings containing {$a} as outdated. For example, in the group language component, Italian language pack:

      • EN string: Are you sure you want to delete group '{$a}'?
      • IT string: Sei sicuro di voler cancellare il gruppo '<b>{$a}</b>'?

      The IT string is outdated (unneeded HTML tags as well as missing opening/closing single quote), but not recognized by AMOS.

        Activity

        Hide
        David Mudrak added a comment -

        This is not a bug. The string 'deletegroupconfirm' in the component core_group (group.php) never contained <b> in the English. You had this bold formatting in your lang pack only. There is no reason to mark strings with {$a} as outdated because the placeholder format was migrated automatically for 2.0.

        For your information, this is the log of all changes for the string. There is no UI for it yet (will be part of AMOS log page) so the results come directly from database.

        # select * from mdl_amos_repository where stringid='deletegroupconfirm' and lang in ('en','it');                
           id    | commitid | branch | lang | component |      stringid      |                          text                           | timemodified | timeupdated | deleted 
        ---------+----------+--------+------+-----------+--------------------+---------------------------------------------------------+--------------+-------------+---------
           23966 |     1262 |   1800 | en   | group     | deletegroupconfirm | Are you sure you want to delete group '$a'?             |   1170776049 |  1139218139 |       0
           33492 |     2026 |   1900 | en   | group     | deletegroupconfirm | Are you sure you want to delete group '$a'?             |   1170776049 |  1139218139 |       0
           46165 |     3464 |   2000 | en   | group     | deletegroupconfirm | Are you sure you want to delete group '{$a}'?           |   1170776049 |  1139218139 |       0
         1500156 |     8382 |   2000 | it   | group     | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>{$a}</b>'? |   1175191253 |  1139218139 |       0
         1500238 |     8382 |   1900 | it   | group     | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>$a</b>'?   |   1175191253 |  1139218139 |       0
         1500320 |     8382 |   1800 | it   | group     | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>$a</b>'?   |   1175191253 |  1139218139 |       0
         3147311 |    19058 |   2000 | it   | group     | deletegroupconfirm | Sei sicuro di eliminare il gruppo '{$a}'?               |   1278690481 |  1139218139 |       0
        

        As you can see, there is no update of the English string that would come after it was translated into Italian - which is what outdated strings feature detects.

        Show
        David Mudrak added a comment - This is not a bug. The string 'deletegroupconfirm' in the component core_group (group.php) never contained <b> in the English. You had this bold formatting in your lang pack only. There is no reason to mark strings with {$a} as outdated because the placeholder format was migrated automatically for 2.0. For your information, this is the log of all changes for the string. There is no UI for it yet (will be part of AMOS log page) so the results come directly from database. # select * from mdl_amos_repository where stringid='deletegroupconfirm' and lang in ('en','it'); id | commitid | branch | lang | component | stringid | text | timemodified | timeupdated | deleted ---------+----------+--------+------+-----------+--------------------+---------------------------------------------------------+--------------+-------------+--------- 23966 | 1262 | 1800 | en | group | deletegroupconfirm | Are you sure you want to delete group '$a'? | 1170776049 | 1139218139 | 0 33492 | 2026 | 1900 | en | group | deletegroupconfirm | Are you sure you want to delete group '$a'? | 1170776049 | 1139218139 | 0 46165 | 3464 | 2000 | en | group | deletegroupconfirm | Are you sure you want to delete group '{$a}'? | 1170776049 | 1139218139 | 0 1500156 | 8382 | 2000 | it | group | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>{$a}</b>'? | 1175191253 | 1139218139 | 0 1500238 | 8382 | 1900 | it | group | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>$a</b>'? | 1175191253 | 1139218139 | 0 1500320 | 8382 | 1800 | it | group | deletegroupconfirm | Sei sicuro di voler cancellare il gruppo '<b>$a</b>'? | 1175191253 | 1139218139 | 0 3147311 | 19058 | 2000 | it | group | deletegroupconfirm | Sei sicuro di eliminare il gruppo '{$a}'? | 1278690481 | 1139218139 | 0 As you can see, there is no update of the English string that would come after it was translated into Italian - which is what outdated strings feature detects.
        Hide
        Andrea Bicciolo added a comment -

        Hi David,

        thanks for the explanation. Probably the eaxmple provided was not teh correct on, however I think there is a real issue when dealing with some kind of outdated string. For example, I'm ntoicing the "*_help" files are often missed as outdated.

        As you know many help files has been shortened for 2.0. Those help files has never been translated, maybe AMOS does not think strings outdated since "_help" strings has been loaded from the language pack's help files after the shortening. An example follows below. As you can see the Italian "_help" string comes from the original HTML help that has been obsoleted by the shortened EN help string:

        Assignment, modulename_help:

        EN: Assignments enable the teacher to specify a task either on or offline which can then be graded.

        IT: <p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/assignment/icon.gif" /> <b>Compiti</b></p> <div class="indent"> I Compiti permettono al docente di assegnare agli studenti attività individuali dove si richiede la preparazione di un elaborato digitale (in qualsiasi formato) da consegnare caricandolo sul server. Esempi tipici di Compiti sono componimenti, saggi, progetti, report, eccetera. I Compiti possono essere valutati. </div>

        Show
        Andrea Bicciolo added a comment - Hi David, thanks for the explanation. Probably the eaxmple provided was not teh correct on, however I think there is a real issue when dealing with some kind of outdated string. For example, I'm ntoicing the "*_help" files are often missed as outdated. As you know many help files has been shortened for 2.0. Those help files has never been translated, maybe AMOS does not think strings outdated since " _help" strings has been loaded from the language pack's help files after the shortening. An example follows below. As you can see the Italian " _help" string comes from the original HTML help that has been obsoleted by the shortened EN help string: Assignment, modulename_help: EN: Assignments enable the teacher to specify a task either on or offline which can then be graded. IT: <p><img alt="" src="<?php echo $CFG->wwwroot?>/mod/assignment/icon.gif" /> <b>Compiti</b></p> <div class="indent"> I Compiti permettono al docente di assegnare agli studenti attività individuali dove si richiede la preparazione di un elaborato digitale (in qualsiasi formato) da consegnare caricandolo sul server. Esempi tipici di Compiti sono componimenti, saggi, progetti, report, eccetera. I Compiti possono essere valutati. </div>
        Hide
        David Mudrak added a comment -

        Correct, _help strings that were converted from legacy HTML files are not detected as out-dated. The reason is still the same - the translated version (that is the one that was migrated from HTML file) is more recent than the original. Translators should review all _help strings anyway and modify them, that is why we have "help strings only" settings there. This is just one-time problem now with the initial auto-translation. Once you translate and fix all help files now, whole outdated detection will work properly as expected. I prefer this long-term stability over injecting dirty hacks into the code just to get over this initialisation. Hope it helps.

        Show
        David Mudrak added a comment - Correct, _help strings that were converted from legacy HTML files are not detected as out-dated. The reason is still the same - the translated version (that is the one that was migrated from HTML file) is more recent than the original. Translators should review all _help strings anyway and modify them, that is why we have "help strings only" settings there. This is just one-time problem now with the initial auto-translation. Once you translate and fix all help files now, whole outdated detection will work properly as expected. I prefer this long-term stability over injecting dirty hacks into the code just to get over this initialisation. Hope it helps.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development