Posted by fletch on 10/16/27 11:53
romayankin@gmail.com wrote:
> I plan to write site on a few language. For this reason I'm trying to
> find the most convenient way to output strings depending on their
> unique ID. As far as I plan to have pretty much strings translated, I'm
> concerned about the performance issues any of the approaches may have
> on the server. Perhaps someone has already solved that of kind of
> problems and can share his/her experience in this matter.
GetText is the standard method. there is a php extension. You write
strings such as
_('Hello bob')
which is then extracted by some of the gettext commandline tools. This
then produces a .po file which can be distributed to translators. When
the translation is done you run another command line tool which creates
a .mo file which is used by php to do the translation.
When you change your text in a _(' ') or add a new one then you can
create a new .po file and merge it with the old .po file which will
produce a third .po file which tells the translator what is new, what
has changed only a little (fzzy matching) or what is the same as last
time. This reduces their workload.
By not using a message id in the code you can write in your own
language in the code and know straight away that the message is the one
you want. You would not have to cross reference to know what the
program is saying.
regards
Fletch
Navigation:
[Reply to this message]
|