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

Add validation for messageformat interpolation #11

Open
garethbowen opened this issue Aug 28, 2024 · 4 comments
Open

Add validation for messageformat interpolation #11

garethbowen opened this issue Aug 28, 2024 · 4 comments

Comments

@garethbowen
Copy link
Member

garethbowen commented Aug 28, 2024

If a translation value changes the variable name then the translation doesn't work. Add a validation check to ensure that the variable name in each translation file matches the reference (English) translation.

Steps to reproduce:

  1. Have an English file with line: test = {DAYS, plural, one{1 day left} other{\# days left}}
  2. Have a French file with line: test = {JOURS, plural, one{1 jour restant} other{\# jours restants}}

Expected: Validation failure
Actual: No warnings

If this is missed you end up with issues like: medic/cht-core#9384

@garethbowen
Copy link
Member Author

@1yuv Is this something you'd be willing to pick up?

@1yuv
Copy link
Member

1yuv commented Aug 28, 2024

Hi @garethbowen , If I read the document correctly, I think this is already supported

@garethbowen
Copy link
Member Author

@1yuv In that example, I think it checks the "uno" but not the "MONTHS". This would be an expansion of that. I'm confident it's not already working because if it was then the French issue you found would have been picked up in the linting stage.

@1yuv
Copy link
Member

1yuv commented Aug 28, 2024

I see that, I thought we were being lenient with use of this tool. I unfortunately don't have a bandwidth to take this immediately. I will pick this in October if it's not worked on.

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

2 participants