Create multilingual interfaces for your tkinter applications
Project description
ci | |
---|---|
pypi | |
qa |
tkinter-msgcat
Create multilingual interfaces for your tkinter applications.
tkinter-msgcat leverages Tk's msgcat to provide a per-instance message catalog which holds all the translations, while allowing them to be kept in separate files away from code.
⏬ Installation
tkinter-msgcat requires Python 3.7+
pip install tkinter-msgcat
✨ Getting Started
-
For storing the translation files I recommend this folder hierarchy:
project (or src/project) ├── __init__.py └── msgs ├── __init__.py ├── hi.msg └── mr.msg
This layout is recommended by Tcl.
-
Add some translations in the
.msg
files, in this casehi.msg
:::msgcat::mcset hi "Hello" "नमस्ते"
-
Create a Tkinter window or instance, technically.
-
Let's put tkinter-msgcat into action!
from pathlib import Path from tkmsgcat import * msgsdir = Path(__file__).parent / "msgs" load(msgsdir) locale("hi") get("Hello") # "नमस्ते" 🥳
🤝 Contributing
All contributions are welcome and acknowledged. Please read the contributor's guide.
© License
The code in this project is released under the 3-Clause BSD License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tkinter_msgcat-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5616e4ba83a5c5751b7c68ca4cef77651ac85566955106b99d3f06e6f6f30fd9 |
|
MD5 | f3a7b5d5a3cf966d3bec45df874d097e |
|
BLAKE2b-256 | 34d6b20db654ce69aa1ec249691bdc35f6d09054357e35f4813fe4e80352431f |