Catman...x::i18n(3pm)

πŸ’– Catmandu::Fix::i18n β€” it's giving "lookup value in I18N" πŸ’–

okay bestie, so this is a page from the Catmandu...x::i18n(3pm) manual β€” User Contributed Perl Documentation, to be exact. It's all about Catmandu::Fix::i18n, which is literally the fix that goes and looks up a value in I18N for you. Translation queen behaviour. 🌍✨


🌸 NAME 🌸

Catmandu::Fix::i18n β€” lookup value in I18N


✨ 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" )

no cap, that's the whole vibe: you set up your i18n config, then you just tell the fix what to look up and which language you're feeling today. 🫢


πŸŽ€ CONSTRUCTOR ARGUMENTS πŸŽ€

  • path
    • path to i18n key
    • specified as fix argument
    • required β€” you literally cannot skip this one bestie
  • 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 β€” this one's just vibes, you can leave it out

πŸ‘‘ AUTHORS πŸ‘‘

Nicolas Franck <nicolas.franck at ugent.be> β€” shoutout to the icon who wrote this πŸ’…


πŸ¦‹ SEE ALSO πŸ¦‹

Catmandu::I18N, Catmandu, Locale::Maketext

go read those next, iykyk πŸ“šβœ¨


This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See <http://dev.perl.org/licenses/> for more information.

fr fr, it's free software β€” go forth and remix, just respect the license terms. 🌈

and that's the whole page, periodt. πŸŽ€ this was perl v5.36.0, dated 2023-02-04, straight from the Catman...x::i18n(3pm) manual. mwah πŸ’‹

πŸ“¦ where this page comes from