.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Catalyst::Plugin::I18N::Manual 3pm" .TH Catalyst::Plugin::I18N::Manual 3pm "2022-11-27" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Catalyst::Plugin::I18N::Manual \- (Draft) I18N and L10N with Catalyst and Template Toolkit. .SH "OUTLINE" .IX Header "OUTLINE" .Vb 8 \& Prerequisites: \& \- perl >= 5.8.0 \& \- Catalyst >= 5.33 \& \- Catalyst::Plugin::I18N >= 0.04 \& \- Catalyst::Plugin::Unicode >= 0.2 \& \- Catlayst::View::TT && Template\-Toolkit >= 2.14 \& \- GNU gettext utilities \& \- An editor that understands UTF\-8 and Byte Order Mark (BOM) \& \& $ catalyst.pl MyApp \& created "MyApp" \& created "MyApp/script" \& created "MyApp/lib" \& created "MyApp/root" \& created "MyApp/root/static" \& created "MyApp/root/static/images" \& created "MyApp/t" \& created "MyApp/lib/MyApp" \& created "MyApp/lib/MyApp/Model" \& created "MyApp/lib/MyApp/View" \& created "MyApp/lib/MyApp/Controller" \& created "MyApp/lib/MyApp.pm" \& created "MyApp/Makefile.PL" \& created "MyApp/README" \& created "MyApp/Changes" \& created "MyApp/t/01app.t" \& created "MyApp/t/02pod.t" \& created "MyApp/t/03podcoverage.t" \& created "MyApp/root/static/images/catalyst_logo.png" \& created "MyApp/root/static/images/btn_120x50_built.png" \& created "MyApp/root/static/images/btn_120x50_built_shadow.png" \& created "MyApp/root/static/images/btn_120x50_powered.png" \& created "MyApp/root/static/images/btn_120x50_powered_shadow.png" \& created "MyApp/root/static/images/btn_88x31_built.png" \& created "MyApp/root/static/images/btn_88x31_built_shadow.png" \& created "MyApp/root/static/images/btn_88x31_powered.png" \& created "MyApp/root/static/images/btn_88x31_powered_shadow.png" \& created "MyApp/root/favicon.ico" \& created "MyApp/script/myapp_cgi.pl" \& created "MyApp/script/myapp_fastcgi.pl" \& created "MyApp/script/myapp_server.pl" \& created "MyApp/script/myapp_test.pl" \& created "MyApp/script/myapp_create.pl" \& \& $ cd MyApp \& $ vim lib/MyApp.pm \& \& use Catalyst qw/\-Debug I18N Unicode/; \& \& sub begin : Private { \& my ( $self, $c ) = @_; \& \& my $locale = $c\->request\->param(\*(Aqlocale\*(Aq); \& \& $c\->response\->headers\->push_header( \*(AqVary\*(Aq => \*(AqAccept\-Language\*(Aq ); # hmm vary and param? \& $c\->languages( $locale ? [ $locale ] : undef ); \& } \& \& sub default : Private { \& my ( $self, $c ) = @_; \& \& my $name = $c\->request\->param(\*(Aqname\*(Aq) || $c\->loc(\*(AqGuest\*(Aq); \& \& $c\->response\->content_type(\*(Aqtext/plain; charset=utf\-8\*(Aq); \& $c\->response\->body( $c\->loc( \*(AqWelcome [_1]!\*(Aq, $name ) ); \& } \& \& $ mkdir lib/MyApp/I18N \& $ xgettext.pl \-\-output=lib/MyApp/I18N/messages.pot \-\-directory=lib/ \& $ ls lib/MyApp/I18N/ \& messages.pot \& \& $ msginit \-\-input=lib/MyApp/I18N/messages.pot \-\-output=lib/MyApp/I18N/sv.po \-\-locale=sv \& Created lib/MyApp/I18N/sv.po. \& \& $ vim lib/MyApp/I18N/sv.po \& \& "Content\-Type: text/plain; charset=utf\-8\en" \& \& #: lib/MyApp.pm:50 \& msgid "Guest" \& msgstr "Gäst" \& \& #. ($name) \& #: lib/MyApp.pm:54 \& msgid "Welcome %1!" \& msgstr "Välkommen %1!" \& \& $ perl script/myapp_server.pl \& [Fri Dec 2 03:52:45 2005] [catalyst] [debug] Debug messages enabled \& [Fri Dec 2 03:52:47 2005] [catalyst] [debug] Loaded plugins: \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | Catalyst::Plugin::I18N | \& | Catalyst::Plugin::Unicode | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& [Fri Dec 2 03:52:47 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher" \& [Fri Dec 2 03:52:47 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::HTTP" \& [Fri Dec 2 03:52:47 2005] [catalyst] [debug] Found home "/Users/chansen/MyApp" \& [Fri Dec 2 03:52:48 2005] [catalyst] [debug] Initialized i18n "MyApp::I18N" \& [Fri Dec 2 03:52:48 2005] [catalyst] [debug] Loaded Private actions: \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | Private | Class | Method | \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | /default | MyApp | default | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& [Fri Dec 2 03:52:48 2005] [catalyst] [info] MyApp powered by Catalyst 5.57 \& You can connect to your server at http://localhost:3000 \& \& # point your browser to http://localhost:3000/?name=Joe \& # output should render: \& \& Välkommen Joe! \& \& $ vim lib/MyApp.pm \& \& sub default : Private { \& \& # ... \& \& $c\->response\->body( $c\->loc( \*(AqWelcome to my homepage [_1]!\*(Aq, $name ) ); \& } \& \& $ xgettext.pl \-\-output=lib/MyApp/I18N/messages.pot \-\-directory=lib/ \& $ msgmerge \-\-update lib/MyApp/I18N/sv.po lib/MyApp/I18N/messages.pot \& . done. \& \& $ vim lib/MyApp/I18N/sv.po \& \& #. ($name) \& #: lib/MyApp.pm:54 \& msgid "Welcome to my homepage %1!" \& msgstr "Välkommen till min hemsida %1!" \& \& $ perl script/myapp_server.pl \& \& # point your browser to http://localhost:3000/?name=Joe \& # output should render: \& \& Välkommen till min hemsida Joe! \& \& $ perl script/myapp_create.pl view TT TT \& exists "/Users/chansen/MyApp/script/../lib/MyApp/View" \& exists "/Users/chansen/MyApp/script/../t" \& created "/Users/chansen/MyApp/script/../lib/MyApp/View/TT.pm" \& created "/Users/chansen/MyApp/script/../t/view_TT.t" \& \& $ vim lib/MyApp.pm \& \& sub default : Private { \& my ( $self, $c ) = @_; \& \& my $name = $c\->request\->param(\*(Aqname\*(Aq) || $c\->loc(\*(AqGuest\*(Aq); \& \& $c\->response\->content_type(\*(Aqtext/plain; charset=utf\-8\*(Aq); \& $c\->stash( \& name => $name, \& template => \*(Aqtest.tt\*(Aq \& ); \& \& $c\->forward(\*(AqMyApp::View::TT\*(Aq); \& } \& \& $ vim root/test.tt # Save file in UTF\-8 with BOM \& \& [% c.loc( \*(AqWelcome to my place [_1]!\*(Aq, c.stash.name ) %] \& \& $ xgettext.pl \-\-output=lib/MyApp/I18N/messages.pot \-\-directory=lib/ \-\-directory=root/ \& $ msgmerge \-\-update lib/MyApp/I18N/sv.po lib/MyApp/I18N/messages.pot \& . done. \& \& $ vim lib/MyApp/I18N/sv.po \& \& #. (c.stash.name) \& #: root/test.tt:1 \& msgid "Welcome to my place %1!" \& msgstr "Välkommen till mitt ställe %1!" \& \& $ perl script/myapp_server.pl \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Debug messages enabled \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Loaded plugins: \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | Catalyst::Plugin::I18N | \& | Catalyst::Plugin::Unicode | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher" \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::HTTP" \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Found home "/Users/chansen/MyApp" \& [Fri Dec 2 05:12:58 2005] [catalyst] [debug] Initialized i18n "MyApp::I18N" \& [Fri Dec 2 05:12:59 2005] [catalyst] [debug] Loaded components: \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-. \& | Class | Type | \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+ \& | MyApp::View::TT | instance | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& [Fri Dec 2 05:12:59 2005] [catalyst] [debug] Loaded Private actions: \& .\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-. \& | Private | Class | Method | \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | /default | MyApp | default | \& \*(Aq\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq \& \& [Fri Dec 2 05:12:59 2005] [catalyst] [info] MyApp powered by Catalyst 5.57 \& You can connect to your server at http://localhost:3000 \& \& # point your browser to http://localhost:3000/?name=Joe \& # output should render: \& \& Välkommen till mitt ställe Joe! .Ve .SH "INTRODUCTION" .IX Header "INTRODUCTION" .SH "INTERNATIONALIZATION" .IX Header "INTERNATIONALIZATION" .SH "CONTENT NEGOTIATION" .IX Header "CONTENT NEGOTIATION" .SS "Server-driven" .IX Subsection "Server-driven" .SS "Agent-driven" .IX Subsection "Agent-driven" .SH "LOCALIZATION" .IX Header "LOCALIZATION" .SH "STAYING IN SYNC" .IX Header "STAYING IN SYNC" .SH "TEMPLATE TOOLKIT" .IX Header "TEMPLATE TOOLKIT" .SH "RESOURCES" .IX Header "RESOURCES" .SS "Documentation" .IX Subsection "Documentation" \fIDefinitions\fR .IX Subsection "Definitions" .IP "Internationalization and localization" 4 .IX Item "Internationalization and localization" .IP "Locale" 4 .IX Item "Locale" .IP "Byte Order Mark (\s-1BOM\s0)" 4 .IX Item "Byte Order Mark (BOM)" .IP "Character encoding" 4 .IX Item "Character encoding" .IP "Collation" 4 .IX Item "Collation" .IP "Content Negotiation" 4 .IX Item "Content Negotiation" .IP "Unicode" 4 .IX Item "Unicode" .PP \fIGuides\fR .IX Subsection "Guides" .IP "Guidelines, Checklists, and Resources" 4 .IX Item "Guidelines, Checklists, and Resources" .IP "Localisation Guide" 4 .IX Item "Localisation Guide" .PP \fIPerl\fR .IX Subsection "Perl" .IP "Perl Locale handling" 4 .IX Item "Perl Locale handling" .IP "Perl Unicode introduction" 4 .IX Item "Perl Unicode introduction" .IP "Perl Unicode support" 4 .IX Item "Perl Unicode support" .IP "Unicode-processing issues in Perl and how to cope with it" 4 .IX Item "Unicode-processing issues in Perl and how to cope with it" .IP "Web Localization in Perl" 4 .IX Item "Web Localization in Perl" .IP "Localization and Perl: gettext breaks, Maketext fixes" 4 .IX Item "Localization and Perl: gettext breaks, Maketext fixes" .IP "Lessons Learned with Perl and \s-1UTF\-8\s0" 4 .IX Item "Lessons Learned with Perl and UTF-8" .IP "\s-1UTF\-8\s0 and Perl (In Five Minutes)" 4 .IX Item "UTF-8 and Perl (In Five Minutes)" Slides from a talk given by Mark Fowler. .Sp .IP "Perl Loves \s-1UTF\-8\s0" 4 .IX Item "Perl Loves UTF-8" Slides from a talk given by Tom Insam. .Sp .IP "Perl I18N Mailing List" 4 .IX Item "Perl I18N Mailing List" .IP "Perl Unicode Mailing List" 4 .IX Item "Perl Unicode Mailing List" .PP \fIPortals\fR .IX Subsection "Portals" .IP "Google Directory \- Computers > Software > Globalization" 4 .IX Item "Google Directory - Computers > Software > Globalization" .IP "Internationalization (I18N), Localization (L10N), Standards, and Amusements" 4 .IX Item "Internationalization (I18N), Localization (L10N), Standards, and Amusements" .PP \fIStandards\fR .IX Subsection "Standards" .IP "\s-1RFC 2616\s0 Hypertext Transfer Protocol \*(-- \s-1HTTP/1.1\s0" 4 .IX Item "RFC 2616 Hypertext Transfer Protocol HTTP/1.1" .RS 4 .IP "Section 12: Content Negotiation" 8 .IX Item "Section 12: Content Negotiation" .IP "Section 13: Caching in \s-1HTTP\s0" 8 .IX Item "Section 13: Caching in HTTP" .IP "Section 13.6: Caching Negotiated Responses" 8 .IX Item "Section 13.6: Caching Negotiated Responses" .RE .RS 4 .RE .IP "\s-1RFC 3066\s0 Tags for the Identification of Languages" 4 .IX Item "RFC 3066 Tags for the Identification of Languages" .PP \fIWeb\fR .IX Subsection "Web" .IP "W3C Internationalization (I18N) Activity" 4 .IX Item "W3C Internationalization (I18N) Activity" .IP "Authoring Techniques for \s-1XHTML & HTML\s0 Internationalization: Characters and Encodings 1.0" 4 .IX Item "Authoring Techniques for XHTML & HTML Internationalization: Characters and Encodings 1.0" .IP "Authoring Techniques for \s-1XHTML & HTML\s0 Internationalization: Specifying the language of content 1.0" 4 .IX Item "Authoring Techniques for XHTML & HTML Internationalization: Specifying the language of content 1.0" .SS "Locale Repositories" .IX Subsection "Locale Repositories" .IP "Common Locale Data Repository (\s-1CLDR\s0)" 4 .IX Item "Common Locale Data Repository (CLDR)" .IP "International Components for Unicode (\s-1ICU\s0)" 4 .IX Item "International Components for Unicode (ICU)" .SS "Modules" .IX Subsection "Modules" \fICharacter Encoding, Collation and Normalization\fR .IX Subsection "Character Encoding, Collation and Normalization" .IP "Encode" 4 .IX Item "Encode" .IP "Unicode::Collate" 4 .IX Item "Unicode::Collate" .IP "Unicode::Normalize" 4 .IX Item "Unicode::Normalize" .PP \fICurrency\fR .IX Subsection "Currency" .IP "Locale::Currency::Format" 4 .IX Item "Locale::Currency::Format" .IP "Math::Currency" 4 .IX Item "Math::Currency" .PP \fIDates\fR .IX Subsection "Dates" .IP "DateTime" 4 .IX Item "DateTime" .IP "DateTime::Locale" 4 .IX Item "DateTime::Locale" .IP "DateTime::TimeZone" 4 .IX Item "DateTime::TimeZone" .PP \fILanguage Tags, Identification and Negotiation\fR .IX Subsection "Language Tags, Identification and Negotiation" .IP "HTTP::Negotiate" 4 .IX Item "HTTP::Negotiate" .IP "I18N::AcceptLanguage" 4 .IX Item "I18N::AcceptLanguage" .IP "I18N::LangTags" 4 .IX Item "I18N::LangTags" .Sp .PP \fIMessage Catalogs\fR .IX Subsection "Message Catalogs" .IP "Locale::Maketext" 4 .IX Item "Locale::Maketext" .Sp .IP "Locale::Maketext::Lexicon" 4 .IX Item "Locale::Maketext::Lexicon" .Sp .Sp .IP "Locale::Maketext::Simple" 4 .IX Item "Locale::Maketext::Simple" Provides a simple interface to Locale::Maketext::Lexicon. .Sp .IP "libintl-perl" 4 .IX Item "libintl-perl" .Sp .PP \fINumbers\fR .IX Subsection "Numbers" .IP "Number::Format" 4 .IX Item "Number::Format" .SS "Tools" .IX Subsection "Tools" .IP "\s-1GNU\s0 gettext utilities" 4 .IX Item "GNU gettext utilities" .Sp .Sp .IP "gtranslator" 4 .IX Item "gtranslator" Translation tool for Gnome. Supports gettext catalogs. .Sp .IP "Ini Translator" 4 .IX Item "Ini Translator" Translation tool for Windows 98/Me/XP/2000. Supports several formats, including gettext catalogs. .Sp .IP "KBabel" 4 .IX Item "KBabel" Translation tool for \s-1KDE.\s0 Supports gettext catalogs. .Sp .IP "LocFactory Editor" 4 .IX Item "LocFactory Editor" Translation tool for Mac \s-1OS X.\s0 Supports sevral formats, including gettext catalogs. .Sp .IP "poEdit" 4 .IX Item "poEdit" A cross-platform gettext catalogs editor. .Sp .SH "AUTHOR" .IX Header "AUTHOR" Christian Hansen \f(CW\*(C`ch@ngmedia.com\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.