Creating Translations

From IHRIS Wiki

Creating the POT Files For Launchpad Upload

There are two scripts. The first creates all the .pot files and any necessary localized module configuration files. The .pot files are stored under translations/templates and the module confguration file is stored under <MODULE_DIR>/configs/en_US.

Once you are satisfied with the results you create the tarball to upload to launchpad.

translate_create_templates.php

There is a utility to create .POT translation template files to upload to launchpad. The utility creates a .pot file for each module in a package (such as I2CE, ihris-common, ihris-manage, etc) and is found in the I2CE package under:

i2ce/tools/translate_create_templates.php

It should be the run in the top-level directory <DIR> of a package. The usage as of version 4.0.0:

cd <DIR>

<I2CE_DIRECTORY>/tools/translate_create_templates.php --help

Usage: translate_create_templates.php
  [--template_dir=$template_dir]: The directory to store .pot template files in
    If not set, we use ./translations/templates
  [--remove-strings=T/F] set to true to always remove the string from a module's .pot
    which are no longer present in the module
  [--modules=$module1,$module2..$moduleN]: The module(s) for which we wish  to operate on 
    If not specified, it uses  every valid module
  [--search_dirs=$dir1,$dir2]: Set the search directories for modules
    If not specified, we search <DIR>,<DIR>/sites/*
  [--limit_search=T/F]: Limit the module search results of found sub-modules of a top-level 
    Defaults to T.
  [--categories=$cat1,$cat2]: The categories to search
    If not specificed we search TEMPLATES
  [--create-configs=T/F]  set to true to always create ./configs
    directory and add to to config.xml if there are translatable strings.
  [--overwrite-configs=T/F] set to true to always overwrite the translated
    config.xml


create_launchpad_upload.php

Creates the tarball needed to upload into launchpad.

It should be the run in the top-level directory <DIR> of a package.

Looks for .pot files in translations/templates/

Creates the file translations/templates/lauchpad/templates-<PACKAGE>.tgz

It tells you where to upload the file in lauchpad.

Usage as of 4.0.0

Usage: translate_create_templates.php
  [--modules=$module1,$module2..$moduleN]: The module(s) for which we wish  to operate on 
    If not specified, it uses  every valid module
  [--search_dirs=$dir1,$dir2]: Set the search directories for modules
    If not specified, we search <DIR>,<DIR>/sites/*
  [--limit_search=T/F]: Limit the module search results of found sub-modules of a top-level 
    Defaults to T.

Translations Templates and Configs From Launchpad

Packaging Translations in a Tarball

Packaging Translations in a .deb