Package DE_EPAGES::Dictionary::API::Localizer
This package replaces dictionary entries in a content with real translations.
Example |
use DE_EPAGES::Dictionary::API::Localizer qw ( Replace ); use DE_EPAGES::Dictionary::API::XML::DictionaryImportHandler qw ( ImportDictionary ); my $Dictionary = {}; ImportDictionary($_, $Dictionary) foreach @DictionaryFiles; if (defined $Dictionary->{$LanguageCode}) { $Template = Replace($Template, $Dictionary->{$LanguageCode}) } |
@EXPORT_OK |
Functions
Replace
Exported Function to use this localizer easier. This function registers
- DE_EPAGES::TLE::API::SpaceFormatter
- DE_EPAGES::TLE::API::CaseFormatter
- DE_EPAGES::TLE::API::HtmlFormatter
Syntax |
$Template = Replace( $MasterTemplate, $hStrings ); |
Input |
|
Return |
|
registerHandler
Formatter uses this function to add more functionality to this TLE localizer. You can add different types:
- 'FormatHandler' - functions to format each TLE value ( [] in template)
- 'EncodingHandler' - functions to encode each TLE value (in template)
Syntax |
$ReturnValue = $Localizer->registerHandler( $HandlerType, $Handler, $Name); |
Example |
$TLEProcessor->registerHandler('FormatHandler', DE_EPAGES::TLE::API::SpaceFormatter->new); |
Input |
|