The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Pgreet::I18N - Locale::Maketext localization for Penguin Greetings

DESCRIPTION

This module is part of the Locale::Maketext localization of secondary ecard sites of Penguin Greetings. See the Locale::Maketext documentation for more information on using this scheme for handling Internationalization/Localization.

USING Pgreet::I18N PENGUIN GREETINGS TEMPLATES

Because this module contains the translation strings used within the Penguin Greetings secondary ecard sites, it could not be used for new applications that require new strings without being overridden or modified. The example below is intended simply to be illustrative as to how the Locale::Maketext module is used within Penguin Greetings secondary ecard sites.

In order to use these translation services first the module must be brought into the template using the use command:

  use Pgreet::I18N;

Next in lieu of using a new constructor, one should get a language handle. The get_handle method requires a language string to be used. This can be gotten from Penguin Greetings by using the lang_code value from the $trans hash passed to every template.

  $LN = Pgreet::I18N->get_handle($trans->{'lang_code'});

Once one has a language handle localization is done by calls to the maketext method. An example below is shown first in Embperl and then in Mason:

  [# Using $LN->maketext in Embperl #]
  [+ $LN->maketext("Received a Savoring Seattle note card?") +]

  <%doc> Using $LN->maketext in Mason </%doc>
  <% $LN->maketext("Received a Savoring Seattle note card?") %>

Please see the Locale::Maketext documentation for general information on how to use this technique for localizing a Perl application.

COPYRIGHT

Copyright (c) 2003-2005 Edouard Lagache

This software is released under the GNU General Public License, Version 2. For more information, see the COPYING file included with this software or visit: http://www.gnu.org/copyleft/gpl.html

BUGS

No known bugs at this time.

AUTHOR

Edouard Lagache <pgreetdev@canebas.org>

VERSION

1.0.0

SEE ALSO

Locale::Maketext, File::Findgrep