[thelist] Text Translation in apps

Eduardo Kienetz eduardok at gmail.com
Thu Oct 21 11:03:55 CDT 2010


On Wed, Oct 20, 2010 at 8:00 PM, Bill Moseley <moseley at hank.org> wrote:
> I'm looking for suggestions for modifying a large existing application to
> support multiple languages.
>
> Must of the strings in app have been found and wrapped in a localize()-type
> function which is then used to look up the text for their selected language.
>  It support parameter substitution, too.  But, using English for the keys
> has not worked that well as sometimes the same key might have two different
> translations depending on the context.  It's also been somewhat of a
> maintenance nightmare trying to keep track of all languages, what is
> missing, etc.
>
> So, I'm wondering what others have done and any tools that have proven
> effective at managing the text that needs translating.

I have developed and actively maintain a web-based application in
Portuguese (original), English, French, and Chinese. That's since 2008
or so.
Just to illustrate, I use something like: i18n('Relatório',LANGUAGE)
So if LANGUAGE="enus" I end up with Report, and so on. But you're
absolutely right about cases where the context influences the
translation.
Right now I have a table with fields: Portuguese, English, French,
Chinese. One row for each phrase and its translations (obviously).
That's far from ideal (now I see), so on the next version (rewrite
from scratch) what I'll do is include a table ScreensTranslations,
with fields TranslationId, ScreenId, FieldId. That way I'll be able to
"tell the system" to load all translations for a given screen at once.
FieldId would usually be NULL, defined only on those cases of context
problems (force a translation to a field).

-- 
Eduardo Bacchi Kienetz


More information about the thelist mailing list