FAQ
Hey All,

We are evaluating different frameworks to use, and one big aspect of the project is how translations are handled, we deal with at least five languages on a regular basis. I am hoping to get some input on different template systems, and ways you all have dealt with the multilingual issues in Catalyst. We've been using XML XSLT translations, but people in the office find it challenging working with instead of an HTML template system.

I've seen some modules in CPAN that help with the issue such as "Catalyst::Plugin::I18N" which seems to work with Template Toolkit, and Pedal. There seems to be some concern over here with the overhead HTML template systems will take up compared to working with XML XSLT translations. I've also noticed the "Catalyst::View::XSLT" class which means we wouldn't need to come up with a new system to get our content translated before we publish.

Thanks,
Keith

Search Discussions

  • Giancarlo Corcuera at Dec 10, 2008 at 7:04 pm
    Maybe this answer os not what you meant but I use some tags stored in
    the database so all the translations I have it stored and then retrieved
    passing the desired language as a parameter, then put all the data in
    the stash so the template could be used for every language you can think of.

    Giancarlo

    Keith Hasely wrote:
    Hey All,

    We are evaluating different frameworks to use, and one big aspect of the project is how translations are handled, we deal with at least five languages on a regular basis. I am hoping to get some input on different template systems, and ways you all have dealt with the multilingual issues in Catalyst. We've been using XML XSLT translations, but people in the office find it challenging working with instead of an HTML template system.

    I've seen some modules in CPAN that help with the issue such as "Catalyst::Plugin::I18N" which seems to work with Template Toolkit, and Pedal. There seems to be some concern over here with the overhead HTML template systems will take up compared to working with XML XSLT translations. I've also noticed the "Catalyst::View::XSLT" class which means we wouldn't need to come up with a new system to get our content translated before we publish.

    Thanks,
    Keith




    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
  • Octavian Rasnita at Dec 10, 2008 at 7:47 pm
    From: "Keith Hasely" <groupskhasely@mac.com>
    Hey All,

    We are evaluating different frameworks to use, and one big aspect of the
    project is how translations are handled, we deal with at least five
    languages on a regular basis. I am hoping to get some input on different
    template systems, and ways you all have dealt with the multilingual issues
    in Catalyst. We've been using XML XSLT translations, but people in the
    office find it challenging working with instead of an HTML template
    system.

    I've seen some modules in CPAN that help with the issue such as
    "Catalyst::Plugin::I18N" which seems to work with Template Toolkit, and
    Pedal. There seems to be some concern over here with the overhead HTML
    template systems will take up compared to working with XML XSLT
    translations. I've also noticed the "Catalyst::View::XSLT" class which
    means we wouldn't need to come up with a new system to get our content
    translated before we publish.
    I use Catalyst::Plugin::I18N and it works fine.

    It is very simple to use, and I just need to use something like the text
    below for translating a certain string:

    [% l("String to translate") %]

    where l() is a Template-Toolkit macro:
    [% MACRO l(text, args) BLOCK;c.localize(text, args);END -%]

    Or you can do the translations in the program directly using:

    my $translated = $c->localize("String to translate");

    And the strings to translate can be kept in Gettext type of text files or in
    separate perl modules that define a hash with the string translations...

    Octavian
  • Jay Shirley at Dec 11, 2008 at 4:35 am

    On Wed, Dec 10, 2008 at 10:44 AM, Keith Hasely wrote:
    Hey All,

    We are evaluating different frameworks to use, and one big aspect of the project is how translations are handled, we deal with at least five languages on a regular basis. I am hoping to get some input on different template systems, and ways you all have dealt with the multilingual issues in Catalyst. We've been using XML XSLT translations, but people in the office find it challenging working with instead of an HTML template system.

    I've seen some modules in CPAN that help with the issue such as "Catalyst::Plugin::I18N" which seems to work with Template Toolkit, and Pedal. There seems to be some concern over here with the overhead HTML template systems will take up compared to working with XML XSLT translations. I've also noticed the "Catalyst::View::XSLT" class which means we wouldn't need to come up with a new system to get our content translated before we publish.

    Thanks,
    Keith
    Hi Keith,

    I'd just like to point out that Catalyst::Plugin::I18N (and related,
    Catalyst::Plugin::Unicode) are not actually tied to your view. They
    create a method on the context ($c, by default as most people know it;
    and actually on the application -- not necessarily $c, which is
    currently a blessed "MyApp", so also available via a simple
    MyApp->localize(...)) called "localize" (or a short-cut, "loc") that
    references the .po files.

    The .po files are just standard internationalization files, loaded at
    run-time and editable/parsable by any standard file. There are also
    handy modules available on the CPAN that allow you to extract and
    generate your .po files (gettext.pl).

    This is by far the best method for internationalization because it
    uses the most common standard for it, and it isn't tied towards any
    view. I haven't used Catalyst::View::XSLT (mostly because I find xslt
    to be challenging ;)) so I can't say for sure, but a glance at the pod
    seems that it would work something like:
    <xsl:value-of select="catalyst:loc('Foo')" />

    Failing that, you can presumably register the method while creating
    the XSLT instance.

    Hope this helps,
    -Jay

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 10, '08 at 6:44p
activeDec 11, '08 at 4:35a
posts4
users4
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase