php - Gettext tool to use the translation in one language as the key for translation in another language -



php - Gettext tool to use the translation in one language as the key for translation in another language -

is there tool i'm suggesting in question title? consider next scenario, msgid "%s minutes left", msgstr in english language is, well, same, , msgstr in language "bla %s bla". in marketing decides in english language string should "%s minutes left, hurry up!". do? on 1 hand, can alter msgid. on plus side, becomes evident translation in language needs updated; string alter requires developer update source file, doesn't sound utilize of developer's time when there many features implement , time scarce. on other hand, translator update msgstr in english, match marketing person's request, how notify translators have update translation? also, see msgid, hasn't changed. how tell them actual string is?

thanks can help.

this mutual situation , – for improve or worse - pretty much built gettext's intended workflow.

the normal workflow being:

source code > extract pot > generate po > translate po

an amend source text be:

edit source > extract new pot > merge po > review fuzzy strings

the msgmerge command line tool allows merge amended pot file already-translated po files. mark translations had source language altered fuzzy, meaning translators might want check 1 time again if translation still accurate.

msgmerge old.po changes.pot -o new.po

the poedit programme has function via "update pot" menu alternative suspect may using msgmerge programme in background.

as @deceze has pointed out, using "machine ids" separates source strings translations , can avoid such problems. although how many other localisation platforms work, not how gettext intended work (square peg, round hole etc.)

perhaps worth mentioning though can utilize "extracted comments" feature convey farther info translators. in po/pot file indicated "#. " prefix. xgettext programme extracts these source code, maintain them manually.

for example, if wanted maintain english language po file (for marketing people edit) , utilize machine ids in code, have this:

#. %s minutes left msgid "time-nag-minutes-left" msgstr "%s minutes left, hurry up!"

where line 1 original source code comment showing initial english, sec line machine id , 3rd line marketing people editing "translation" without need edit source code again.

i'm not recommending - it's non-standard , translators may used gettext working way it's supposed to. it's alternative though.

php localization internationalization gettext

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -