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

Not triggered format check for Farsi singular #9383

Closed
nikclayton opened this issue Jun 11, 2023 · 4 comments
Closed

Not triggered format check for Farsi singular #9383

nikclayton opened this issue Jun 11, 2023 · 4 comments
Assignees
Labels
bug Something is broken.
Milestone

Comments

@nikclayton
Copy link

Describe the problem

At the moment Weblate appears to send a PR with changes for multiple languages.

This can cause a problem if the PR is blocked because of an issue with one of the languages.

For example, tuskyapp/Tusky#3714 with changes for 6 languages is currently blocked (it may not be by the time you read this) because of a lint error with only one of the languages.

Describe the solution you'd like

1 PR per language.

Describe alternatives you've considered

No response

Screenshots

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Jun 12, 2023

Weblate maintains a single fork of the repository where it commits files. Having a fork and pull request per language is not really desired for most projects, as it would lead to an enormous flow of pull requests.

A better solution for your problem would be to not commit problematic translations:

  1. Have a Weblate check that would match the lint error you've seen. Maybe it is already there, if not, please create a separate issue describing it.
  2. Configure such check as enforced on your component, see https://docs.weblate.org/en/latest/admin/projects.html#enforced-checks.
  3. Do not let Weblate commit such strings, this is already covered by Do not commit changes for a translation that needs approval from a reviewer #3745.

@nikclayton
Copy link
Author

[Aside: I've just noticed that this issue is a duplicate of #5563, which I didn't find when I was originally searching for dupes, sorry about that]

Have a Weblate check that would match the lint error you've seen. Maybe it is already there, if not, please create a separate issue describing it.

I think part of the issue might be that the existing Weblate check and/or specification for the language is incorrect (I think, I'm not an expert in the given language).

The motivating example for this is as follows:

There was a translation of an Android plural string like this (language: Persian, android values-fa/strings.xml).

    <plurals name="favs">
        <item quantity="one">۱ برگزیدن</item>
        <item quantity="other"><b>%1$s</b> برگزیدن</item>
    </plurals>

In the Weblate UI this seems correct, because Weblate says use the plural form for n > 1, so the translator has (I assumed) hardcoded the "1" (۱) in the translation.

However, this does not pass Android linting, which reports (I added the line breaks):

/bitrise/src/app/src/main/res/values-fa/strings.xml:342: Error: The quantity 'one' matches more
  than one specific number in this locale (0, 1), but the message did not include a formatting
  argument (such as %d). This is usually an internationalization error.
  See full issue explanation for more. [ImpliedQuantity]
        <item quantity="one"><b>۱</b> برگزیدن</item>

So in this case the <item quantity="one"> entry can be used for both 0 and 1, so it needs a formatting argument (more details in this error in https://googlesamples.github.io/android-custom-lint-rules/checks/ImpliedQuantity.md.html).

So the PR that contained this change could not be merged, blocking not just the Persian translation, but multiple other translations as well.

This increased the severity of the problem / urgency of fixing it, because the blast radius of the issue is now much higher.

There are, I think, a number of different problems here:

  1. The Weblate info for the plural in this language is (possibly) wrong. That was reported back in 2019 in Same Plurals  #2680 and the issue is now marked stale, but it still seems to be a problem (there was Do not check Same plurals if langauge does not have plural forms #3383 which was supposed to fix this for some languages, but Persian still has the problem).
  2. The "fix" was to copy the plural translation to the singular translation. This brings up a scary "Same plurals" warning in the UI, and it's non-obvious that the translation can still be saved despite this warning (that's partly discussed in Failing checks notification and disabling is not intuitive #894)
  3. There doesn't seem to be a way, in the UI, to dismiss this warning for this particular string, and/or annotate the warning with an explanation as to why it is incorrect in this case. So a well-meaning translator can re-introduce this problem in the future.
  4. There is no feedback (as far as I can tell) between the change that a translator makes and the success / failure of the PR that caused this problem. So whoever is doing the Persian translation work does not know that they have (entirely inadvertently) caused this problem, so they don't know that there's anything that they need to fix.

@nijel
Copy link
Member

nijel commented Jun 12, 2023

  1. The plural info is correct – the plural form is for n > 1, and thus singular is for 0 and 1. It is also shown as an example in the tooltip at https://weblate.tusky.app/translate/tusky/tusky/fa/?checksum=e39ceddc79e262f7.
  2. It clearly says it has been saved since bc22ecc.
  3. The Dismiss button is always there (unless check is enforced). This particular check is already dismissed.
  4. That's true. There is no way to annotate Weblate strings from the CI right now.

Weblate is less strict in checking such singulars since
68cb5fe because it has proven to produce too many failures in situations where 0 is not actually used. That's definitely something we can address for Android as it seems to enforce strict checking here.

@nijel nijel changed the title Please send one PR per language Not triggered format check for Farsi singular Jun 12, 2023
@nijel nijel added the bug Something is broken. label Jun 12, 2023
@nijel nijel added this to the 4.18 milestone Jun 12, 2023
@nijel nijel self-assigned this Jun 12, 2023
@nijel nijel closed this as completed in 4d914d5 Jun 12, 2023
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken.
Projects
None yet
Development

No branches or pull requests

2 participants