Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A library and CLI for translating Python applications and libraries.
Our main design principle is "Simple things should be simple, complex things should be possible". We streamline the workflow that fits 95% of the projects and allow to configure every small detail to make it possible to fit the remaining 5%. Think about l10n as a high-level and friendly library comparing to low-level and less friendly locale, gettext, and babel.
Features:
*.po
and *.mo
files that are compatible with gettext toolchain and all other translation tools.Install l10n:
python3 -m pip install 'l10n[cli]'
And there are all the changes you need to do in your code to support translations for a string:
from l10n import Locales
locales = Locales()
def say_hello(lang='en'):
loc = locales[lang]
msg = loc.get('Hello, world!')
print(msg)
Now, let's translate it to Ukrainian:
Extract all strings from the code that need to be translated:
python3 -m l10n extract --lang uk
Translate all extracted strings using Google Translate:
python3 -m l10n translate
Compile all translations into the binary format:
python3 -m l10n compile
That's all! Now, your code supports translations:
from example import say_hello
say_hello(lang='uk')
# Привіт Світ!
If you want to manually adjust the translation text, just edit the languages/en.po
file and run compile
again. You don't even need to restart your app!
Read more in the documentation: l10n.orsinium.dev.
FAQs
A library and CLI for translating Python applications and libraries.
We found that l10n demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.