You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
👌 IMPROVE: Add i18n support & general improvements (#66)
* Add i18n support and translations for togglebutton
Introduces internationalization for Sphinx-ToggleButton by adding translation infrastructure, updating config values to use translated strings, and including translation files (.json, .po, .mo) for multiple languages. Updates MANIFEST.in to package translation assets and adjusts .gitignore to allow .mo files. Also adds a conversion script for generating locale files from JSON.
* Include translation files in package data
Added translation-related files and directories to the package_data section in setup.py to ensure they are included in the distribution. This supports proper packaging and deployment of translation resources.
* Sync toggle button hints with external state changes
Adds functions to synchronize toggle button hints and aria-expanded attributes with the current state. Introduces a MutationObserver to update button hints when toggle item classes change, ensuring external extensions or DOM changes are reflected in the UI.
* Preserve existing IDs for admonition toggle items
Update togglebutton.js to use an admonition's existing ID if present, instead of always generating a new one. This prevents overwriting custom or pre-existing IDs on admonition elements.
* Refactor sphinx_togglebutton/__init__.py for readability
Improved code formatting and structure for better readability and maintainability. Added blank lines for separation, split long function calls, and enhanced consistency in function definitions and configuration setup.
* Refactor formatting in setup.py and _convert.py
Improves code readability by reformatting lists and dictionary values in setup.py and breaking up a long path assignment in _convert.py. No functional changes were made.
* Reorder imports for consistency and PEP8 compliance
Imports in setup.py, __init__.py, and _convert.py were reordered to follow PEP8 guidelines and improve readability. No functional changes were made.
* Refactor formatting and remove unused import
Reformatted code for better readability in docs/conf.py and sphinx_togglebutton/__init__.py by expanding lists and function calls over multiple lines. Removed unused 'os' import from setup.py.
* Add i18n support and document toggle button languages
Updated CHANGELOG, README, and docs to document new internationalization support for toggle button texts. Added a list of supported languages and instructions for configuring language in Sphinx. Also mentioned new functions for dynamic hint updates and a fix for using existing admonition IDs.
* Specify Sphinx configuration path in readthedocs.yml
Added the 'sphinx.configuration' key to explicitly set the path to the Sphinx config file as 'docs/conf.py' for Read the Docs builds.
* Update changelog with details on toggle hint functions
Expanded the changelog entry for syncToggleHint and syncAllToggleHints to clarify that these functions allow automatic updating of button hint text when the open or closed state changes.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,16 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
### Added
6
+
7
+
- Support for more languages in toggle button text (see README for full list) [#66](https://github.com/executablebooks/sphinx-togglebutton/pull/66).
8
+
- Added new functions (syncToggleHint, syncAllToggleHints) to dynamically update toggle button hints based on the current state [#66](https://github.com/executablebooks/sphinx-togglebutton/pull/66). This allows developers to change the open or closed state of an element and have the button hint text update accordingly automatically.
9
+
10
+
### Fixed
11
+
12
+
- Update togglebutton.js to use an admonition's existing ID if present, instead of always generating a new one [#66](https://github.com/executablebooks/sphinx-togglebutton/pull/66).
0 commit comments