[Catalyst] I18N with variables

Matthias Dietrich mdietrich at cpan.org
Fri Aug 6 13:16:36 GMT 2010


Hi,

Am 06.08.2010 um 14:58 schrieb Ben van Staveren:

> There's also the issue that I'm dealing with now where I have a web shop that I need to build that needs to be fully bilingual. Including product descriptions and names - this makes things interesting because I18N is absolutely useless for it, so I'm building a set of modules that attempt to solve the whole problem gracefully; perhaps something to stick on CPAN at some point.

I'm using short identifiers for my I18N texts, like "Home.Greeting" which is then translated to "Hi there" for en_us or "Hallöchen" for de_de.  When I added a small CMS to a customer's application all texts should also be translated.  So I saved any text to I18N key CMS.NavigationPoint.PageKey.* within the right language "file" (actually I'm using C::P::I18N::DBI), * for "Title" or "Content" or similar.

I think it should be possible to handle product descriptions like this.  In your Backend save every text to Product.$ArticleNumber.Description, Product.$ArticleNumber.Name, Product.$ArticleNumber.Variant and so on where $ArticleNumber is the actual article number.  The possible languages should be somewhere in your Catalyst config.

Matthias

-- 
rainboxx Software Engineering
Matthias Dietrich

rainboxx Matthias Dietrich   |  Phone: +49 7141 / 2 39 14 71
Königsallee 43               |  Fax  : +49 3222 / 1 47 63 00 
71638 Ludwigsburg            |  Mobil: +49  151 / 50 60 78 64
                             |  WWW  :  http://www.rainboxx.de

CPAN: http://search.cpan.org/~mdietrich/
XING: https://www.xing.com/profile/Matthias_Dietrich18
GULP: http://www.gulp.de/profil/rainboxx.html







More information about the Catalyst mailing list