Flexibility of outlook categories translation#12432
Merged
Merged
Conversation
Allow translators to adjust order and spacing for categories in outlook
Contributor
|
@feerrenrut, this PR seems to have been tested on a code version that differs from the one that has just been merged. |
feerrenrut
pushed a commit
that referenced
this pull request
May 20, 2021
In Outlook Calendar, KeyError in the log when tabbing on an appointment having an associated category. In #12432, .format was used without key word argument, whereas the string to be formatted contained a named interpolated value.
7 tasks
seanbudd
pushed a commit
to nvaccess/mrconfig
that referenced
this pull request
Jun 13, 2023
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.
6 tasks
seanbudd
pushed a commit
that referenced
this pull request
Jun 19, 2023
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow translators to adjust order and spacing for categories in outlook
Link to issue number:
fixes #12417
Summary of the issue:
We use ngettext in one location, essentially a trial for now.
Currently this does not allow translators to change spacing, or to change word order.
Two strings are essentially joined together without consideration of the language grammar.
Description of how this pull request fixes the issue:
Give the translators more flexibility by allowing them to place the translation text.
Testing strategy:
Build and run locally.
Ensured that annoucing categories in outlook works as expected.
Known issues with pull request:
Due to the format of the categories list provided by outlook, it may not be possible to create completely natural sentances in all languages.
Change log entries:
None
Code Review Checklist: