Discord-localization

Latest version: v1.1.4

Safety actively analyzes 706267 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.4

**Full Changelog**: https://github.com/rnxm/discord-localization/compare/v1.1.3...v1.1.4

Changes
- added new argument to `localization`: `placeholders`
- if `True`, will stop raising KeyErrors and instead will return the original argument in curly braces (using a custom string template)
- if `False`, uses `str.format` and will raise KeyErrors
- defaults to True
- keyword-only

huge thanks [aescarias](https://github.com/aescarias) from the Python discord server

1.1.3

**Full Changelog**: https://github.com/rnxm/discord-localization/compare/v1.1.2...v1.1.3

Changes
- added a new keyword during initialization: `separator`
- this allows you to change the default dot separator for nested dicts (if `separator` is `-`, you can use `dict1-value1` instead of `dict1.value1`
- made all keywords after `localizations` keyword-only

1.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 paths
* `localizations` no longer has a setter: if you want to open a different file, use `json.loads` and `Localization.file`

1.1.1

* added support for yaml files
* renamed `relative_path` arg to `localizations`
* `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`'s
* `dict(x)`: returns `self.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**: https://github.com/PearooXD/discord-localization/compare/v1.1.0...v1.1.1

1.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**: https://github.com/PearooXD/discord-localization/compare/v1.0.1...v1.1.0

1.0.1

* added custom errors
- `InvalidJSONFormat`, `LocalizationFileNotFound`, `InvalidLocale`, `LocalizationNotFound`, `WrongLocalizationFormat`
- these inherit from default error types, such as `ValueError`, `FileNotFoundError`, `KeyError` and `TypeError`
- functionality has not changed at all, this just makes every error a bit clearer.

**Full Changelog**: https://github.com/PearooXD/discord-localization/compare/v1.0.0...v1.0.1

Page 1 of 2

Links

Releases

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.