Imported Upstream version 1.07 upstream upstream/1.07
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 19 Jul 2022 06:40:33 +0000 (15:40 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 19 Jul 2022 06:40:33 +0000 (15:40 +0900)
META.json
META.yml
README
gettext.pm
t/frconvert.t
test_data/gen_test_data.pl

index fd26a1f217a590a6eb025ad2b5e0a627b6b4920c..1ed5a5bf04e1aedb92404cd51142da86ffbe0f02 100644 (file)
--- a/META.json
+++ b/META.json
@@ -43,5 +43,5 @@
          "url" : "https://github.com/vandry/Perl-Locale-gettext"
       }
    },
-   "version" : "1.06"
+   "version" : "1.07"
 }
index 1ef332ef8ef5afa8008aab984cfff5dff52aa49f..45f62abaf15cb0a620a0c80af9ac9eb1fa656975 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -21,4 +21,4 @@ requires: {}
 resources:
   license: http://dev.perl.org/licenses/
   repository: https://github.com/vandry/Perl-Locale-gettext
-version: 1.06
+version: 1.07
diff --git a/README b/README
index cd06a9d3cd8e6e5a87a90a7892f3ba2e5c81a540..d269e6a23abe53b78ab4c6a96c8e1b0c07a4569d 100644 (file)
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 Locale::gettext
-version 1.06
+version 1.07
 
 This is a perl5 module quickly written to gain access to
 the C library functions for internatialization. They
@@ -18,6 +18,8 @@ specified in the Perl README file.
 Changes
 -------
 
+1.07   Fix test failures caused by $LANGUAGE being set
+
 1.06   Bugfix: #104667 Makefile.PL libaries need to be listed after .o files
        Bugfix: #104668 ensure availability of locale API, correct typo in documentation
        Add META.yml (Fixes #91921)
index d0a5af008d3a9872b1ca7e057d190a25d1cb512f..63bfb1f02dc7544efd9a784066cda1f4ce77772a 100644 (file)
@@ -46,7 +46,7 @@ BEGIN {
        import Encode if ($encode_available);
 }
 
-$VERSION = "1.06" ;
+$VERSION = "1.07" ;
 
 %EXPORT_TAGS = (
 
@@ -268,7 +268,7 @@ not provide it.
 
 =head1 VERSION
 
-1.06.
+1.07.
 
 =head1 SEE ALSO
 
index d33dc117df25509abaf2e14a83bed7ab63a6d574..2bca28b6789b8c2c70c73b62e9afca61d41910a8 100644 (file)
@@ -19,9 +19,6 @@ if ($@ =~ /Encode module not available/) {
        if ($d->get("No problem") eq "Pas de probl\x{e8}me") {
                ok(1);
        } else {
-use Data::Dumper;
-print Dumper($d);
-print "[", $d->get("No problem"), "]\n";
                ok(0);
        }
 }
index 8763f31f05f885ce58161377689ec75710b3c2e5..3e5fd0626e9a0af1f40f72f4a4856a8d556a1f1e 100644 (file)
@@ -4,15 +4,19 @@ sub gen {
        my ($domain) = @_;
 
        my $messages;
+       my $language;
        unless (open(LOCALE, "locale|")) {
                doskip();
        }
        while (<LOCALE>) {
                if (/^LC_MESSAGES=\"(.*)\"$/) {
                        $messages = $1;
-                       last;
                } elsif (/^LC_MESSAGES=(.*)$/) {
                        $messages = $1;
+               } elsif (/^LANGUAGE=\"(.*)\"$/) {
+                       $language = $1;
+               } elsif (/^LANGUAGE=(.*)$/) {
+                       $language = $1;
                }
        }
        close LOCALE;
@@ -20,6 +24,10 @@ sub gen {
                doskip();
        }
 
+       if (!defined($messages)) {
+               skip("cannot run test without a locale set", 0);
+               exit 0;
+       }
        if ($messages eq 'C') {
                skip("cannot run test in the C locale", 0);
                exit 0;
@@ -28,6 +36,15 @@ sub gen {
                skip("cannot run test in the POSIX locale", 0);
                exit 0;
        }
+       if (defined($language) && $language) {
+               # In GNU gettext, $LANGUAGE overrides
+               # all the other environment variables,
+               # for message translations only.
+               # https://www.gnu.org/software/gettext/manual/html_node/The-LANGUAGE-variable.html#The-LANGUAGE-variable
+               # The library will look first for the first entry in
+               # that list, so give it what it wants.
+               $messages = (split(':', $language))[0];
+       }
 
        mkdir "test_data/" . $messages, 0755 unless (-d "test_data/" . $messages);
        mkdir "test_data/" . $messages . "/LC_MESSAGES", 0755