From: Phil D. <we...@pa...> - 2004-09-05 04:44:04
|
On Sun, 2004-09-05 at 16:19, Jesse Peterson wrote: > It makes perfect senses and is easy to follow. I also do not know gettext much at all. The root of what I am wondering is if php evaluates a variable in a "num = $TheNum" style string before gettext translates it or not. If not, it would probably make things a lot easier on potential translators to work with: > _("A long string full of $NumberOfCharacters characters"); > instead of: > _('A long string full of') . ' ' . $NumberOfCharacters . ' ' . _('characters'); > > Luckily our code keeper is committed to readable code, > so the variable name should generally describe what it is. > That would give a translator 2 things - more full context to what they are translating > and one less translation to do. I also know languages just enough to know that piecing together english translations in the manner underway does not necessarily produce coherent output. > The more a message can be presented with context, the better the translation will be. > Just a thought - not sure how feasible it is... > > That would be good but I just tried it and sadly no go! echo _("A long string full of $NumberOfCharacters characters"); is not extracted by the string extraction facility. xgettext is given the language=PHP and I guess it is clever enough to know when a string is really a string and not a string mixed in with a varibale. We are stuck with the long hand I fear. Phil |