-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Fix translatable string issue in Albatross driver #17116
Conversation
@burmancomp would you help to test on a real device. |
Let's suppose it works. |
WalkthroughThe change involves modifying the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a changes entry.
Why do you want a change entry? What this PR is doing is:
We do not put a new item in the change log when one more message is being translated... |
Sorry, my bad. My thinking was that users of this driver may appreciate that they may now be able to see this message in their preferred language. It is very minor, so we're happy to leave this out of the changes file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @CyrilleB79, this is a nice quality of life fix
Link to issue number:
None
Summary of the issue:
In Albatross driver, a string consisting in the concatenation of normal strings (
"..."
) and an f-string) is passed to the_
translation function.As a consequence:
.pot
file instead of the full concatenationThus, this message was not translated.
Description of user facing changes
The message of the Albatross driver is now translated.
Description of development approach
Do not use f-string. Instead used
.format
function, applied to the translated string.Also checked that no other occurrence of translated f-string is found in NVDA: In Git bash:
find source -name '*.py' -type f -exec cat {} \; > /c/users/Cyrille/out.txt
out.txt
in my editor((?<!_)_|ngettext)\s*\(( *\r\n)?(\s*[#"'][^\n]+\n)*[\s\t]*f['"]
Note: This regexp has some limitations. It only looks for the use of
_
function as well asngettext
function; it does not checkpgettext
/npgettext
usage. Moreover, forngettext
, it only checks the singular form. Though, it should already help capture the majority of cases.Testing strategy:
.pot
file that we have the full messageKnown issues with pull request:
None
Code Review Checklist:
Cc @burmancomp
Summary by CodeRabbit