Fix-up of #12432: Fix key error when reading appointment with categories#12435
Conversation
|
I can't reproduce this, @CyrilleB79 can you paste the log message?. It looks like I must have misunderstood how to trigger the initial category reporting. I can report categories on an email, but not on a calendar event. |
|
Here is the log: Note that reporting categories on message was already supported in NVDA 2020.4. The new feature added in #11598 with the use of |
|
The code here is fine, and it is obviously a bug. But given that I didn't manually test this effectively, it would be great to have proper steps on one of these PRs or issues. Currently none do. I still can't get reproduce the error. I'm using Office 365.
|
feerrenrut
left a comment
There was a problem hiding this comment.
I'm going to go ahead with this merge, we can update the description once we understand what we are doing differently.
|
@feerrenrut here are the requested clarifications. Here is the STR that lead to the error that I have pasted above:
If you do not have an appointment with a category, you can add one the following way:
Note that with the STR you indicate, I can see 2 differences:
I hope that this clarifies things. Let me know if something is still unclear. |
|
Yes, that helps. I had to tab to the appointment, then reading categories works as expected. |
|
I have added this to the PR description. |
|
@CyrilleB79 This usage will be removed for now, we believe it is causing trouble for the po file checker in the translation system. We can revisit this after the release of 2021.1 |
|
I am sorry, but this string will now sound very unnatural in polish and other slavic languages. Maybe i am going to receive complaints.
|
|
I understand, this is not ideal. This matches the behavior of the of many similar plural strings in NVDA. We will look at re-introducing this for the next release. |
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`
Link to issue number:
Fix-up of #12432
Summary of the issue:
In Outlook Calendar, KeyError in the log when tabbing on an appointment having an associated category.
In #12432,
.formatwas used without key word argument, whereas the string to be formatted contained a named interpolated value.Details
To reproduce / test:
Note: using up/down arrows will read the appointment, but does not focus it and will not read the category.
Tested in Outlook 2016 and 365
If you do not have an appointment with a category, you can add one the following way:
Description of how this pull request fixes the issue:
Call
.formatwith the keyword.Testing strategy:
Tested in Outlook that appointments with no category, one category or wo categories are correctly reported.
Known issues with pull request:
None
Change log entries:
None; fixing a not released PR.
Code Review Checklist:
Cc @feerrenrut @seanbudd