Closed CyrilleB79 closed 1 year ago
@michaelDCurran and @seanbudd: If possible for you, I would see the following planning regarding ngettext introduction in NVDA:
ngettext
usage, e.g. 2 or 3 occurrences on strings frequently usedngettext
)ngettext
.
NVDA 2023.3 would thus be the first version with full usage of ngettext
.Note: I may also separate simple cases of ngettext
usage and more complex ones (e.g. strings containing two numbers) as explained in https://github.com/nvaccess/nvda/issues/12445.
@seanbudd, @michaelDCurran: Now that add-on store work has been merged and before beta phase, would you provide a feedback on this planning? Thanks.
We'll talk about this internally early next week and get back with a decision on if we want to proceed this way. Thanks for your ideas and work on this.
The plan looks good to us, feel free to go ahead with it
Thanks @seanbudd. In this case, the first step is on your side: review and merge the current PR.
Links to issues:
Preliminary to https://github.com/nvaccess/nvda/issues/12445
Context
A first use of ngettext had been introduced in NVDA in https://github.com/nvaccess/nvda/pull/11598 and https://github.com/nvaccess/nvda/pull/12432. However these changes were removed in https://github.com/nvaccess/nvda/pull/12448.
Issue
As written by @michaelDCurran in https://github.com/nvaccess/nvda/pull/12448:
Changes in this PR
This PR adds the support of ngettext messages in the PO validation script.
Tests
Test 1
Run new
scripts/poChecker.py
on various files:The files containing the plural string have been taken from SVN SRT repo when a first attempt to introduce ngettext in NVDA was made.
Test 2
Comparison of the output of the modified script with the output of the original one. The comparison has been made on the
nvda.po
files of all languages available in SVN repo screenreadertranslations (commit 74391) as well as with all thenvda.po
files available in the last master version of NVDA's Git repo (commit 96764959510a19d390f4493b78510df3a353cd50). The comparison has been made thanks to a test script made for this task.Some diffs have been found in the order in which the placeholders are listed in the report, e.g.:
The placeholders are stored in a Python set in
scripts/poChecker.py
, thus their order is not significant. I do not know however why the order has changed from one version ofscripts/poChecker.py
to another. Thus I have amended my test script to reorder alphabetically the placeholders in the output ofscripts/poChecker.py
so that we can ignore the order of placeholders on a same line. After this reordering post-processing, there was no diff between the outputs of the old and the new version of the script.For reference here is the (quick and dirty) test script that I have used (updated and re-tested on June 9 2023): launch_poChecker.py.txt