Subject: | Locale::Maketext::Extract::Plugin::FormFu broken |
Hi,
current version of Locale::Maketext::Extract::Plugin::FormFu doesnt work
as expected. We're currently working on localization of MojoMojo and had
problems using FormFu extractor plugin. I'll attach MojoMojo FormFu
config files so you have something to test against:
xgettext.pl -D ./forms -o test.po
I'll also attach some diff which fixes the issue. But it's only tested
with YAML config files for FormFu.
The current version just includes the whole YAML file into the .po file :(
Kind regards,
Johannes
Subject: | mojomojo-root-forms.tar.bz2 |
Message body not shown because it is not plain text.
Subject: | locale-maketext-extract-plugin-formfu.diff |
--- lib/Locale/Maketext/Extract/Plugin/FormFu.pm 2008-12-28 17:57:47.000000000 +0100
+++ /opt/perl/lib/site_perl/5.8.8/Locale/Maketext/Extract/Plugin/FormFu.pm 2008-09-21 20:21:54.000000000 +0200
@@ -47,14 +47,14 @@
sub extract {
my $self = shift;
- my $content = shift;
- my $lno = 0;
- foreach my $line (split /\n/, $content) {
- $lno++;
- if (my ($str) = $line =~ /.*?_loc[:]*\s+(.*?)$/) {
- $self->add_entry($str, $lno);
- }
+ local $_ = shift;
+ my$line = 1;
+ while (m/\G(.*?_loc:\s+(.*))/sg) {
+ my ($str) = $2;
+ $line += ( () = ($1 =~ /\n/g) ); # cryptocontext!
+ $self->add_entry($str, $line );
}
+
}
=head1 SEE ALSO