-
Notifications
You must be signed in to change notification settings - Fork 424
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
Can't get translations to work. #171
Comments
What value do you get if you run the |
If I remove: MessageCatalog.locale('pt_br') I still get "My locale: pt_br". Nothing changes. |
What locale is returned from the MessageCatalog.locale() method with no parameters. I'm wondering what native locale is recognized by tkinter. |
Take the following test. extract the contents of the zip file folder
to the python modules folder. In my case python 3.8
See if the translation has been applied It appears to be some versioning conflict in the installation via pip See my test:
and I installed it via pip: To fix I downloaded the zip file and put the contents of the folder:
in the directory:
see the result of your code, here applied the translation: code: import ttkbootstrap as ttk
from ttkbootstrap.dialogs import Querybox, Messagebox
from ttkbootstrap.icons import Icon
from ttkbootstrap.localization import MessageCatalog
from ttkbootstrap import localization
localization.initialize_localities()
MessageCatalog.locale('pt_br')
Messagebox.yesnocancel("Messagebox.yesnocancel")
print("My locale:", MessageCatalog.locale()) |
I wonder if it's using the cached version of ttkbootstrap on the local machine? |
See the files downloaded and installed via pip (ttkbootstrap-1.5.1). There is no localization/msgs folder, so the translation was not applied. I haven't checked the other files, but it looks like the version installed via pip is not the latest from the repository, |
I tested it here via Successfully installed ttkbootstrap-1.5.1.1 It worked as expected - new version with translated text and colorchooser widget via: |
pip3 install git+https://github.com/israel-dryer/ttkbootstrap Translation is working (pt_br.msg is present) on python 3.8.10 as shown bellow I couldn't get it to work on python 3.9.0, but the reason is another bug: |
Hi,
I've got the latest ttkbootstrap from github today:
pip3 install git+https://github.com/israel-dryer/ttkbootstrap
then I cloned the repository:
git clone https://github.com/israel-dryer/ttkbootstrap
All examples work, but the translations. I tried the tests, and I could not get tableview or any dialog to be translated. I am using ubuntu linux:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
Is there any specific command I need to choose the language? How do I know if ttkbootstrap is loading the correct the translation file? In my case it should be 'pt_br'.
EDIT: tried on python3.8.4
Thanks for your time.
The text was updated successfully, but these errors were encountered: