Giter VIP home page Giter VIP logo

languages's People

Contributors

damnedest avatar michaelhoste avatar mlocati avatar nijel avatar peter279k avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

languages's Issues

How are the "Plural-Form" indices determined?

Hello!

What determines the "Plural-Form" formula in PO translation files?

I see that the actual way is to use the same order the plural forms appear in this JSON file https://github.com/php-gettext/Languages/blob/master/src/cldr-data/supplemental/plurals.json , which, I suspect, comes from https://github.com/unicode-org/cldr/blob/main/common/supplemental/plurals.xml

Is it how it should be though? Is the CLDR data not just the source of grammar laws in different languages, but also determines the order of "Plural-Form" indices in the PO file format?

My inquiry is based on the problems of different plural form formulas existing for the same language (in my case – the Latvian language). More specifically, formulas with different order of the plural forms.

If we use numbers "1", "2", "0" to denote the three existing plural forms in Latvian (the first one contains "1", the second one contains "2", the third one contains "0"), then the two different formulas being used are
"1" => 0, "2" => 1, "0" => 2
"1" => 1, "2" => 2, "0" => 0.

Poedit switched between the two formulas on 2018-05-11 (my isssue about that).

The previously used format matched the English better: singular = 0, plural = 1, third case (zero) = 2.
And it would be fine if the CLDR had the zero case put as the last one, but they didn't (for whatever reasons).
For Latvian, it is now zero = 0, singular = 1, plural =2.

Which differs from the English and differs from a lot of translation files already made with the old formula. Which is still correct, from the grammar point of view. But the automatic CLDR data importing tools introduced a different order that crated problems because various PO file editors and readers/users didn't expect different formulas (different forms index orders) for the same language.

CLDR 37 and

Hello,

Would it be possible to update to CLDR 37?

And GCC complains a warning: suggest parentheses around ‘&&’ within ‘||’
E.g.:

{
  "name": "Romanian",
  "formula": "(n == 1) ? 0 : ((n == 0 || n % 100 >= 2 && n % 100 <= 19) ? 1 : 2)",
}

Thanks a lot for this great module
Best wishes

CLDR 33

Please support CLDR 33
Thanks a lot!

"pl": "one", "few", "many", "other"

CLDR 30:

<pluralRule count="one">i = 1 and v = 0 @integer 1</pluralRule>
<pluralRule count="few">v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …</pluralRule>
<pluralRule count="many">v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …</pluralRule>
<pluralRule count="other">   @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …</pluralRule>

On this page "pl" has only "one", "few" and "other":
http://mlocati.github.io/cldr-to-gettext-plural-rules/

CLDR 42

Dear Michele,

Would it be possible to update this great package to CLDR-42?
Thank you so much for your efforts.

Best wishes from Vienna!

be, pl, uk - missing plural rule for "many"

Hi,

Thanks for nice package.
I see that generated plural rules and categories are ignoring "many" for be,pl,uk locales.

Here is example of CLDR 44:

      "pl": {
        "pluralRule-count-one": "i = 1 and v = 0 @integer 1",
        "pluralRule-count-few": "v = 0 and i % 10 = 2..4 and i % 100 != 12..14 @integer 2~4, 22~24, 32~34, 42~44, 52~54, 62, 102, 1002, …",
        "pluralRule-count-many": "v = 0 and i != 1 and i % 10 = 0..1 or v = 0 and i % 10 = 5..9 or v = 0 and i % 100 = 12..14 @integer 0, 5~19, 100, 1000, 10000, 100000, 1000000, …",
        "pluralRule-count-other": "   @decimal 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, …"
      },

output is just one, few, other which is not compatible.
Can you help me to fix it?

Thank you

Consider including the tests and readme in future release tarballs

Hello!

I am working on packaging this library for Fedora. Fedora packages often run test suites when possible, but I noticed that the release tarballs in this library do not seem to include the tests. Additionally, it would be nice to include the Readme file as documentation.

Thanks!

There is an incorrect plural form for French.

CLDR 40

Dear Michele,
Is there a chance to upgrade this great package to CLDR-40?
Italian, Portuguese, and Spanish got a many variant.
Thanks for all your efforts
Marcus

Move this repo to php-gettext

Hi!
I've created the php-gettext organization (https://github.com/php-gettext) and moved all packages related with gettext to there. The new version 5.0 also splits the whole repository in small packages (translator, scanner, etc), so developers can install only those features that really need.

Because this package is a dependency that uses the same vendor and namespace, I'm wonder if you're interested in move it to the organization, under the php-gettext/languages repository. You would still be the maintainer. What do you think?

CLDR 34

Please support CLDR 34
Thanks a lot!

gettext/gettext dependency

Hi. I've added this package as a gettext/gettext dependency, as you can see in this branch: https://github.com/oscarotero/Gettext/tree/gettext-languages

The main benefit of this is do not reinvent the wheel. If this package can provide all information about plurals, it makes no sense that gettext/gettext does the same.
The main drawback is that there is now a dependency, so it's more difficult to install it without composer I think i'ts an acceptable drawback, but the autoloader.php file only load the gettext/gettext classes but not the gettext/languages classes, I guess this package can provide its own autoloader.php to use this code in any non-composer project:

require_once __DIR__.'/gettext/src/autoloader.php';
require_once __DIR__.'/cldr-to-gettext-plural-rules/src/autoloader.php';

Other issue that I found is the namespace. The vendor in composer is "gettext/languages" but the namespace is GettextLanguages. I suggest to use the namespace Gettext\Languages.

😄

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.