Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .po file creation to Localization doc #13873

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/markdown/Localisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ In this `po` subdirectory we need:
- `LINGUAS`: Space separated list of languages
- `POTFILES`: List of source files to scan for translatable strings.
- `meson.build`: Localization specific Meson file
- Empty translation input files for the languages in `LINGUAS`

### LINGUAS

File with space separated list of languages. A sample LINGUAS might look like this.
File with space- or newline-separated list of languages. A sample LINGUAS might look like this.

aa ab ae af

Expand Down Expand Up @@ -58,6 +59,21 @@ them to their proper locations when doing an install. The second is
that it creates a build rule to regenerate the main pot file. If you
are using the Ninja backend, this is how you would invoke the rebuild.

### Empty PO files

For each language `<id>` listed in `LINGUAS`,
create a file `<id>.po` in the `po/` directory.
These can be empty files;
we'll regenerate them later when updating the translations.

If using a system with Bourne shell compatible scripting,
empty `.po` files can be generated by running this command
from the project root directory:

```console
$ while read _l < po/LINGUAS; do touch po/${_l}.po; done
```

### generate .pot file

Then we need to generate the main pot file. The potfile can have any
Expand All @@ -73,11 +89,16 @@ e.g. proper copyright and contact information.
$ meson compile intltest-pot
```

### generate .po files
### Update .po files

For each language listed in the array above we need a corresponding
`.po` file. Those can be generated by running the following command
from your build folder.
For each language listed in the array above,
Meson will update the corresponding `.po` file
from the data in the generated `.pot` file.
Any existing translations will be preserved,
and data for any missing strings will be added.
Updating the translation files
(or generating initial data, if they were created blank)
can be done by running this command from your build directory:

```console
$ meson compile intltest-update-po
Expand Down