com php-src: added test for things done so far for bug #66265: ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain .mo
ext/gettext/tests/66265/de_DE/LC_MESSAGES /domain.po ext/gettext/tests/66265/en_US/LC_M ESSAGES/domain.mo ext/gettext/tests/66265/en_US
/LC_MESSAGES/domain.po ext/gettext/tests/66265/ fr_FR/LC_MESSAGES/domain.mo ext/gettext/tests/662 65/fr_FR/LC_MESSAGES/domain.po ext/gettext/tests/bu
g66267.phpt
| From: | Anatol Belski | Date: | Fri, 21 Nov 2014 09:22:47 +0000 |
| Subject: | com php-src: added test for things done so far for bug #66265: ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain .mo ext/gettext/tests/66265/de_DE/LC_MESSAGES /domain.po ext/gettext/tests/66265/en_US/LC_M ESSAGES/domain.mo ext/gettext/tests/66265/en_US /LC_MESSAGES/domain.po ext/gettext/tests/66265/ fr_FR/LC_MESSAGES/domain.mo ext/gettext/tests/662 65/fr_FR/LC_MESSAGES/domain.po ext/gettext/tests/bu g66267.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83217@lists.php.net to get a copy of this message | ||
Commit: f2e33dc725ebc56a4871ae38e3a36ec96dba21ea
Author: Anatol Belski <ab@php.net> Fri, 21 Nov 2014 10:22:47 +0100
Parents: 56fac96bec882ac59a7fc298c98407bf4a17629d
Branches: PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f2e33dc725ebc56a4871ae38e3a36ec96dba21ea
Log:
added test for things done so far for bug #66265
Bugs:
https://bugs.php.net/66265
Changed paths:
A ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
A ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
A ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
A ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
A ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
A ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
A ext/gettext/tests/bug66267.phpt
Diff:
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000..1aaba7b
Binary files /dev/null and b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo differ
diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
new file mode 100644
index 0000000..d2496d7
--- /dev/null
+++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: de_DE\n"
+
+msgid "hello"
+msgstr "hallo"
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000..79d02c1
Binary files /dev/null and b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo differ
diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
new file mode 100644
index 0000000...670d7dd
--- /dev/null
+++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:40+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: en_US\n"
+
+msgid "hello"
+msgstr "hello"
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo
new file mode 100644
index 0000000..c2f3cdd
Binary files /dev/null and b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo differ
diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
new file mode 100644
index 0000000..c2f708c
--- /dev/null
+++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po
@@ -0,0 +1,17 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: bugs.php.net/66265\n"
+"POT-Creation-Date: 2014-11-20 16:33+0100\n"
+"PO-Revision-Date: 2014-11-20 16:59+0100\n"
+"Last-Translator: <ab@php.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+"X-Poedit-Basepath: .\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: fr_FR\n"
+
+msgid "hello"
+msgstr "salut"
diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt
new file mode 100644
index 0000000..c3aa423
--- /dev/null
+++ b/ext/gettext/tests/bug66267.phpt
@@ -0,0 +1,47 @@
+--TEST--
+#66265: gettext doesn't switch locales within the same script
+--SKIPIF--
+<?php
+if (!extension_loaded("gettext")) {
+ die("skip\n");
+}
+if (PHP_ZTS) {
+ /* this is supposed to fail on the TS build at least on Windows,
+ should be even XFAIL till it's fixed there */
+ die("skip NTS only");
+}
+?>
+--FILE--
+<?php
+
+$domain = 'domain';
+
+$loc = ["de_DE", "fr_FR", "en_US"];
+
+foreach ($loc as $l) {
+ putenv("LC_ALL=$l");
+
+ $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265");
+ bindtextdomain($domain, $path);
+ bind_textdomain_codeset($domain, "UTF-8");
+ textdomain($domain);
+
+ echo 'LC_ALL=', getenv('LC_ALL'), "\n";
+ echo 'hello=', _('hello'), "\n";
+ echo "\n";
+}
+
+?>
+==DONE==
+--EXPECTF--
+LC_ALL=de_DE
+hello=hallo
+
+LC_ALL=fr_FR
+hello=salut
+
+LC_ALL=en_US
+hello=hello
+
+==DONE==
+