Closed MichaelHoste closed 3 years ago
4 tests on Travis are failing for PHP version <= 7.0 (see below). They seem related to French, with the newly supported "1e6" notation. Do you have an idea what went wrong? Did something change between PHP 7.0 and 7.1 regarding RegExps or number interpretation?
That's not related to this issue, but I did the Ruby exporter on top of the CLDR 38 for personal usage here: https://github.com/MichaelHoste/Languages/compare/master...MichaelHoste:ruby?expand=1
If you're interested, I can create a PR for it too.
There were 4 failures:
1) Gettext\Languages\Test\RulesTest::testRules with data set #112 ('php', 'fr', '(n == 0 || n == 1) ? 0 : ((n ...1 : 2)', array('one', 'many', 'other'), '1000000, 1e6, 2e6, 3e6, 4e6, ...6, …', 'many')
The formula '(n == 0 || n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2)' evaluated for 1 resulted in 'one' (0) instead of 'many' (1) (format: php)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-many
+one
/home/travis/build/php-gettext/Languages/tests/test/RulesTest.php:49
2) Gettext\Languages\Test\RulesTest::testRules with data set #113 ('php', 'fr', '(n == 0 || n == 1) ? 0 : ((n ...1 : 2)', array('one', 'many', 'other'), '2~17, 100, 1000, 10000, 10000...3, …', 'other')
The formula '(n == 0 || n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2)' evaluated for 1 resulted in 'one' (0) instead of 'other' (1) (format: php)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-other
+one
/home/travis/build/php-gettext/Languages/tests/test/RulesTest.php:49
3) Gettext\Languages\Test\RulesTest::testRules with data set #574 ('json', 'fr', '(n == 0 || n == 1) ? 0 : ((n ...1 : 2)', array('one', 'many', 'other'), '1000000, 1e6, 2e6, 3e6, 4e6, ...6, …', 'many')
The formula '(n == 0 || n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2)' evaluated for 1 resulted in 'one' (0) instead of 'many' (1) (format: json)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-many
+one
/home/travis/build/php-gettext/Languages/tests/test/RulesTest.php:49
4) Gettext\Languages\Test\RulesTest::testRules with data set #575 ('json', 'fr', '(n == 0 || n == 1) ? 0 : ((n ...1 : 2)', array('one', 'many', 'other'), '2~17, 100, 1000, 10000, 10000...3, …', 'other')
The formula '(n == 0 || n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2)' evaluated for 1 resulted in 'one' (0) instead of 'other' (1) (format: json)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-other
+one
/home/travis/build/php-gettext/Languages/tests/test/RulesTest.php:49
They just released version 39 of CLDR
I noticed 😕 but https://github.com/unicode-org/cldr-json is still on 38.1.
Do you have an easy way to generate the version 39 JSON files from the XML ones?
Looks like cldr-json is now on v39 too
4 tests on Travis are failing for PHP version <= 7.0 (see below)
This is the reason: https://3v4l.org/p57v7
I'm going to fix it.
Tomorrow, I will certainly add a new Ruby export format, I hope you'll be ok to merge it.
@MichaelHoste I promise you won't have to wait that much anymore if you are still interested in submitting a Ruby export format
I had to change
en-US
toen-US-POSIX
Why? Because you weren't able to find the CLDR json data for en-US
?
If so, I added to the readme the instructions about how we can build en-US
json data: https://github.com/php-gettext/Languages#generating-the-cldr-data
Thank you @mlocati for improving and merging this PR!
I had to change en-US to en-US-POSIX
Why? Because you weren't able to find the CLDR json data for en-US?
Yes, I took it from here, and I found only en
and en-US-POSIX
, not en-US
, I'm not sure why.
Thank you for the instructions, it could be useful later!
@MichaelHoste I promise you won't have to wait that much anymore if you are still interested in submitting a Ruby export format
I'll see what I can do, I don't remember well what state it was in. I'll keep you in touch. Thank you again!
This is a bump to the CLDR data from 36 to 38.
I had to change
en-US
toen-US-POSIX
and adapt some RegExp to deal with the new letter "e" that is used for exponents (that was added by CLDR for the newmany
French syntax!).I also completed the README with this new information.
The tests pass, but i'm not sure if what I did was correct 🤞
Tomorrow, I will certainly add a new Ruby export format, I hope you'll be ok to merge it.
Thank you for this nice tool!