Plural-Forms conflict

When uploading a partially translated PO file from other sources into Transifex, I faced an issue related to the difference of the Plural-Forms used in Transifex for Brazilian Portuguese.

The error message:

Invalid plural types for string: local assignment to syntactic function: :local assignments to syntactic functions: . Language supports: [‘one’, ‘many’, ‘other’], but found: [‘one’, ‘many’] instead.

Other translation open source software out there define pt_BR Plural-Forms as "Plural-Forms: nplurals=2; plural=n > 1;\n", while Transifex define as "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n". Ultimately, Transifex’s plural form causes an additional msgstr[2] "" entry in the PO file.

How can I work around this issue, considering I have many plural strings in the POT/PO files.

Hello @rffontenelle,

I am Antonis from the Transifex Customer Success team. I hope you’re well!

Transifex follows Unicode CLDR data for our plural rules so that we can ensure compatibility with the as many of our projects as possible.

As such, one, many and other are all required for our parser to consider the string valid for Portuguese otherwise you will be greeted by the error you encountered. Similarly when translating the string all forms need to be translated for you to be able to save the translation. There aren’t any workaround for this unfortunately.

I hope this explanation helps, but please let me know if you have any additional questions or feedback.

Kind regards,

Antonis Mylonas | Customer Success Engineer

Transifex | Blog | We are hiring | Join Our Community