@ -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
@ -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
@ -73,11 +89,16 @@ e.g. proper copyright and contact information.
$ meson compile intltest-pot
```
### gener ate .po files
### Upd ate .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