On 23/05/13 17:19, Jacob Carlborg wrote:
On 2013-05-23 08:27, Peter Williams wrote:
An example of how I would envisage gettext being used in D is:
writefln(gettext("%s: unknown variable at line %s"), filename,
linenumber);
It is a common practice, to define a macro (or equivalent) _(arg) as an
alias for gettext(arg) (and N_(arg) for gettext_noop(arg)) because
people like brevity.
I would suggest using the gettext() functionality for i18n but design
the notation used within programs (to access that functionality)
according to what best suits the D paradigm.
Is the text you want to translate the actual key?
Yes.
That sounds very
stupid. What if I need to change the text?
Well. the translation will also need to be changed to any extra id that
you'd given the original string is now useless.
Believe me, the give the strings an extra id idea has been tried (many
times) and it failed badly (compared to gettext's model).
Peter