Locale::MakePhrase::LanguageRule - rule instance for a given translation.
This is a container for the currently translated phrase. Its main purpose is to validate the translation rule so that Locale::MakePhrase doesn't need to do it.
When implementing custom backing stores, you will need to construct these per translation that can be returned.
The following methods are available:
Construct an instance of the language rule. Takes a hash or hashref with the following options:
key
The input phrase used to generate this translation. (The backing store uses it as a search criteria, hence the name 'key'.)
language
The language tag that is associated with this specific translation.
Since Locale::MakePhrase will ask the backing store for all possible translations of a phrase based on the language tags that it resolved during construction, the translation specific language tag is stored with the actual translation.
expression
The rule expression that will be evaluated when program arguments are supplied when trying to translate a phrase.
priority
When figuring out which rule to apply, Locale::MakePhrase::RuleManager will sort the rules so that the highest priority rules get evaluated first.
translation
This the text that will be output; it can contain placeholders for program argument substitution.
Returns the phrase used as the key for translation lookup.
Returns the language tag for this translated text.
Returns the expression that will be evaluated for this phrase.
Return the priority of this phrase.
Returns the output phrase that matches the input key, for the given language.
You shouldn't need to sub-class this module, as it is simply used as a container.
To install Locale::MakePhrase, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Locale::MakePhrase
CPAN shell
perl -MCPAN -e shell install Locale::MakePhrase
For more information on module installation, please visit the detailed CPAN module installation guide.