File: gettext.pl

package info (click to toggle)
dhelp 0.6.32
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 604 kB
  • sloc: ruby: 1,171; sh: 555; perl: 372; makefile: 77
file content (20 lines) | stat: -rw-r--r-- 574 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use Locale::gettext;
use POSIX;

my $gettext = Locale::gettext->domain_raw("dhelp");
$gettext->codeset('UTF-8'); # Always UTF-8, specified in the HTML templates

foreach my $locale (qw(
        de_DE.utf8
        el_GR.utf8
        es_ES.utf8
        eu_ES.utf8
        id_ID.utf8
        ru_RU.utf8
        fr_FR.utf8
    )) {
    setlocale(LC_MESSAGES, $locale);
    my $string = "No search database found.\nPlease run /etc/cron.weekly/dhelp as superuser to create it.";
    print "LOCALE $locale ============================\n";
    print $gettext->get($string), "\n";
}