Log::R...tdomain(3pm)
π 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 viatranslateTo(). lowkey a moving target bestie π«Άlexicon => DIRECTORYβ same deal, the directory, per the defaults list.name => STRINGβ the name, required, comes fromLog::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. seefunction(). 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 byconfigure() - Warning: Missing key
'$key'in format'$format', in$use//template β Cast bytranslationFunction() - Fault: cannot open JSON file for context at
$fn:$!β Cast byreadConfig() - Error: extension to domain
'$name'already exists β Cast byupgrade() - Error: message does not contain counting alternatives in
'$msgid'β Cast bytranslationFunction() - Error: no counting positional for
'$msgid'β Cast bytranslationFunction() - Error: no counting positional for
'$msgid'β Cast bytranslationFunction() - Error: superfluous positional parameters for
'$msgid'β Cast bytranslationFunction() - Error: superfluous positional parameters for
'$msgid'β Cast bytranslationFunction() - Error: the native_language
'$locale'is not a valid locale β Cast byconfigure() - Error: unsupported context file type for
$fnβ Cast byreadConfig() - 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
- ubuntu resolute: liblog-report-template-perl 1.04-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: liblog-report-template-perl 1.04-1 Β· 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