-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use default flag name when flag is renamed to empty string #3826
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
Conversation
|
Python Style Guide suggestion: anki/qt/aqt/browser/sidebar/tree.py Line 456 in 89b0748
Change the if new_name == "" to if not new_name
|
|
Thank you for contributing! This could be done in a simpler way. Instead of storing a translation, simply delete the entry for that key from the dictionary, so that the default translation is used instead. This would change less code, and ensure the text remains correct when the user switches interface language. |
|
I already do delete the dictionary entry from the Lines 67 to 74 in 8380131
When I tested it, the flag label did switch to the correct translation after I changed the language, which indicates to me that it is using the default value and not a stored value in the config. The reason why I also store the translations in I hope I correctly understood what you meant! If not please clarify further. |
|
Sorry, I saw the other changes and assumed you were updating the key instead of deleting it. Looks nice and clean now - thanks again! |
commit 76c4ec7 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 18:29:41 2025 +0700 Add actions-processing based on qt-misc-processing commit a7c5376 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 18:21:28 2025 +0700 Update translations commit 00cc1b4 Author: GithubAnon0000 <[email protected]> Date: Fri Feb 21 10:14:15 2025 +0000 Increase font size for accessibility (ankitects#3832) Apparently no font size should be lower than 12px, see https://www.boia.org/blog/accessibility-tips-let-users-control-font-size. With the current 55%, I get a computed font size of 8.25px though. Considering the text shows the helpful message "Press Enter to accept, Shift+Enter for new line.", I think we should add a minimum font size. commit 8ec139f Author: llama <[email protected]> Date: Fri Feb 21 17:39:11 2025 +0800 Debounce mathjax rendering to avoid stalling (ankitects#3827) * move change-timer to editable * debounce mathjax rendering commit e373b0e Author: mumtazrifai <[email protected]> Date: Fri Feb 21 04:38:04 2025 -0500 Use default flag name when flag is renamed to empty string (ankitects#3826) * Add function to restore the default name of a flag * Call function to restore default flag name if flag renamed to empty string * Update _load_flags to use the default_flag_names dict * Add name to contributors file * Add trailing comma to pass tests * Update to follow python style guide * Update about.py * Revert "Update _load_flags to use the default_flag_names dict" This reverts commit caa8fea. * Use require_refresh() instead of storing default flag names commit 2727cf3 Author: Damien Elmes <[email protected]> Date: Fri Feb 21 10:33:57 2025 +0700 Update to Rust 1.85 Edition update to follow later
Fixes #3818
Right click on a flag in the browser sidebar > Rename > Delete all of the text > Hit Enter to confirm.
After doing this, Anki will go back to using the default name of the flag, including using the correct translation if the user switches languages.