Add-on store: pluralize one string#19059
Conversation
|
@SaschaCowley: @zstanecic, are there languages where both variables can affect singular/plural/other forms? |
|
@CyrilleB79 are you sure that you know what are you doing? The number should agree with the noun. I would rather rephrase this message, so that it sounds: x of y malware scanners flagged the addon [addonname] as malicious. |
|
@CyrilleB79 - there is something incredibly wrong with the diff here |
|
@seanbudd: @zstanecic wrote:
The sentence was first written by @seanbudd. I have checked with ChatGPT; according to it, in English, the number " If you disagree with this, in English or in another language, please let me know, explaining clearly.
I am more than open to a better wording. But why did you add "[addonname]" here? It is useless.
We can then concatenate the two sentences. What do you think? |
|
Yes, we need to split this. In some languages, nouns not only agree with gender and case, but with the numbers. |
|
@CyrilleB79 - is this ready for re-review? |
|
@zstanecic what about the following string: This wording would allow to pluralize this string according to If it is not suitable for other languages, would you think to a wording that would allow this double pluralization. Let me know. Thanks! |
|
Okay. when thinking more about⠀ this, only second number, if mo⠀re tha⠀n 10⠀, will need declension, so it is fairly safe to proceed. |
|
@zstanecic, it's not very clear to me: to which proposal are you replying to? Is the following OK for you? |
|
Hi @CyrilleB79 |
This reverts commit 357a761.
Fixes issue found while working on #19059 Summary of the issue: In #19059, commit 9595711, an error is raised during check Pot: scons: *** [tests\checkPot] IndexError : list index out of range Traceback (most recent call last): File "D:\a\nvda\nvda\.venv\Lib\site-packages\SCons\Action.py", line 1434, in execute result = self.execfunction(target=target, source=rsources, env=env) File "D:\a\nvda\nvda\tests\sconscript", line 21, in checkPotAction return checkPot.checkPot(source[0].abspath) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "D:\a\nvda\nvda\tests\checkPot.py", line 142, in checkPot msgid += getStringFromLine(line) ~~~~~~~~~~~~~~~~~^^^^^^ File "D:\a\nvda\nvda\tests\checkPot.py", line 201, in getStringFromLine quoted = line.split(" ", 1)[1] ~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range Error: Process completed with exit code 1. The test should pass or fail but no error should be raised. The error occurs if a msgid command containing a multi-line string is followed by a msgid_plural command. This had probably never happened before the string introduced in #19059. Description of user facing changes: The Python script to check Pot does not raise an error before completing. Description of developer facing changes: N/A Description of development approach: Take into account the presence of msgid_plural token. Taken into account that a multi-line string in the msgid command can end: either with a msgstr command or a msgid_plural command
Link to issue number:
Fix-up of #18974
Summary of the issue:
One newly translatable string needs to support plural forms:
"{malicious} out of {total} malware scanners detected this add-on as potentially malicious."In English, there is no difference, since "detected" uses the same form at singular or plural; but in other languages, not. There are also languages where scanners pluralization needs to change.
Description of user facing changes:
The information will have correct pluralization form.
After discussion, I have tried to find a wording where only one of the two numbers needs an agreement to avoid splitting and re-building the sentence.
Description of developer facing changes:
N/A
Description of development approach:
Use
npgettextinstead ofpgettext.Testing strategy:
Checked the add-on store's details panel. Found add-ons with 0, 1, 4 and 10 scanners that detected add-on as malicious; so I have been able to check pluralization working in English.
Known issues with pull request:
None
Code Review Checklist: