jmo has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, I'm trying to figure out the least insane way to have multi language support on a project I'm doing. Based on my interpretation of Locale-Maketext-Lexicon-0.52 docs should I skip multilingual support until the bitter end and at that point use xgettext.pl or similar to extract sentences from my templates. Then create po-files and do the translation when the project is all done.

Has anyone worked like that? Any pros or cons?

Because to be honest it scares me. It feels like it's something which will sneak up on me and poke me in the eye later on. My understanding is that I18N (this is a Catalyst app so Catalyst::Plugin::I18N with TT templates to be specific) will use the full sentences as hash keys, what if I realize that there's a spelling error? Or if I just want to change the wording? My understanding is that I'll have to locate the phrase in each po-file and then replace it there as well. Is that really more sane than using semi-cryptic place holders like "welcome_here" and "plug_for_registering"?

I would really appreciate if someone has experience with the problem and can share some of it with me as I'm currently leaning towards putting all text as place holders and having [% c->l('welcome_1') %] etc from start (and the above link suggests it'd be the wrong way to go under "Localization Tips" but I can't get into my head why that would be the case).

Thanks in advance

Replies are listed 'Best First'.
Re: i18n best practice
by JavaFan (Canon) on Mar 16, 2010 at 16:25 UTC
    I'm trying to figure out the least insane way to have multi language support on a project I'm doing.
    Perhaps you should be telling a bit more what your project is about, and what you what your goal (relating to translations) is. Will you have static data? Dynamic data? A few languages? Many languages? Are you going to provide the translations yourself? Hire translators? Rely on volunteers? Use Babelfish? Once the coding is done, is that the end of translations? Will the coding ever be done, or this an internal evolving project? Do you have long sections of text, or are we talking about templates that need translations for tags?

      There will mostly be static templates, with dynamic data not being a real problem (titles of records and books).

      Initially I'll only need one language as I'll see if anyone but me finds the pet project useful or not. But hopefully will I need to translate to one or two languages at least. As it's a no-money-gain-server-in-my-closet type of project will it either be volunteers or myself (I suspect you have noticed English isn't my native language) at least to English and then hopefully with the help of someone enjoying the site being better at it.

      The templates do/will contain a bit of text and all menus, buttons etc will as well. All in all not massive amounts but I hope to learn some from this as well when/if I need to do it on a larger scale.

        The only experience I have this was for GUI interfaces not web pages, but we found very quickly that it was better to use a separate resource (the GUI equivalent of a template) for each language, than lots of individual strings. The problem being that saying the same thing in different langauges can mean the length of the strings vary enormously, which makes layout a pain.

        It's probably less of a pain with web pages as HTML is more flexible, but there are other considerations too. Eg. Different countries perceive colors differently according to their cultural references. I can't remember which, but one country had a real problem with there being any red on a page. It was far easier to accommodate such preferences by having a separate template for each.

        The only other piece of advice I'd offer is that you get your translations done by one native speaker and verified by another independant native speaker. We had some done by a second language translator and the results were more than a little embarassing.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.