Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting plural with inconsistent templates #110

Open
MrOrz opened this issue Nov 19, 2020 · 0 comments
Open

Supporting plural with inconsistent templates #110

MrOrz opened this issue Nov 19, 2020 · 0 comments

Comments

@MrOrz
Copy link
Contributor

MrOrz commented Nov 19, 2020

I extracted a wording to POT file like this:

msgid "Do you want to eat this apple?"
msgid_plural "Do you want to eat these ${count} apples?"
msgstr[0] "你要吃這 ${count} 個蘋果嗎?"

In this example, the msgid and msgid_plural has inconsistent template placeholders.
The translation can be built by babel-plugin-ttag successfully, but it fails ttag-cli validate check:

msgid "Do you want to eat this apple?"
msgid_plural "Do you want to eat these ${count} apples?"
msgstr "你要吃這 ${count} 個蘋果嗎? <--- redundant count;"

According to the current logic it's checking the consistency between msgid and msgstr[0] (instead of msgstr[i] 🤔 ) for msgstr.length times.

I am wondering

  • If the inconsistent template placeholder is a valid pattern that should be supported by ttag-cli validate
  • If the pattern is valid, how could we adapt the logic to support such pattern?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant