logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::Fix::i18n - lookup value in I18N

Authors

       Nicolas Franck "<nicolas.franck at ugent.be>"

Constructor Arguments

       path
           * path to i18n key

           * specified as fix argument

           * required

       config
           * path to i18n configuration in the Catmandu config

           * specified as fix option

           * required

       lang
           * language to use

           * specified as fix option

           * required

       args
           * path in current record where arguments are stored. Must be an array.

           * specified as fix option

           * optional

Name

       Catmandu::Fix::i18n - lookup value in I18N

See Also

       Catmandu::I18N, Catmandu, Locale::Maketext

Synopsis

           use Catmandu::Sane;
           use Catmandu;

           #In your catmandu config

           Catmandu->config->{i18n} = {
               en => [
                 "Gettext",
                 "/path/to/en.po"
               ],
               nl => [
                 "Gettext",
                 "/path/to/nl.po"
               ]
           };

           #In your fix

           #simple lookup
           i18n( "title", config => "i18n", lang => "en" )

           #lookup with arguments
           add_field("args.$append","Nicolas")
           i18n( "greeting", config => "i18n", lang => "en", args => "args" )

See Also