[freeside-commits] freeside/FS/FS Conf.pm, 1.455, 1.456 Msgcat.pm, 1.4, 1.5
Erik Levinson
levinse at wavetail.420.am
Fri Jun 3 15:47:22 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv28005/FS/FS
Modified Files:
Conf.pm Msgcat.pm
Log Message:
internationalization/localization, RT12515
Index: Msgcat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Msgcat.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- Msgcat.pm 11 May 2011 16:20:12 -0000 1.4
+++ Msgcat.pm 3 Jun 2011 22:47:20 -0000 1.5
@@ -74,6 +74,18 @@
warn "WARNING: message for msgcode $msgcode in locale $locale not found"
unless $locale eq 'en_US';
$cache{$locale}->{$msgcode} = $msgcode;
+
+ my @translate_auto_insert = $conf->config('translate-auto-insert');
+ if ( $locale ne 'en_US' && grep { $_ eq $locale } @translate_auto_insert ) {
+
+ # :(
+ my $newmsgcat = new FS::Record('msgcat', { locale => $locale,
+ msgcode => $msgcode,
+ msg => $msgcode,
+ });
+ warn "WARNING: auto-inserting message for msgcode $msgcode in locale $locale";
+ $newmsgcat->insert;
+ }
}
}
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.455
retrieving revision 1.456
diff -u -w -d -r1.455 -r1.456
--- Conf.pm 3 Jun 2011 04:35:56 -0000 1.455
+++ Conf.pm 3 Jun 2011 22:47:20 -0000 1.456
@@ -4459,6 +4459,18 @@
'type' => 'checkbox',
},
+ {
+ 'key' => 'translate-auto-insert',
+ 'section' => '',
+ 'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values. DO NOT TURN THIS ON.',
+ 'type' => 'select-sub',
+ 'multiple' => 1,
+ 'options_sub' => sub { map { $_ => '' }
+ grep { $_ ne 'en_US' } FS::Locales::locales;
+ },
+ 'option_sub' => sub { ''; },
+ },
+
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachines", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
More information about the freeside-commits
mailing list