gettext - How to split frontend and backend translations? -
i have web project (php+js) translated gettext. later translated @ server side, pushing translations js varying weird ways. converted gettext, convert .po files po2json , load them jed library. way load translations, never used on client !
what want now:
xgettext -js-options *.js > js-empty.po xgettext -php-options *.php > php-empty.po magic both-translated.po js-empty.po > js-translated.po magic both-translated.po php-empty.po > php-translated.po
what should use 'magic' ?
p.s. doing actual translation in 1 file , split optimization, on every build.
i have found solution:
msgcomm both-translated.po js-empty.po -o js-translated.po
visual inspection confirms lines translated, , following command confirms number of 'msgid' equal in empty , translated files:
grep msgid $1 | wc -l
adding more value answer: where's recommended python library https://pypi.python.org/pypi/polib, or in main linux distributions, packages 'python3-polib' or 'python-polib'. considering using perform task , maybe use in future other gettext-related tasks.
Comments
Post a Comment