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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -