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.
- is related to
-
NXDRIVE-2334 Update the translation check script to verify only missing arguments
- Resolved