[Koha-bugs] [Bug 8044] Localization for Perl scripts and modules
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri May 4 15:05:04 CEST 2012
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8044
--- Comment #2 from Julian Maurice <julian.maurice at biblibre.com> ---
Created attachment 9415
-->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9415&action=edit
First draft for Koha localization using Locale::Maketext
You have to use the new module Koha::I18N
Code example:
use Koha::I18N;
use CGI;
my $input = new CGI;
my $lh = Koha::I18N->get_handle_from_context($input, 'intranet');
print $lh->maketext("Localized string!");
PO files are in locale/LANG/messages.po.
To create PO file for a language, just make a directory under locale/
and launch locale/update_po.pl.
The directory name must be in lowercase with '_' instead of '-'.
For example: for french, create locale/fr_fr/ directory.
Missing PO files are created, and existing ones are updated.
You can then translate the PO with your favorite editor. Strings will be
localized at runtime.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list