Locale...uConfig(3pm)
πΈ NAME πΈ
Locale::Maketext::Lexicon::CatmanduConfig β bestie, this is the little module that lets you use your Catmandu config files as a Maketext lexicon. Like, your translation strings live in your Catmandu config and Maketext just... reads them. Iconic behaviour, honestly. π
Oh and btw, the manual page header calls this whole thing Locale...uConfig(3pm) and it lives in the User Contributed Perl Documentation collection. That's just where it's filed, the module name up top is the real one. β¨
β¨ SYNOPSIS β¨
Okay so here's the whole vibe in two chunks. First you set up your locale data inside your Catmandu config:
Catmandu->{config}->{locale} = {
en => {
hello => "Hello"
},
_style => "gettext"
};
Then you make your very own i18n package and tell Locale::Maketext::Lexicon to go grab it from that config. Main character energy:
package MyI18N;
use parent 'Locale::Maketext';
use Locale::Maketext::Lexicon {
en => [ CatmanduConfig => ["locale.en"] ],
_style => "gettext"
};
That's it. That's the whole thing. Slay. π
π NOTES π
- the value for
CatmanduConfigis an array β and this is NOT a typo, okay? It's an array on purpose, becauseLocale::Maketext::Lexiconlooks at plain regular strings and assumes they're files (which it then ignores). So if you hand it a bare string you're gonna get nothing and be sad. Wrap it in an arrayref. Trust. π«Ά - the config parameter
_stylecan be set to"gettext"if you want to make use of placeholders, exactly like inLocale::Maketext::Lexicon::Gettext. Placeholders, bestie!! We love a lil dynamic string moment. π₯
π Real talk: get the array thing wrong and you'll be debugging for an hour wondering why your translations are just... not there. Not me doing that. Definitely not me. π
Anyway β that's the page! This manual came to you courtesy of perl v5.36.0, dated 2023-02-04, filed under Locale...uConfig(3pm) in the User Contributed Perl Documentation. Go forth and localise, queen. ππβ
π¦ where this page comes from
- debian bookworm: libcatmandu-i18n-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatmandu-i18n-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-i18n-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-i18n-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-i18n-perl 0.01-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms