In my Rails project, I have translation keys with plural forms in the source language of English such as:
en:
errors:
messages:
not_saved:
one: '1 error prohibited this %{resource} from being saved:'
other: "%{count} errors prohibited this %{resource} from being saved:"
I have this string translated into Chinese (Simplified) zh_CN. Upon tx pull, my translation file contains:
After examining the issue shown in the images, I don’t believe the tx/config file is necessary to identify the core problem, but having it is useful for us CSEs to recreate issues accurately and better understand and resolve them.
The issue appears to be with the YAML structure and nesting of the translation files rather than the Transifex configuration.
The main problem visible in the screenshots is that Rails expects a YAML structure that is different from what’s being provided. Specifically:
The issue stems from the additional nesting of the other key, which appears to be coming from the plural form handling in the English source file. This is a structural YAML issue rather than a Transifex configuration problem.
Which of your tools should be used to get feedback about wrong syntax for plural form? I mean Transifex API, your GitHub Action or what is able to help here? Do you support this kind of error or warning?
Thank you for reaching out to Transifex Support. My name is Carlos, and I’ll be assisting you with your inquiry.
Unfortunately, at this time, Transifex does not support validating errors or warnings related to plural forms directly within the platform. I completely understand how important this functionality is, and I regret any inconvenience this may cause.
To validate pluralized strings, you would need to perform this step outside of Transifex before pushing the content. If the pluralized string does not align with the expected structure, Transifex will format it as a regular string.
I’m here to help and ensure you have all the support you need. Please don’t hesitate to share any additional questions or concerns, and I’ll do my best to assist further.
At the moment there is no confirmation on Transifex side that let you know how many pluralized strings were detected. What you can do is to filter in the Editor using pluralized:yes filter, this will show you all the pluralized strings inside an specific resource.