/usr/share/perl5/EB/Wx/Locale.pm is in eekboek 2.02.04-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | #! perl
# Locale.pm -- EB Locale setup (GUI version)
# Author : Johan Vromans
# Created On : Fri Sep 16 20:27:25 2005
# Last Modified By: Johan Vromans
# Last Modified On: Tue Mar 8 14:07:23 2011
# Update Count : 161
# Status : Unknown, Use with caution!
package EB::Locale;
# IMPORTANT:
#
# This module is used (require-d) by module EB only.
# No other modules should try to play localisation tricks.
#
# Note: Only _T must be defined. The rest is defined in EB::Utils.
use strict;
use constant GUIPACKAGE => "ebwxshell";
use constant COREPACKAGE => "ebcore";
use base qw(Exporter);
our @EXPORT_OK = qw(_T);
our @EXPORT = @EXPORT_OK;
use Wx qw(wxLANGUAGE_DEFAULT wxLOCALE_LOAD_DEFAULT);
use Wx::Locale gettext => '_T';
my $gui_localiser;
our $LOCALISER = "Wx::Locale";
unless ( $gui_localiser ) {
$gui_localiser = Wx::Locale->new( wxLOCALE_LOAD_DEFAULT, wxLOCALE_LOAD_DEFAULT );
__PACKAGE__->_set_language( wxLANGUAGE_DEFAULT );
}
sub get_language {
$gui_localiser->GetCanonicalName;
}
sub _set_language {
# Set/change language.
my ($self, $lang) = @_;
$gui_localiser->Init( $lang, wxLOCALE_LOAD_DEFAULT );
# Since EB is use-ing Locale, we cannot use the EB exported libfile yet.
$gui_localiser->AddCatalogLookupPathPrefix(EB::libfile("locale"));
$gui_localiser->AddCatalog(GUIPACKAGE);
$gui_localiser->AddCatalog(COREPACKAGE);
}
sub set_language {
# Set/change language.
my ($self, $lang) = @_;
$lang =~ s/\..*//; # strip .utf8
my $info = Wx::Locale::FindLanguageInfo($lang);
unless ( $info ) {
# Universal error message.
warn("%Ne povos sxangi la lingvon -- Neniu dateno por $lang\n");
return;
}
$self->_set_language( $info->GetLanguage );
}
1;
|