| 1 | package App::rdapper::l10n; | ||
| 2 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | =pod | ||
| 5 | |||
| 6 | =head1 NAME | ||
| 7 | |||
| 8 | C<App::rdapper::l10n> - internationalisation support for L<App::rdapper> | ||
| 9 | |||
| 10 | =head1 DESCRIPTION | ||
| 11 | |||
| 12 | The L<rdapper|App::rdapper> RDAP client can generate output that is localized to | ||
| 13 | the user's locale. It uses L<Locale::Maketext::Gettext> and a dictionary of | ||
| 14 | translated strings stored in .po files. | ||
| 15 | |||
| 16 | =head1 TRANSLATING STRINGS | ||
| 17 | |||
| 18 | C<rdapper> has an undocumented command line option, C<--strings>, which causes | ||
| 19 | it to print a .pot template on STDOUT. This is used to generate the | ||
| 20 | C<rdapper.pot> file in the C<locale> directory. | ||
| 21 | |||
| 22 | This directory contains subdirectories for each supported locale. To create a | ||
| 23 | new locale, create a new subdirectory and copy C<rdapper.pot> into it: | ||
| 24 | |||
| 25 | $ mkdir -p ja/LC_MESSAGES | ||
| 26 | $ cp rdapper.pot ja/LC_MESSAGES/rdapper.po | ||
| 27 | |||
| 28 | Once you have finished editing C<rdapper.po>, run C<mkmo.sh> to compile the | ||
| 29 | .po files into .mo files. These files are installed automatically when rdapper | ||
| 30 | is installed. | ||
| 31 | |||
| 32 | You will also need to edit the file C<l10.pm> to add a new package, which must | ||
| 33 | look like this: | ||
| 34 | |||
| 35 | package App::rdapper::l10n::ja; | ||
| 36 | use base qw(Locale::Maketext::Gettext); | ||
| 37 | 1; | ||
| 38 | |||
| 39 | =head1 CONTRIBUTING TRANSLATIONS | ||
| 40 | |||
| 41 | Translations are gratefully accepted. To contribute one, please L<fork the | ||
| 42 | repository|https://github.com/gbxyz/rdapper/fork>, make your edits, and then | ||
| 43 | L<submit a pull request|https://github.com/gbxyz/rdapper/compare>. | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | 2 | 1; | |
| 48 | |||
| 49 | # | ||
| 50 | # if you're adding a new language package, put it **BELOW** this comment! | ||
| 51 | # | ||
| 52 | |||
| 53 | package App::rdapper::l10n::en; | ||
| 54 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 55 | 2 | 1; | |
| 56 | |||
| 57 | package App::rdapper::l10n::es; | ||
| 58 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 59 | 2 | 1; | |
| 60 | |||
| 61 | package App::rdapper::l10n::fr; | ||
| 62 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 63 | 2 | 1; | |
| 64 | |||
| 65 | package App::rdapper::l10n::de; | ||
| 66 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 67 | 2 | 1; | |
| 68 | |||
| 69 | package App::rdapper::l10n::pt; | ||
| 70 | 2 | ▶ | use base qw(Locale::Maketext::Gettext); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 71 | 2 | 1; | |
| 72 | |||
| 73 | # | ||
| 74 | # if you're adding a new language package, put it **ABOVE** this comment! | ||
| 75 | # | ||