Subject: | Patch to fix problem with Decode parameter |
I see there is a bug report #25050, but this seems to be a total
rewrite.
This bug report is just a minor change of the current version (0.06).
It makes the Decode-parameter to Locale::Maketext::Simple
configurable. The patch defaults the parameter to be false, which I
personally believe is more correct to use. Appling this patch should
make it very clear about this change, so users can update their
configuration file according to the POD of this module (see patch).
Subject: | catalyst-plugin-i18n.patch |
Index: lib/Catalyst/Plugin/I18N.pm
===================================================================
--- lib/Catalyst/Plugin/I18N.pm (revisjon 390)
+++ lib/Catalyst/Plugin/I18N.pm (revisjon 478)
@@ -46,6 +46,22 @@
our %Lexicon = ( 'Hello Catalyst' => 'Hallo Katalysator' );
1;
+=head1 CONFIGURATION
+
+To override the C<Decode> parameter (default to 0), set up configuration in
+your MyApp.pm file like this:
+
+ __PACKAGE__->config(
+ 'i18n' => {
+ 'decode' => 1,
+ },
+ );
+
+or if using YAML configuration file:
+
+ i18n:
+ decode: 1
+
=head2 EXTENDED METHODS
=head3 setup
@@ -60,9 +76,14 @@
my $file = "$calldir.pm";
my $path = $INC{$file};
$path =~ s#\.pm$#/I18N#;
+ my $decode = $self->config->{'i18n'}{'decode'} ? 1 : 0;
eval <<"";
package $self;
- import Locale::Maketext::Simple Path => '$path', Export => '_loc', Decode => 1;
+ import Locale::Maketext::Simple(
+ Path => '$path',
+ Export => '_loc',
+ Decode => $decode
+ );
if ($@) {