-
-
Notifications
You must be signed in to change notification settings - Fork 679
Plural forms should be reported with correct grammar #12445
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
Comments
Since the only use of
Distinguishing the two last steps in two separate PRs may allow to revert only the last PR if issues are encountered when splitting complex strings. Since all occurrence of |
These errors occurred in the translation system. In response to a translator making a commit to the ScreenReaderTranslations repository (hosted on assembla), the We noticed messages such as the following going to many translators:
Note that the original is about start time, the translated was about categories. Similar error messages (all referencing categories) were being seen for many commits by different translators. |
Preliminary to nvaccess/nvda#12445 Context A first use of ngettext had been introduced in NVDA in nvaccess/nvda#11598 and nvaccess/nvda#12432. However these changes were removed in nvaccess/nvda#12448. Issue As written by @michaelDCurran in nvaccess/nvda#12448: However, it seems that our PO validation code in the translation system is not handling plural forms well, and is incorrectly classing translations as missing brace format variables, as it is incorrectly comparing the translation with the message before that one. It then outputs the following error: Message starting on line 7169 Original: "{startTime} to {endTime}" Translated: "category {categories}" Error: missing brace format interpolation, extra brace format interpolation Expected: these brace format interpolations: {endTime}, {startTime} Got: these brace format interpolations: {categories} Changes in this PR This PR adds the support of ngettext messages in the PO validation script.
This PR is the first step to reintroduce the distinction of singulare/plural forms when formatting UI strings. The project is as follow: 1. This PR introduce three strings to be able to test the feature. 2. 2023.2 beta phase should be used to validate more widely the feature with translators 3. A second PR during 2023.3 dev cycle will implement the plural forms for all UI strings containing only one value to format them. 4. A third PR should implement more complex cases of string formatted by two or more values, e.g. such as "table with x rows and y columns". This step-by-step approach should allow to lose less work in case an issue occurs and requires to revert changes. ### Link to issue number: First step to implement #12445. Restoring #11598, #12432 and #12435 that were reverted in #12448. Unblocked by nvaccess/mrconfig#97. ### Summary of the issue: Some UI messages or strings are reported with plural form, no matter the number passed as parameter to format them, e.g. NVDA reports "list with 1 items" with "s" even if there is only one item. ### Description of user facing changes The following strings will be reported using singular or plural form depending on the number used to format them: * "with %s items" (used to describe the number of items in a list on the web) * ".1f lines" (used when reporting multiple line spacing formatting in MS Word) * ""categories {categories}" used to report categories of appointments in MS Outlook Translators will be able to translate singular or plural forms. ### Description of development approach * First revert #12448 to restore the first attempt that was made to introduce `ngettext`. * Develop a custom `npgettext` function the same way as `pgettext` was introduced in NVDA since `npgettext` is not available in Python 3.7; `pgettext` and `npgettext` are available natively in Python 3.8. * `ngettext` and `npgettext` are made accessible without importing them; `pgettext` was already added previously in builtins. * Implement the plural form for two strings that are more commonly used than Outlook appointments category reporting: * "with %s items", using `ngettext` * "%.1f lines", using `npgettext`
Closes #12445 Follow-up of #15013. Summary of the issue: When possible NVDA needs to distinguish between singular and plural in UI messages. The impact may be more significant in languages such as Slavic ones, where there are more than one plural form. Description of user facing changes In NVDA UI messages, i.e. in GUI or when NVDA speaks or brailles messages, messages will use singular/plural form as needed. Description of development approach Look for all strings containing "%" or "{" in the .pot and check if a plural form is needed. And replace _ / pgettext by ngettext / npgettext where needed. Some expression containing a number have been pluralized even if they do not differ between singular and plural form in English due to the difference being visible in translations due to a different grammar. E.g.: "{numFingers} finger {action}" in English to be translated to "{action} {numFingers} doigt" (singular) vs "{action} {numFingers} doigts" (plural) in French. table-rowcount and table-columncount control fields of the virtual buffer's text info have had to be converted to integer (previously strings), so that computation can be done. No change log needed except for the code's API breaking change. Testing strategy: Manual smoke test on a subset of strings. Feedback from translators during translation period and communication with the translators mailing list
I open this issue since:
ngettext
is now supported by NVDA (I do not know exactly since when)ngettext
has been introduced in Report appointment categories in Microsoft Outlook #11598 and Flexibility of outlook categories translation #12432Steps to reproduce:
Actual behavior:
"List with 1 items" is reported.
Expected behavior:
"List with 1 item" is reported (no 's' to 'item')
System configuration
NVDA installed/portable/running from source:
source
NVDA version:
last alpha
Windows version:
10
Name and version of other software in use when reproducing the issue:
Other information about your system:
Other questions
Does the issue still occur after restarting your computer?
yes
Have you tried any other versions of NVDA? If so, please report their behaviors.
Same issue in 2020.4
If add-ons are disabled, is your problem still occurring?
yes
Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
N/A
Implementation strategy
In initial description of #12432, @feerrenrut wrote:
Since the use of categories for Outlook calendar items impact few people, I would recommend:
A rapid estimation let me think that about 38 messages are concerned with plural forms.
@feerrenrut would you accept the first PR against beta to make a wider test?
The text was updated successfully, but these errors were encountered: