@@ -321,20 +321,7 @@ For example, to add support for German:
321321LANGUAGE_CHOICES = [' en' , ' zh_CN' , ' pt' , ' de' ]
322322```
323323
324- ### 3. Generate a Template POT File
325-
326- If you haven't already generated a ` .pot ` file, you can do so by running the ` create_pot_file.py ` script in the project root directory.
327- This script will extract all translatable strings from the project files and create a ` .pot ` file.
328-
329- Ensure you are in the root directory of your project, and execute the following command:
330-
331- ``` bash
332- python create_pot_file.py
333- ```
334-
335- This will create a file named ` ardupilot_methodic_configurator.pot ` inside the ` ardupilot_methodic_configurator/locale ` directory.
336-
337- ### 4. Create a New PO File
324+ ### 3. Create a New PO File
338325
339326Inside your newly created language directory, create a new ` .po ` file using the ` .pot ` template:
340327
@@ -344,12 +331,13 @@ mkdir LC_MESSAGES
344331cp ../ardupilot_methodic_configurator.pot LC_MESSAGES/ardupilot_methodic_configurator.po
345332```
346333
347- ### 5 . Bulk translate the strings (optional)
334+ ### 4 . Bulk translate the strings (optional)
348335
349336You can bootstrap your translation using translation services that translate full files.
350337To do so navigate to the project root and issue:
351338
352339``` bash
340+ cd ..\. .\. .
353341python extract_missing_translations.py --lang-code=de
354342```
355343
@@ -362,7 +350,7 @@ Once done, insert the translations into the `.po` file:
362350python insert_translations.py --lang-code=de
363351```
364352
365- ### 6 . Translate the Strings
353+ ### 5 . Translate the Strings
366354
367355Open the ` ardupilot_methodic_configurator.po ` file in a text editor or a specialist translation tool (e.g., [ Poedit] ( https://poedit.net/ ) ).
368356You will see the extracted strings, which you can begin translating.
@@ -381,7 +369,7 @@ msgid "Original English String"
381369msgstr "Translated String"
382370```
383371
384- ### 7 . Compile the PO File
372+ ### 6 . Compile the PO File
385373
386374Once you have completed your translations, you will need to compile the ` .po ` file into a binary ` .mo ` file. This can be done using the command:
387375
@@ -400,7 +388,7 @@ python3 create_mo_files.py
400388Make sure you have ` msgfmt ` installed, which is part of the * GNU gettext* package.
401389On windows use the ` .\install_msgfmt.bat ` command.
402390
403- ### 8 . Test the New Language
391+ ### 7 . Test the New Language
404392
405393Add it to the ` [Languages] ` and ` [Icons] ` sections of the ` windows/ardupilot_methodic_configurator.iss ` file.
406394
@@ -421,7 +409,7 @@ Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Working
421409With the new ` .mo ` file created, you should ensure the software correctly loads the new language.
422410Update the software's configuration to set the desired language and run the application to test your translations.
423411
424- ### 9 . Review and Refine
412+ ### 8 . Review and Refine
425413
426414Once the new language is running in the software, review the translations within the application for clarity and correctness.
427415Make adjustments as needed in the ` .po ` file and recompile to an ` .mo ` file.
0 commit comments