Zonema...slator(3pm)

πŸ“¦ version 1.0.16, in ubuntu jammy

πŸ’– 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 variable LANG, then LC_ALL, then LC_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 a Zonemaster::Logger::Entry object 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 a Zonemaster::Logger::Entry object 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 placate Pod::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: BUILD is internal, so don't go calling it like it's your bestie's phone number. it's here for Pod::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