Manual Pages for UNIX Darwin command on man Locale::Maketext::Simple
MyWebUniversity

Manual Pages for UNIX Darwin command on man Locale::Maketext::Simple

Locale::Maketext::SimplUes(e3r)Contributed Perl DocumentLaotciaolne::Maketext::Simple(3)

NAME

Locale::Maketext::Simple - Simple interface to

Locale::Maketext::Lexicon VVEERRSSIIOONN

This document describes version 0.18 of Locale::Maketext::Simple,

released Septermber 8, 2006.

SYNOPSIS

Minimal setup (looks for auto/Foo/*.po and auto/Foo/*.mo): package Foo;

use Locale::Maketext::Simple; # exports 'loc'

loclang('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");

}

DESCRIPTION

This module is a simple wrapper around LLooccaallee::::MMaakkeetteexxtt::::LLeexxiiccoonn, designed to alleviate the need of creating Language Classes for module authors. If LLooccaallee::::MMaakkeetteexxtt::::LLeexxiiccoonn 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. OOPPTTIIOONNSS All options are passed either via the "use" statement, or via an explicit "import". CCllaassss By default, LLooccaallee::::MMaakkeetteexxtt::::SSiimmppllee draws its source from the calling package's auto/ directory; you can override this behaviour by explicitly specifying another package as "Class". PPaatthh If your PO and MO files are under a path elsewhere than "auto/", you may specify it using the "Path" option. SSttyyllee By 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.

EExxppoorrtt By 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. SSuubbccllaassss By 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. DDeeccooddee If 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 EEnnccooddee or EEnnccooddee::::ccoommppaatt module. EEnnccooddiinngg Specifies 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". AACCKKNNOOWWLLEEDDGGMMEENNTTSS Thanks to Jos I. Boumans for suggesting this module to be written.

Thanks to Chia-Liang Kao for suggesting "Path" and "loclang".

SEE ALSO

Locale::Maketext, Locale::Maketext::Lexicon AUTHORS Audrey Tang COPYRIGHT Copyright 2003, 2004, 2005, 2006 by Audrey Tang . This software is released under the MIT license cited below. Additionally, when this software is distributed with PPeerrll KKiitt,, VVeerrssiioonn 55, you may also redistribute it and/or modify it under the same terms as Perl itself. The "MIT" License Permission 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.

perl v5.8.8 2006-09-08 Locale::Maketext::Simple(3)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™