diff options
| author | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2017-03-29 15:03:43 -0300 |
|---|---|---|
| committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-04-26 17:56:33 +0300 |
| commit | b371875e02cce2fb3fbb9fbb8f07eb5817ae0e8f (patch) | |
| tree | 6e1a3c34b1a85479d3b9f42ccd071096e637929b /docs/markdown/i18n-module.md | |
| parent | 7dc747ea54480c452b913e4bfe682ec67061c9bf (diff) | |
| download | meson-b371875e02cce2fb3fbb9fbb8f07eb5817ae0e8f.tar.gz | |
docs: Import the website and wiki and build with hotdoc
This allows us to more easily have the documentation in sync with
the source code as people will have to document new features etc
right at the time where they implement it.
Diffstat (limited to 'docs/markdown/i18n-module.md')
| -rw-r--r-- | docs/markdown/i18n-module.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/markdown/i18n-module.md b/docs/markdown/i18n-module.md new file mode 100644 index 000000000..b4e40d74b --- /dev/null +++ b/docs/markdown/i18n-module.md @@ -0,0 +1,30 @@ +# I18n module + +This module provides internationalisation and localisation functionality. + +## Usage + +To use this module, just do: **`i18n = import('i18n')`**. The following functions will then be available as methods on the object with the name `i18n`. You can, of course, replace the name `i18n` with anything else. + +### i18n.gettext() + +Sets up gettext localisation so that translations are built and placed into their proper locations during install. Takes one positional argument which is the name of the gettext module. + +* `languages`: list of languages that are to be generated. As of 0.37.0 this is optional and the [LINGUAS](https://www.gnu.org/software/gettext/manual/html_node/po_002fLINGUAS.html) file is read. +* `data_dirs`: (*Added 0.36.0*) list of directories to be set for `GETTEXTDATADIRS` env var (Requires gettext 0.19.8+), used for local its files +* `preset`: (*Added 0.37.0*) name of a preset list of arguments, current option is `'glib'`, see [source](https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py) for for their value +* `args`: list of extra arguments to pass to `xgettext` when generating the pot file + +This function also defines targets for maintainers to use: +**Note**: These output to the source directory + +* `<project_id>-pot`: runs `xgettext` to regenerate the pot file + +### i18n.merge_file() + +This merges translations into a text file using `msgfmt`. See [custom_target](https://github.com/mesonbuild/meson/wiki/Reference%20manual#custom_target) for normal keywords. In addition it accepts these keywords: + +* `po_dir`: directory containing translations, relative to current directory +* `type`: type of file, valid options are `'xml'` (default) and `'desktop'` + +*Added 0.37.0* |
