Releases: rnxm/discord-localization
Releases · rnxm/discord-localization
v1.1.2
discord-localization v1.1.2
- fixed various bugs
localizations
now doesn't accept relative paths for cogs to avoid bugs. any discord.py cog has to use the main file's path as relative pathslocalizations
no longer has a setter: if you want to open a different file, usejson.loads
andLocalization.file
v1.1.1
discord-localization v1.1.1
- added support for yaml files
- renamed
relative_path
arg tolocalizations
localizations
now accepts dicts- added setter for
localizations
- this will open a new file and i don't recommend using it, but it's there if you need it
- added new operations
x == y
: checks if two Localization objects have the same.file
x != y
: checks if two Localization objects have different.file
'sdict(x)
: returnsself.file
- added a class representation for easier debugging
.format_string()
is now a staticmethod, meaning you don't need to actually initalize a class to use it
Full Changelog: v1.1.0...v1.1.1
v1.1.0
discord-localization v1.1.0
- improved docstrings - they're now numpy styled, similar to what discord.py uses
- added support for nested keys (
data["a"]["b"]
->"data.a.b"
)- added new section in the readme for an example of this
- added support for nested objects with proper kwarg formatting
- i don't think this needs an example, since this is done behind the scenes to make the use of the library more seamless
- corrected type hinting for the
locale
parameter in.one()
Full Changelog: v1.0.1...v1.1.0
v1.0.1
discord-localization v1.0.1
- added custom errors
InvalidJSONFormat
,LocalizationFileNotFound
,InvalidLocale
,LocalizationNotFound
,WrongLocalizationFormat
- these inherit from default error types, such as
ValueError
,FileNotFoundError
,KeyError
andTypeError
- functionality has not changed at all, this just makes every error a bit clearer.
Full Changelog: v1.0.0...v1.0.1
v1.0.0
discord-localization v1.0.0
This is the stable release of discord-localization
. This changelog will detail differences from ezi18n
, the older, deprecated version of this package.
- updated docstrings
lang
argument renamed tolocale
, which will be used to refer to it from now onlocale
argument now takesdiscord.Guild
,discord.Locale
,discord.Interaction
anddiscord.ext.commands.Context
, for easier discord integrationfilename
renamed torelative_path
- removed
suffix
, you now have to specifically define the path - added
default_locale
(Optional[str]
) - a fallback locale if a locale inlocalize
wasn't found - added
error
(Optional[bool] = False
) - whether to use thelogging
module to log errors or actually raise errors (usuallyKeyError
andTypeError
) - renamed
t()
/translate()
tolocalize()
, with 4 aliases:_
,t
,translate
,localise
- renamed internal variables
- improved errors
- added examples
- the dist folder is now in .gitignore
- updated readme