Locale::Maketext::Simple - Online Linux Manual PageSection : 3pm
Updated : 2022-03-15
Source : perl v5.34.1
Note : Perl Programmers Reference Guide

NAMELocale::Maketext::Simple − Simple interface to Locale::Maketext::Lexicon

VERSIONThis document describes version 0.18 of Locale::Maketext::Simple, released Septermber 8, 2006.

SYNOPSISMinimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo): ​ package Foo; ​ use Locale::Maketext::Simple; # exports 'loc' ​ loc_lang('fr'); # set language to French ​ sub hello { ​ print loc("Hello, [_1]!", "World"); ​ } More sophisticated example: ​ package Foo::Bar; ​ use Locale::Maketext::Simple ( ​ Class => 'Foo', # search in auto/Foo/ ​ Style => 'gettext', # %1 instead of [_1] ​ Export => 'maketext', # maketext() instead of loc() ​ Subclass => 'L10N', # Foo::L10N instead of Foo::I18N ​ Decode => 1, # decode entries to unicode−strings ​ Encoding => 'locale', # but encode lexicons in current locale ​ # (needs Locale::Maketext::Lexicon 0.36)); ​ sub japh { ​ print maketext("Just another %1 hacker", "Perl"); ​ }

DESCRIPTIONThis module is a simple wrapper around Locale::Maketext::Lexicon, designed to alleviate the need of creating Language Classes for module authors. The language used is chosen from the loc_lang call. If a lookup is not possible, the i−default language will be used. If the lookup is not in the i−default language, then the key will be returned. If Locale::Maketext::Lexicon is not present, it implements a minimal localization function by simply interpolating [_1] with the first argument, [_2] with the second, etc. Interpolated function like [quant,_1] are treated as [_1], with the sole exception of [tense,_1,X], which will append ing to _1 when X is present, or appending ed to <_1> otherwise.

OPTIONSAll options are passed either via the use statement, or via an explicit import.

ClassBy default, Locale::Maketext::Simple draws its source from the calling package's auto/ directory; you can override this behaviour by explicitly specifying another package as Class.

PathIf your PO and MO files are under a path elsewhere than auto/, you may specify it using the Path option.

StyleBy default, this module uses the maketext style of [_1] and ​[quant,_1] for interpolation. Alternatively, you can specify the ​gettext style, which uses %1 and %quant(%1) for interpolation. This option is case-insensitive.

ExportBy default, this module exports a single function, loc, into its caller's namespace. You can set it to another name, or set it to an empty string to disable exporting.

SubclassBy default, this module creates an ::I18N subclass under the caller's package (or the package specified by Class), and stores lexicon data in its subclasses. You can assign a name other than ​I18N via this option.

DecodeIf set to a true value, source entries will be converted into utf8−strings (available in Perl 5.6.1 or later). This feature needs the Encode or Encode::compat module.

EncodingSpecifies an encoding to store lexicon entries, instead of utf8−strings. If set to locale, the encoding from the current locale setting is used. Implies a true value for Decode.

ACKNOWLEDGMENTSThanks to Jos I. Boumans for suggesting this module to be written. Thanks to Chia-Liang Kao for suggesting Path and loc_lang.

SEE ALSOLocale::Maketext, Locale::Maketext::Lexicon

AUTHORSAudrey Tang <cpan@audreyt.org>

COPYRIGHTCopyright 2003, 2004, 2005, 2006 by Audrey Tang <cpan@audreyt.org>. This software is released under the MIT license cited below. Additionally, when this software is distributed with Perl Kit, Version 5, you may also redistribute it and/or modify it under the same terms as Perl itself.

The ``MIT'' LicensePermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0
Johanes Gumabo
Data Size   :   16,587 byte
man-Locale::Maketext::Simple.3pmBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 177,157
Visitor ID   :     :  
Visitor IP   :   18.224.43.98   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|Locale::Maketext::Simple.3pm|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|Locale::Maketext::Simple.3pm|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|Locale::Maketext::Simple.3pm|43|br══─}─══|'br══─}─══ )         (htmlprn|149|Locale::Maketext::Simple.3pm|43|'br══─}─══ |'br══─}─══ )