[Po4a-commits] r2249 - /trunk/lib/Locale/Po4a/Xml.pm

barbier-guest at users.alioth.debian.org barbier-guest at users.alioth.debian.org
Mon Sep 20 23:18:31 UTC 2010


Author: barbier-guest
Date: Mon Sep 20 23:18:30 2010
New Revision: 2249

URL: http://svn.debian.org/wsvn/po4a/?sc=1&rev=2249
Log:
Fix a nasty bug with Xml and derived modules

Due to caching, options on a file may have some
incidence on other files.  For instance, with
  [type: xhtml] foo $lang:build/foo opt:nodefault=<a>
  [type: xhtml] bar $lang:build/bar
if an occurence of <a> has the same path in foo and bar,
then it will be handled as nodefault both in foo and bar.

Modified:
    trunk/lib/Locale/Po4a/Xml.pm

Modified: trunk/lib/Locale/Po4a/Xml.pm
URL: http://svn.debian.org/wsvn/po4a/trunk/lib/Locale/Po4a/Xml.pm?rev=2249&op=diff
==============================================================================
--- trunk/lib/Locale/Po4a/Xml.pm (original)
+++ trunk/lib/Locale/Po4a/Xml.pm Mon Sep 20 23:18:30 2010
@@ -70,6 +70,7 @@
 my %entities;
 
 my @comments;
+my %translate_options_cache;
 
 my $_shiftline_in_comment = 0;
 sub shiftline {
@@ -553,6 +554,9 @@
 	$self->{nodefault}=();
 
 	$self->treat_options;
+
+	#  Clear cache
+	%translate_options_cache=();
 }
 
 =head1 WRITING DERIVATE MODULES
@@ -1266,7 +1270,6 @@
 #   n: a custom tag
 #
 # A translatable inline tag in an untranslated tag is treated as a translatable breaking tag.
-my %translate_options_cache;
 sub get_translate_options {
 	my $self = shift;
 	my $path = shift;




More information about the Po4a-commits mailing list