
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
This is Python implementation of roddeh/i18njs (http://i18njs.com/). It's fully compatible with it's JSON dictionaries syntax.
pip install i18npy
pl.json
{
"values": {
"Hello World": "Witaj świecie",
"I have %n cookies": [
[null, null, "Nie ma rączek, nie ma ciasteczek"],
[0, 0, "Nie mam ciasteczek"],
[1, 1, "Mam jedno ciasteczko"],
[2, 4, "Mam %n ciasteczka"],
[5, null, "Mam %n ciasteczek"]
]
}
}
code
from i18npy import i18n, i18n_load
i18n_load("./pl.json")
i18n("Hello World")
# Witaj świecie
KEY = "I have %n cookies"
i18n(KEY, None)
# Nie ma rączek, nie ma ciasteczek
i18n(KEY, 0)
# Nie mam ciasteczek
i18n(KEY, 1)
# Mam jedno ciasteczko
i18n(KEY, 3)
# Mam 3 ciasteczka
i18n(KEY, 5)
# Mam 5 ciasteczek
import i18npy
lang_pl = i18npy.create({
"values": {
"Hello World": "Witaj świecie",
"I have %n cookies": [
[None, None, "Nie ma rączek, nie ma ciasteczek"],
[0, 0, "Nie mam ciasteczek"],
[1, 1, "Mam jedno ciasteczko"],
[2, 4, "Mam %n ciasteczka"],
[5, None, "Mam %n ciasteczek"]
]
}
})
lang_pl.translate("Hello World")
# Witaj świecie
lang_pl.translate("I have %n cookies", 3)
# Mam 3 ciasteczka
The original i18njs library ha been written by roddeh. The library code is based on his code, which is also licensed by MIT.
This project is licensed under MIT License - see the LICENSE file for details.
FAQs
Internationalization library. Python implementation of roddeh/i18njs
We found that i18npy 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.