[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: String access & metamethods
- From: "Jerome Vuarand" <jerome.vuarand@...>
- Date: Wed, 12 Dec 2007 19:32:20 -0500
To ease even more the use of a L function (or any other
name you see fit), you can use a token filter to add it to all strings. Since
you'll probably some strings to be untranslated (all strings that are not UI
strings), you can make the token filter only add the L prefix to strings using
double quotes, and let strings using simple quotes go untranslated (I don't know
if a token filter can distinguish between the two, but that would be a nice
addition if it doesn't).
Yes, in the end I agree. The __tostring thing is neat, but it
fails to work in instances outside of print() etc. So the original
translation function L would seem to meet my needs the best.
thank all of you for your comments and help.
On Dec 12, 2007 5:50 PM, Miles Bader <email@example.com
think for this sort of task, you really want _source_ strings to
"Carlos Augusto Teixeira Mendes" <firstname.lastname@example.org
> you will get <<<foobar>>>
and not <<<foo>>><<<bar>>> as you might be
expecting for your translation
I think it's better to byte the bullet and use the prefix
though, because translating _every_ string by default seems
dangerous. Some strings are not meant to be translated, and
programmer really knows which is
if output_of_some_script == "succeeded"
It's pretty likely the
first should be translated but not the second.]
`Cars give people wonderful freedom and increase their
But they also destroy the environment, to an extent so
they kill all social life' (from _A Pattern