-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Internationalization - Proof of Concept #264
base: main
Are you sure you want to change the base?
Conversation
Running
in the PiFinder root directory extracts the marked strings successfully. |
The translation is now applied at point of display (for the text menu). |
|
Ruff and mypy as run by nox now run through with-out errors. Although, I have to admit, it's slightly ugly: While ruff can be configured to have Instead, when TYPE_CHECKING, I define a very laxly annotated |
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.
apart from the scripts seems fine, haven't tested it though!
@@ -51,6 +53,12 @@ | |||
from PiFinder.calc_utils import sf_utils | |||
from PiFinder.displays import DisplayBase, get_display | |||
|
|||
# Install the _("text") into global context for Internationalization | |||
# On RasPi/Ubuntu the default locale is C.utf8, see `locale -a`, which locales are available | |||
# You need to install `apt install language-pack_xx`, where xx is the ISO country code. |
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.
this implies changes to pifinder_setup and pifinder_update so everyone gets the languages. Also, each time a new language is added, these scripts need to be updated - unless we have some queryable single source of languages like a file used by the setup scripts and the app
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.
When updating, we can check the python/locale
folder for new subdirs and then install the respective packages/languages. Alternative could be to install „all“ languages once. I have to check which of these options is preferable.
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.
See #264 (comment) : At least on bullyeye, nothing like this is necessary.
The language menu is there, one can switch to french or spanish, even if the locale has not be generated! So no requirements (on bullseye) to generate locales! |
From my point of view, we could merge it. We still have to weed out non-translated items and mark them with |
Waiting for translations for French. |
menu_structure.py
for translation