NAME

serge-localize - Perform localization cycle

SYNOPSIS

serge localize <configuration-files> [--force] [--rebuild-ts-files] [--output-only-mode] [--lang=aa,bb,cc] [--jobs=foo,bar]

Where <configuration-files> is a path to a specific .serge file, or a directory to scan .serge files in. You can specify multiple paths as separate command-line parameters.

DESCRIPTION

For all provided configuration files, run all their localization jobs, as follows:

  • Extract strings from original (e.g. English) resource files in the working directory and populate translation database.

  • Scan previously generated translation files in corresponding output directory (if such files exist), extract translations from there and put them into translation database.

  • Update translation files with any existing translations, create missing translation files.

  • Generate localized resource files in the working directory by taking original resource files and replacing original strings with translated ones.

See Serge config format description for more information on how to define localization jobs.

OPTIONS

--force

Disable internal optimizations and force process/generate all the files.

This is useful when someone outside has altered/deleted the previously created localized resource files, and you want to rebuild everything.

Note that some localization plugins (for example, completeness plugin) may prevent some files from being updated or created unless a certain criteria is met; --force doesn't change any of this logic, it will only ensure that the localization procedures will be run for each matching file and no shortcut paths will be taken.

--lang=xx[,yy][,zz], --language=xx[,yy][,zz] --languages=xx[,yy][,zz]

An optional comma-separated list of target languages. If not specified, will go through all languages defined in each job.

--job=xx[,yy][,zz], --jobs=xx[,yy][,zz]

An optional comma-separated list of jobs to process.

--rebuild-ts-files

With this mode enabled, translation files will not be parsed, their existing translations will be discarded, and the files will be forcedly generated again.

Note that you won't need this in the typical use of Serge toolkit, until you write some custom scripts that import translations directly into the translation memory database, bypassing translation files. So, this option will propagate translation changes from the database into translation files, otherwise in the next localization cycle (serge localize or serge sync) translations will be read from these files, essentially undoing any side changes.

The typical custom import flow is:

  1. Run serge localize or serge sync;

  2. Run custom script that does something to translation memory database;

  3. Run serge localize --rebuild-ts-files or serge sync --rebuild-ts-files once to propagate changes into translation files;

  4. Continue running serge localize or serge sync normally.

--output-only-mode

Only produce output files: do not parse or generate .po files, do not update database with source strings or translations. This flag will force this mode on all jobs, disregarding their own output_only_mode setting.

SEE ALSO

serge-sync

Part of serge suite.