Zonema...slator(3pm)
π Zonemaster::Translator π
okay so bestie, welcome to Zonemaster::Translator β it's the translation support for Zonemaster, aka the little diva that turns your log entries into pretty strings in whatever language you asked for. it's a Perl module, section 3pm, so pull up a chair and let's get into it π«Ά
β¨ NAME β¨
Zonemaster::Translator β translation support for Zonemaster, no cap π
πΈ SYNOPSIS πΈ
like, here's the vibe in code form:
my $trans = Zonemaster::Translator->new({ locale => 'sv_SE.UTF-8' });
say $trans->to_string($entry);
that's it. that's the whole mood. you make a translator, you hand it an entry, it hands you back a string β¨
π ATTRIBUTES π
localeβ the locale that should be used to find translation data, iykyk. if you don't explicitly provide one, it defaults to (in this order, and yes the order matters bestie): the contents of the environment variableLANG, thenLC_ALL, thenLC_MESSAGES, or β if none of them are set β it falls back to"en_US.UTF-8". so it's giving "i'll figure it out myself" energy πdataβ a reference to a hash with translation data. ngl, this is unlikely to be useful to end-users, so don't stress about it, it's not your main character moment π
π METHODS π
to_string($entry)β takes aZonemaster::Logger::Entryobject as its argument and returns a translated string with the timestamp, level, message and arguments in the entry. all four of them, together, in one string. iconic π₯translate_tagβ takes aZonemaster::Logger::Entryobject as its argument and returns a translation of its tag and arguments. just the tag and the args, no timestamp, no level. different flavor, same slay πBUILDβ internal method that's only mentioned here to placatePod::Coverage. literally that's the whole reason it's in the docs, it's just here so the coverage checker stops side-eyeing the module π§
π reminder bestie:BUILDis internal, so don't go calling it like it's your bestie's phone number. it's here forPod::Coverage's sake and nothing else π«Ά
and that's the whole page, periodt π
this came to you from the User Contributed Perl Documentation corner of the universe, perl v5.32.0, dated 2021-01-06 β take care of yourselves and your locales, mwah ππ
π¦ where this page comes from
- ubuntu jammy: libzonemaster-perl 1.0.16-2.1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms