Skip to content

Commit c88b20d

Browse files
committed
FEATURE: Add italian translation
1 parent 3ca647a commit c88b20d

File tree

6 files changed

+2530
-39
lines changed

6 files changed

+2530
-39
lines changed

ARCHITECTURE.md

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -321,20 +321,7 @@ For example, to add support for German:
321321
LANGUAGE_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

339326
Inside your newly created language directory, create a new `.po` file using the `.pot` template:
340327

@@ -344,12 +331,13 @@ mkdir LC_MESSAGES
344331
cp ../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

349336
You can bootstrap your translation using translation services that translate full files.
350337
To do so navigate to the project root and issue:
351338

352339
```bash
340+
cd ..\..\..
353341
python extract_missing_translations.py --lang-code=de
354342
```
355343

@@ -362,7 +350,7 @@ Once done, insert the translations into the `.po` file:
362350
python insert_translations.py --lang-code=de
363351
```
364352

365-
### 6. Translate the Strings
353+
### 5. Translate the Strings
366354

367355
Open the `ardupilot_methodic_configurator.po` file in a text editor or a specialist translation tool (e.g., [Poedit](https://poedit.net/)).
368356
You will see the extracted strings, which you can begin translating.
@@ -381,7 +369,7 @@ msgid "Original English String"
381369
msgstr "Translated String"
382370
```
383371

384-
### 7. Compile the PO File
372+
### 6. Compile the PO File
385373

386374
Once 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
400388
Make sure you have `msgfmt` installed, which is part of the *GNU gettext* package.
401389
On windows use the `.\install_msgfmt.bat` command.
402390

403-
### 8. Test the New Language
391+
### 7. Test the New Language
404392

405393
Add 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
421409
With the new `.mo` file created, you should ensure the software correctly loads the new language.
422410
Update 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

426414
Once the new language is running in the software, review the translations within the application for clarity and correctness.
427415
Make adjustments as needed in the `.po` file and recompile to an `.mo` file.

ardupilot_methodic_configurator/internationalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# Do not import nor use logging functions in this file.
1717
# Logging is not yet configured when these functions are called
1818

19-
LANGUAGE_CHOICES = ["en", "zh_CN", "pt", "de"]
19+
LANGUAGE_CHOICES = ["en", "zh_CN", "pt", "de", "it"]
2020

2121

2222
def identity_function(s: str) -> str:

0 commit comments

Comments
 (0)