-
Notifications
You must be signed in to change notification settings - Fork 183
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
Initial l10n / multilanguage support #620
Initial l10n / multilanguage support #620
Conversation
* Versions `Pillow` up to 9.1.0
…nshot generator screens * Improved `SeedReviewPassphraseScreen` display * Blue "Sign" icon replaces green paper airplane. * New `SeedPassphraseWarningView` before adding passphrase, plus `Settings` option to disable. * TextArea spacing bugfix * Additional note on SeedBackupScreen
* Filter out LANCZOS deprecation warnings from pytest output * Prevent ScreenshotRenderer from attempting to capture background task rendering jobs. * Bugfix to stop loading screen spinner if PSBTParser fails. *
* CS update * PT update * Screenshot generator bugfix
* New `ScreenshotConfig` utility class. * Proper reset & isolation when looping to generate screenshots for multiple locales. * Bugfix for unpredictable race condition when rendering screenshots. * Improved screenshots due to the above.
In 60b23f3, I'm noticing a remnant of orange pixels at the right edge from active buttons that had scrolling text as soon as you move off the button. Easy to see when browsing addresses but also visible in settings menus (wait for scrolling to begin, then move off that menu item). |
Confirmed. Seeing how my |
…d render wrong last state
I confirm that right-side artifacts left over from buttons that scroll is resolved. As well, that I can no longer provoke the scrolling-title lock-race issue that you fixed in the following commits -- up to fe2b579 -- all tested w/ seedsigner-os on a pi02w for now, also pi0 and raspi-os dev device. |
Up to date reviewing to commit 229151d Will be testing on pi0 and pi02w with the following seedsigner-os images:
|
I confirm that this is resolved, was able to test on raspi-os dev setup at commit a2ffa7d. I expect to respond here later today, Dec 21st 2024, with my final ACK on this pr. Todo: final testing at a2ffa7d.
I've completed my testing. With the known "long text" in spanish for "Main menu" and "clear all" in IOtest: ACK for candidate release at a2ffa7d |
ACK, reviewed and tested Congratulations @kdmukai on this PR. I can also confirm hash 6a35bad23c8e569dcc87706ecf36d2109a14581b297e65a6ba009f1d8cafa0e5 on the pi0 seedsigner-os build. @jdlcdl thank you for all your hard work on this PR as well. Not sure it would have happened without your contributions! |
Description
This is a MASSIVE refactor. Apologies to all!!
Review the new l10n/README.md to get the basics of how the translations are implemented. The biggest key is that we have to be a bit savvy about TWO distinct (yet often overlapping) translation-related tasks:
Note: Building the image also depends on: SeedSigner/seedsigner-os#79
Remaining tasks:
In parallel (but not necessarily required before merging this PR?):
New:
Submodule dependency on the new
seedsigner-translations
repo.ButtonOption
class to manageView.button_data
entries. Allows us to preserve the existing approach of using class-level attrs to indicate user options in aView
(e.g.MainMenuView.TOOLS
vsMainMenuView.SCAN
). It's wired up to mark the user-facing button labels as needing translation. But never translates those values based on locale (that happens later in theScreen
classes; we need these class-level attrs to remain untranslated). Bonus: cleans up some sloppy tuple-based code in those attrs and enables some nicer handling (see itsreturn_data
field).seedsigner.helpers.l10n.mark_for_translation
: you'll see this imported as_mft
and used for any class-level attr that isn't already covered by theButtonOption
above (e.g. a class-level display field liketitle
that has an English literal string). As far as the translation handling goes, it behaves the same asButtonOption
: mark it for translation, but do not provide the translated version.Screenshot generator made l10n aware, generates screenshots in each supported language.
pytest
: dynamically considers each locale as a separate test to report progress on.pytest.skip
for deactivated locales when the optional--locale
command line arg is present.TopNav
scrollable titles via updatedTextArea
component. Autoscrolls if the title is too long to display.ScrollableTextLine
added as a convenience class that's really just a scrolling single lineTextArea
.Simplified
python-babel
CLI commands viasetup.py
andsetup.cfg
.python-babel
does not havepyproject.toml
integration, unfortunately. Sosetup.py
is back in skeleton form to enable the CLI convenience; the simplicity ofpython setup.py extract_messages
is worth some extra project file cruft.setup.cfg
contains all the configuration for theextract_messages
andcompile_catalog
integrations we need.misc:
tests/run_full_coverage.sh
convenience script to generate local code coverage reports that combine the results from the test suite and the screenshot generator.coverage
file filtering inpyproject.toml
to account for the additional GUI /Screen
coverage provided by the screenshot generator.seedsigner-translations
repo as a submodule for the new l10n tests to pass).This pull request is categorized as a:
Checklist
pytest
and made sure all unit tests pass before sumbitting the PRIf you modified or added functionality/workflow, did you add new unit tests?
I have tested this PR on the following platforms/os: