Skip Menu |

This queue is for tickets about the Catalyst-Plugin-I18N CPAN distribution.

Report information
The Basics
Id: 32132
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-I18N

People
Owner: Nobody in particular
Requestors: knut-olav [...] hoven.ws
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.06
Fixed in: (no value)



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 ($@) {
RT-Send-CC: matt [...] trout.me.uk
I can't rightly commit a patch that breaks backward compatibility. However, as an alternative, I've committed a change that will let you specify any Locale::Maketext::Simple option as a config parameter. Example: __PACKAGE__->config( 'Plugin::I18N' => { maketext_options => { Decode => 0 } } ); Version 0.07 should hit CPAN shortly. -Brian