Log::R...tdomain(3pm)

πŸ“¦
version 1.04 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Log::Report::Template::Textdomain β€” the manual, but make it cute πŸ’–

okay bestie, so this is the user-contributed Perl documentation for Log::Report::Template::Textdomain, aka Log::R...tdomain(3pm). yes the man page title is literally truncated like that, that's just how the perl man pages do it, it's iconic honestly. sit down, grab a strawberry, let's go πŸ“


✨ NAME ✨

Log::Report::Template::Textdomain β€” template translation with one domain

🌈 INHERITANCE 🌈

Log::Report::Template::Textdomain
  is a Log::Report::Domain
  is a Log::Report::Minimal::Domain

so it's giving generational wealth, the whole family tree is right there πŸ‘‘

πŸ¦‹ SYNOPSIS πŸ¦‹

my $templater = Log::Report::Template->new(...);
my $domain    = $templater->addTextdomain(%options);

that's it, that's the vibe check.

🌸 DESCRIPTION 🌸

Manage one translation domain for Log::Report::Template.

Extends "DESCRIPTION" in Log::Report::Domain.

πŸ’… METHODS πŸ’…

Extends "METHODS" in Log::Report::Domain.

πŸŽ€ Constructors

Extends "Constructors" in Log::Report::Domain.

$class->new(%options)

Inherited, see "Constructors" in Log::Report::Domain.

here's the options lineup, no cap:

 -Option              --Defined in                  --Default
  lang                                                undef
  lexicon                                             undef
  name                  Log::Report::Minimal::Domain  <required>
  only_in_directory                                   undef
  templater                                           <required>
  translation_function                                'loc'
  • lang => LANGUAGES β€” [1.01] the initial language to translate to. usually this is the language that will change for each user connection via translateTo(). lowkey a moving target bestie 🫢
  • lexicon => DIRECTORY β€” same deal, the directory, per the defaults list.
  • name => STRING β€” the name, required, comes from Log::Report::Minimal::Domain.
  • only_in_directory => DIRECTORY|ARRAY β€” the textdomain can only be used in the indicated directories. if it's found anywhere else, it's an error, red flag, blocked 🚫. when it's not specified, the function is allowed everywhere. free range textdomain fr fr.
  • templater => Log::Report::Template-object β€” the templater object, required.
  • translation_function => STRING β€” the name of the function as used in the template to call for translation. see function(). it must be unique over all textdomains used. no dupe usernames allowed, this is not a group chat 🌈

$class->upgrade($domain, %options)

Upgrade a base class Log::Report::Domain-object into an Template domain.

This is a bit akward process, needed when one of the code packages uses the same domain as the templating system uses. The generic domain configuration stays intact.

like a glow-up but for an object πŸ’… the original config does not get touched, we're just adding the template serve.

πŸ’œ Attributes

Extends "Attributes" in Log::Report::Domain.

$obj->configure(%options)

Inherited, see "Attributes" in Log::Report::Domain.

$obj->contextRules()

Inherited, see "Attributes" in Log::Report::Domain.

$obj->expectedIn($filename)

Return "true" when the function name which relates to this domain is allowed to be used for the indicated file. The msgid extractor will warn when there is no match.

so it's basically the bouncer at the door of this function name πŸ”₯ returns true or nothing, and if it doesn't match the extractor is gonna be like "um"? warning incoming.

$obj->function()

Returns the name of the function which is used for translations.

$obj->isConfigured()

Inherited, see "Attributes" in Log::Report::Minimal::Domain.

$obj->lang()

The language we are going to translate to. Change this with translateTo() for this domain, or better Log::Report::Template::translateTo().

ngl the second option is the main character here, use that one.

$obj->lexicon()

Directory where the translation tables are kept.

$obj->name()

Inherited, see "Attributes" in Log::Report::Minimal::Domain.

$obj->nativeLanguage()

Inherited, see "Attributes" in Log::Report::Domain.

$any->readConfig($filename)

Inherited, see "Attributes" in Log::Report::Domain.

$obj->templater()

The Log::Report::Template object which is using this textdomain.

$obj->translator()

Inherited, see "Attributes" in Log::Report::Domain.

🌟 Translating

Extends "Translating" in Log::Report::Domain.

$obj->defaultContext()

Inherited, see "Translating" in Log::Report::Domain.

$obj->interpolate( $msgid, [$args] )

Inherited, see "Translating" in Log::Report::Minimal::Domain.

$obj->setContext(STRING|HASH|ARRAY|PAIRS)

Inherited, see "Translating" in Log::Report::Domain.

$obj->translate($message, $language)

Inherited, see "Translating" in Log::Report::Domain.

$obj->translateTo($lang)

Set the language to translate to for $lang, for this domain only. This may be useful when various text domains do not support the same destination languages. But in general, you can best use Log::Report::Template::translateTo().

like, technically you can do it domain-by-domain, but the general approach is the big one, iykyk πŸ’«

$obj->translationFunction()

This method returns a CODE which is able to handle a call for translation by Template Toolkit.

it hands you back a CODE ref, and that ref knows what to do when Template Toolkit comes knocking 🫢

$obj->updateContext(STRING|HASH|ARRAY|PAIRS)

Inherited, see "Translating" in Log::Report::Domain.

πŸ’Ž DETAILS πŸ’Ž

Extends "DETAILS" in Log::Report::Domain.

😭 DIAGNOSTICS 😭

like, everything below is a real thing that can get thrown at you. read it, bestie, it's for your own good.

  • Warning: Missing key '$key' in format '$format', file $use β€” Cast by configure()
  • Warning: Missing key '$key' in format '$format', in $use //template β€” Cast by translationFunction()
  • Fault: cannot open JSON file for context at $fn: $! β€” Cast by readConfig()
  • Error: extension to domain '$name' already exists β€” Cast by upgrade()
  • Error: message does not contain counting alternatives in '$msgid' β€” Cast by translationFunction()
  • Error: no counting positional for '$msgid' β€” Cast by translationFunction()
  • Error: no counting positional for '$msgid' β€” Cast by translationFunction()
  • Error: superfluous positional parameters for '$msgid' β€” Cast by translationFunction()
  • Error: superfluous positional parameters for '$msgid' β€” Cast by translationFunction()
  • Error: the native_language '$locale' is not a valid locale β€” Cast by configure()
  • Error: unsupported context file type for $fn β€” Cast by readConfig()
  • Error: you need to configure context_rules before setContext β€” Cast by setContext()

(and yes, the "no counting positional" one and the "superfluous positional parameters" one each appear twice in the original. not a typo on my end, they're really listed twice, slay ✨)

πŸ‘‘ SEE ALSO πŸ‘‘

This module is part of Log-Report-Template version 1.04, built on November 04, 2025. Website: http://perl.overmeer.net/CPAN/

πŸŽ€ LICENSE πŸŽ€

For contributors see file ChangeLog.

This software is copyright (c) 2017-2025 by Mark Overmeer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.


and that's the whole page babes πŸ’– this was perl v5.40.1, dated 2026-01-24, filed under Log::R...tdomain(3pm). go forth and translate your templates, you absolute icon πŸ¦‹βœ¨

πŸ“¦ where this page comes from