KWeb
6.4
|
There is a command line utility, which helps in translations automation.
It's called strings2po.php and it sits in /kweb/dev/translation/strings2po.php
Its main purpose is to synchronize/copy translation strings between internal string tables and PO files. PO files are used only to ease translation, and are not directly used by the system.
PO files can be used to detect missing translations, and to scan source file for new and obsolete strings.
There are two types of translations:
Indirect translations are there, to ease development for sites that don't need translations, but might need it in the future. By scanning for indirect strings one can translate them later and replace all indirect strings with direct ones by using a tool (
Both translation types use different files. Direct uses source-lang.po (kweb-en.po), and indirect use source-__LANG.po (kweb-__PL.po).
Usage of strings2po: strings2po [-sources=kweb] -po=o -strings=a [-fill -translate=pl] either -po or -strings are required -sources - catalog with sources (directory containing 'strings' defined in FileDiscovery) like kweb, or local -po - store PO files in 'out-sources'. Options are: o - overwrite data with strings or translations (doesn't delete!) a - append missing data from strings or translations s - just save after parsing and sorting r - just reads the file -strings - store Strings files in 'out-sources'. Same options as in -po -fill - fill missing identifiers -translate - Language to translate back from, using 'sources-__TRANSLATE.po' file. For '-translate=pl' kweb-__PL.po will be used. All translated strings will be flipped - e.g. polish ids will become strings, and their english translations will become ids. -apply - applies changes from out-source
Typicall workflow goes as follows:
php strings2po.php -po=o -fill -apply
php strings2po.php -strings=o -apply
php strings2po.php -strings=o -po=a -apply
php strings2po.php -po=a -strings=a -translate=pl -apply