source: trunk/LATMOS-Accounts/lib/LATMOS/Accounts/I18N.pm @ 2569

Last change on this file since 2569 was 2240, checked in by nanardon, 5 years ago

Revert back po files

File size: 1.2 KB
Line 
1package LATMOS::Accounts::I18N;
2use 5.010000;
3use strict;
4use warnings;
5use Exporter ();
6use vars qw(@ISA @EXPORT_OK @EXPORT);
7use utf8;
8use LATMOS::Accounts::Log;
9use Locale::gettext;
10use POSIX ();
11
12our $VERSION = (q$Rev$ =~ /^Rev: (\d+) /)[0];
13
14=head1 NAME
15
16LATMOS::Accounts::Utils - Utils functions
17
18=cut
19
20@ISA = qw(Exporter);
21@EXPORT = 'l';
22@EXPORT_OK = 'l';
23
24my $init;
25
26if (!$init) {
27
28    if (-d 'po') {
29        Locale::gettext::bindtextdomain('linkaccounts', 'po')
30    }
31    Locale::gettext::bind_textdomain_codeset('linkaccounts', 'UTF-8');
32    $init = 1;
33}
34
35=head1 FUNCTIONS
36
37=head2 l($text, @args)
38
39Return the translate messsage, using printf.
40
41=cut
42
43sub l { 
44    my ($text, @args) = @_;
45    my $trans = Locale::gettext::dgettext('linkaccounts', $text || '');
46
47    return sprintf($trans || $text, @args);
48}
49
501;
51
52__END__
53
54=head1 SEE ALSO
55
56L<sudo>
57
58=head1 AUTHOR
59
60Olivier Thauvin, E<lt>olivier.thauvin@aerov.jussieu.frE<gt>
61
62=head1 COPYRIGHT AND LICENSE
63
64Copyright (C) 2008, 2009, 2010, 2011, 2012 CNRS SA/CETP/LATMOS
65
66This library is free software; you can redistribute it and/or modify
67it under the same terms as Perl itself, either Perl version 5.10.0 or,
68at your option, any later version of Perl 5 you may have available.
69
70=cut
Note: See TracBrowser for help on using the repository browser.