Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1996

Add a script to check translations files

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 4.4.2
    • Component/s: Tests, Translations

      Description

      Situation

      Actually, switching the language (from the GUI Settings) to "Nederlands" will print out those errors:

      QString::arg: Argument missing: Tentang untuk memperbarui ke {{update_channel}} versi {{ version }}, 
      QString::arg: Argument missing: Tentang untuk memperbarui ke {{update_channel}} versi {{ version }}, 
      QString::arg: Argument missing: "Berkas yang Diabaikan ({{ unsynchronized_files }})" , 0
      

      This is also the case with "Bahasa Indonesia".

      Fix

      Before fixing translations, we should be robust against those errors.
      I propose to create a Python script that will check translations files.

      The idea is:

      • to retrieve possible arguments contained in every sentences from the i18n.json file (it is in english, the reference language);
      • then, for each other translations files, check sentences against the reference one.

      If the sentence has not the same arguments (count and name), store the error in a list:

      errors.append(f"{translation_file.json} {sentence_key!r}")
      

      At the end of all checks, if the errors list is not empty:

      • prints out all errors
      • exit with a failure code -1

      Integration

      • A new option, --check-translations, will be added to deploy scripts.
      • The script will be called before tests.

      Bonus

      When traiting a translation file, it should be a good idea too to store excedant sentences (became obsolete at a certain point).
      They will only be printed out, but not making the script to exit with a failure.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days
                  3d