Open GoogleCodeExporter opened 9 years ago
Original comment by tablatronics
on 19 Apr 2012 at 9:36
this sounds like a great idea.
Realizing now that I should do all my translations as I'm writing as its
becoming a bit of a pain now going back through my code to find all the string
and set it up.
This is a much better way of doing things.
Original comment by MichaelS...@gmail.com
on 20 Apr 2012 at 11:15
i like this as well - (where were you 2 years ago when we were looking for a
solution?? haha) - but i am concerned with backwards compatibility.
Also - how would a translator get all the strings that need parsed? I assume
that is where your "auto file generation" comes into play.
Original comment by ccagle8
on 14 Jun 2012 at 12:59
I suggest we deprecate i18n() function.
We continue support for it by leaving it in obviously.
We create 2 new functions.
function get_i18n(token,defaultstr){ ... }
function return_i18n(token,defaultstr){ echo get_118n(token,defaultstr) }
benefits, no more echo flag arguments, no mysterious function name.
And inline default transliteration strings until lang files are created.
We can go back and edit them out, or leave them in, whatever.
To find them, we can create a script to parse the codebase for all matching
functions and extract tokens and strings to convert into lang files. or we
could dynamically add them as they are called using some kind of unitests.
Of course we could also add this support to i18n() by detecting if the second
argument is bool or a string. But that is just confusing.
Original comment by tablatronics
on 20 Jun 2012 at 2:01
actually I wasn't thinking, we already have
i18n_r($name)
It's trivial to add a second parameter to it.
Original comment by tablatronics
on 24 Jul 2012 at 2:13
Original issue reported on code.google.com by
tablatronics
on 19 Apr 2012 at 9:33