Skip to content

Commit 599c46b

Browse files
committed
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.
1 parent 3df379c commit 599c46b

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

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).
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).
13+
314
## v0.3.2 - 2022-07-15
415

516
([full changelog](https://github.com/executablebooks/sphinx-togglebutton/compare/v0.3.1...347b1ad3a093afad0f0d4c0041249f09f39afab2))

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,10 @@ here's a container with an image inside:
6969
7070
.. image:: https://media.giphy.com/media/mW05nwEyXLP0Y/giphy.gif
7171
```
72+
73+
Internationalization (i18n)
74+
============
75+
76+
The texts `Click to hide` and `Click to show` used in the toggle buttons are internationalized by using the set language from Sphinx's configuration.
77+
78+
Supported languages are English (default), Chinese (Simplified), Chinese (Traditional), Hindi, Spanish, French, Arabic, Bengali, Russian, Portuguese, Indonesian, Japanese, German, Korean, Turkish, Vietnamese, Tamil, Italian, Thai, Dutch, Greek, Polish, Ukrainian, Persian, Malay, Swahili, Romanian, Czech, Hungarian, Hebrew, Swedish, and Norwegian.

docs/use.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,16 @@ Here is my toggle-able content!
129129
## Change the button hint text
130130

131131
You can control the "hint" text that is displayed next to togglebuttons.
132-
To do so, use the following configuration variable in your `conf.py` file:
132+
133+
To use the default values for your language, set the language in your Sphinx configuration:
134+
135+
```python
136+
language = "nl" # or "de", "es", etc.
137+
```
138+
139+
Supported languages are English (default), Chinese (Simplified), Chinese (Traditional), Hindi, Spanish, French, Arabic, Bengali, Russian, Portuguese, Indonesian, Japanese, German, Korean, Turkish, Vietnamese, Tamil, Italian, Thai, Dutch, Greek, Polish, Ukrainian, Persian, Malay, Swahili, Romanian, Czech, Hungarian, Hebrew, Swedish, and Norwegian.
140+
141+
If you prefer to have custom hint texts instead of the defaults for your language, use the following configuration variable in your `conf.py` file:
133142

134143
```python
135144
togglebutton_hint = "Displayed when the toggle is closed."

0 commit comments

Comments
 (0)