Function gstore::l10n::build_script[][src]

pub fn build_script(domain: &str)

This build script:

  1. triggers the required gettext calls to analyze a projects code for used keys and
  2. initializes/updates your po files and
  3. builds a resulting .mo binary file with your translations

The po files are located in [project_root]/po. The resulting mo file is located in [project_root]/target/locale/[locale]/LC_MESSAGES

Requirements:

  • This build script requires xgettext to be installed on your system
  • gstore must be listed as build dependency
  • The file [project_root]/po/LINGUAS need to exist and list all languages (e.g. de, fr, es) that will be translated to.
  • The file [project_root]/po/POTFILES.in need to exist and contain a alphanumerical list of the code files to analyze for translation calls.
  • Translation .po files in [project_root]/po/[locale].po for all languages stated in LINGUAS. If these files do not exist the initial build will create template files in target/po which can be used to start with.

Arguments

domain: The text domain name which is used as file name for the generated .mo file.