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

feat: translation linter needs to check numerus format #3445

Open
patricklodder opened this issue Feb 25, 2024 · 2 comments
Open

feat: translation linter needs to check numerus format #3445

patricklodder opened this issue Feb 25, 2024 · 2 comments

Comments

@patricklodder
Copy link
Member

patricklodder commented Feb 25, 2024

Originally posted by @patricklodder in #3439 (comment)

There's an issue that the linter doesn't catch with numerus: when we delete the numerus form in favor of a single form, the compilation breaks.

In the linter (contrib/devtools/check-translations.py) we should add a check that if there is a numerus="yes" attribute on the <message> element, that its child <translation> element ONLY contains <numerusform> elements, and no text node.

@slightlyskepticalpotat
Copy link
Contributor

Would it be done around here like below?

if translation_node.text is not None:
    print(f'Numerus message contains text {translation_node.text}, needs to be fixed.')
    have_errors = True

@patricklodder
Copy link
Member Author

Would it be done around here like below?

Yes. That is the right place. I'd check for:

  1. len(translations) > 0 and generate an error with something like "numerus message doesn't have any numerusform translations"
  2. the check you propose, to not have any superfluous text node.

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