transifex / cli

The Transifex command-line client
Apache License 2.0
67 stars 25 forks source link

`zero` in stringsdict is not supported for English language #108

Closed andris-zalitis closed 1 year ago

andris-zalitis commented 2 years ago

When trying to upload a source English stringsdict resource with zero plural rule property, transifex client fails with: <...> - upload of resource '<...>' failed - parse_error: Invalid plural types for string: <...> Language supports: ['one', 'other'], but found: ['zero', 'one', 'other'] instead.

Note that even though for English zero does not provide different from other pluralization rule, it is still supported by Xcode for the purpose of differentiation for cases like this:

Rule Example
zero no trees
one one tree
other two trees

Now, since we are using Transifex for our project we are forced to use if else 😬 to implement different string resource for zero and non zero cases.

In Apple's documentation we can see that zero is listed as non language dependent rule (i.e. available in all languages).

Screenshot 2022-10-15 at 16 05 27

As a side note - if the rule is not used by language, it is simply ignored so it can't harm. The incorrect check done by transifex client does harm by blocking translation syncing and subsequently a workaround for it harms code quality.

kbairak commented 2 years ago

Hey @andris-zalitis,

Thank you for bringing this to our attention. This is not an issue with the client. The client is not capable of looking inside .stringsdict files, neither in any other file format. This error is raised by Transifex itself. You can verify this by uploading the same source file via the UI.

Unfortunately, this is a very hard issue to solve. The way the database internals interpret plurals, each language is configured with specific rules that are dictated by the Unicode CLDR Project.

Feel free to contact our support so that issue can be in consideration by our product team.

andris-zalitis commented 2 years ago

This is not an issue with the client. The client is not capable of looking inside .stringsdict files, neither in any other file format. This error is raised by Transifex itself. You can verify this by uploading the same source file via the UI.

👍

The way the database internals interpret plurals, each language is configured with specific rules that are dictated by the Unicode CLDR Project.

Yup, but .zero should be also included additionally to language specific pluralization rules.

Feel free to contact our support so that issue can be in consideration by our product team.

That does not sound promising 😟