diff --git a/pages/common/gettext.md b/pages/common/gettext.md new file mode 100644 index 0000000000..2671819115 --- /dev/null +++ b/pages/common/gettext.md @@ -0,0 +1,8 @@ +# gettext + +> Get string translations. +> More information: . + +- Get the translation of a string or output a default string if it doesn't exist: + +`LANGUAGE={{locale}} gettext {{msgid}} {{default_value}}` diff --git a/pages/common/msgfmt.md b/pages/common/msgfmt.md index e3342cbdae..8166f47053 100644 --- a/pages/common/msgfmt.md +++ b/pages/common/msgfmt.md @@ -3,6 +3,10 @@ > Compile message catalog to binary format. > More information: . +- Compile a file to `messages.mo`: + +`msgfmt {{file.po}}` + - Convert a `.po` file to a `.mo` file: -`msgfmt {{path/to/file.po}} -o {{path/to/file.mo}}` +`msgfmt {{path/to/file.po}} {{[-o|--output-file]}} {{path/to/file.mo}}` diff --git a/pages/common/msginit.md b/pages/common/msginit.md new file mode 100644 index 0000000000..f0539296d5 --- /dev/null +++ b/pages/common/msginit.md @@ -0,0 +1,12 @@ +# msginit + +> Generate language specific translation files based on Portable Object Templates. +> More information: . + +- Generate Portable Object files in system locale from `messages.pot`: + +`msginit` + +- Define locale to generate from a specific template: + +`msginit {{[-l|--locale]}} {{locale}} {{[-i|--input]}} {{path/to/messages.pot}}` diff --git a/pages/common/msgmerge.md b/pages/common/msgmerge.md new file mode 100644 index 0000000000..e8c8085f9e --- /dev/null +++ b/pages/common/msgmerge.md @@ -0,0 +1,8 @@ +# Exclamation mark + +> Update an existing translation file from a new template. +> More information: . + +- Update a translation file: + +`msgmerge {{[-U|--update]}} {{path/to/file.po}} {{path/to/messages.pot}}` diff --git a/pages/common/xgettext.md b/pages/common/xgettext.md index 3d8b8a375a..a67b86063b 100644 --- a/pages/common/xgettext.md +++ b/pages/common/xgettext.md @@ -9,11 +9,11 @@ - Use a different output filename: -`xgettext --output {{path/to/output_file}} {{path/to/input_file}}` +`xgettext {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}` - Append new strings to an existing file: -`xgettext --join-existing --output {{path/to/output_file}} {{path/to/input_file}}` +`xgettext {{[-j|--join-existing]}} {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}` - Don't add a header containing metadata to the output file: