Releases: SyberiaK/sl10n
Releases · SyberiaK/sl10n
0.3.0.0 - Cleaning and documenting
SL10n
can now detect unfilled localization strings.- Unfilled strings are either empty or equal to their key.
warnings.UnfilledLocaleKey
propogates when an unfilled key detected.
pimpl.ORJSONImpl
is now deprecated.- According to my benchmarks,
orjson
makes no significant load/dump speeds difference for our use case. A this point there's no reason to have a dedicatedParsingImpl
for it.
Usepimpl.JSONImpl
with one of the supported packages instead (e.g. built-injson
).
- According to my benchmarks,
Also I updated the docs look and added a new "Locale containers" page.
- Most notably,
ParsingImpl
methods have been documented.
0.2.0.0
- Introducing of Parsing Implementations
- Instead of passing modules directly into SL10n, now you can use parsing implementations:
This allows me to add compatibility with more modules in the future and also you to add custom parsing implementations.
from sl10n import SL10n, SLocale from sl10n.pimpl import JSONImpl import ujson # not a stdlib ... sl10n = Sl10n(MyLocale, parsing_impl=JSONImpl(ujson))
Just subclass thesl10n.pimpl.ParsingImpl
and implement yourload
anddump
methods. json
,simplejson
andujson
useJSONImpl
.python-rapidjson
now marked as supported and usesJSONImpl
.- Added support for
orjson
- useORJSONImpl
for it. - Simple demonstation of each usage:
from sl10n.pimpl import JSONImpl, ORJSONImpl JSONImpl(json) JSONImpl(simplejson) JSONImpl(ujson) JSONImpl(rapidjson) # `python-rapidjson` in pip ORJSONImpl() # for `orjson`
- Instead of passing modules directly into SL10n, now you can use parsing implementations:
- New modifier -
lang_code
- Changes
lang_code
property of respected locale container. - Doesn't change the access key in
SL10n.locale(key)
- be aware!
- Changes
json_impl
argument inSL10n.__init__
was renamed toparsing_impl
to better mirror new changesUnexpectedLocale
warning was renamed toUndefinedLocale