From c73f34563a153caedddd13667225313e6090df36 Mon Sep 17 00:00:00 2001 From: Dennis den Ouden-van der Horst Date: Wed, 30 Jul 2025 15:47:04 +0200 Subject: [PATCH 1/4] 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. --- .gitignore | 2 +- MANIFEST.in | 8 +++ sphinx_togglebutton/__init__.py | 14 ++++- sphinx_togglebutton/translations/README.md | 3 + sphinx_togglebutton/translations/_convert.py | 58 ++++++++++++++++++ .../translations/jsons/Hide.json | 34 ++++++++++ .../translations/jsons/Show.json | 34 ++++++++++ .../locales/ar/LC_MESSAGES/togglebutton.mo | Bin 0 -> 380 bytes .../locales/ar/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/bn/LC_MESSAGES/togglebutton.mo | Bin 0 -> 432 bytes .../locales/bn/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/cs/LC_MESSAGES/togglebutton.mo | Bin 0 -> 383 bytes .../locales/cs/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/de/LC_MESSAGES/togglebutton.mo | Bin 0 -> 380 bytes .../locales/de/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/el/LC_MESSAGES/togglebutton.mo | Bin 0 -> 424 bytes .../locales/el/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/es/LC_MESSAGES/togglebutton.mo | Bin 0 -> 380 bytes .../locales/es/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/fa/LC_MESSAGES/togglebutton.mo | Bin 0 -> 419 bytes .../locales/fa/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/fr/LC_MESSAGES/togglebutton.mo | Bin 0 -> 379 bytes .../locales/fr/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/he/LC_MESSAGES/togglebutton.mo | Bin 0 -> 374 bytes .../locales/he/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/hi/LC_MESSAGES/togglebutton.mo | Bin 0 -> 466 bytes .../locales/hi/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/hu/LC_MESSAGES/togglebutton.mo | Bin 0 -> 394 bytes .../locales/hu/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/id/LC_MESSAGES/togglebutton.mo | Bin 0 -> 385 bytes .../locales/id/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/it/LC_MESSAGES/togglebutton.mo | Bin 0 -> 378 bytes .../locales/it/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ja/LC_MESSAGES/togglebutton.mo | Bin 0 -> 389 bytes .../locales/ja/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ko/LC_MESSAGES/togglebutton.mo | Bin 0 -> 379 bytes .../locales/ko/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ms/LC_MESSAGES/togglebutton.mo | Bin 0 -> 385 bytes .../locales/ms/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/nl/LC_MESSAGES/togglebutton.mo | Bin 0 -> 374 bytes .../locales/nl/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/no/LC_MESSAGES/togglebutton.mo | Bin 0 -> 374 bytes .../locales/no/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/pl/LC_MESSAGES/togglebutton.mo | Bin 0 -> 378 bytes .../locales/pl/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/pt/LC_MESSAGES/togglebutton.mo | Bin 0 -> 376 bytes .../locales/pt/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ro/LC_MESSAGES/togglebutton.mo | Bin 0 -> 395 bytes .../locales/ro/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ru/LC_MESSAGES/togglebutton.mo | Bin 0 -> 420 bytes .../locales/ru/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/sv/LC_MESSAGES/togglebutton.mo | Bin 0 -> 380 bytes .../locales/sv/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/sw/LC_MESSAGES/togglebutton.mo | Bin 0 -> 370 bytes .../locales/sw/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/ta/LC_MESSAGES/togglebutton.mo | Bin 0 -> 465 bytes .../locales/ta/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/th/LC_MESSAGES/togglebutton.mo | Bin 0 -> 416 bytes .../locales/th/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/tr/LC_MESSAGES/togglebutton.mo | Bin 0 -> 390 bytes .../locales/tr/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/uk/LC_MESSAGES/togglebutton.mo | Bin 0 -> 426 bytes .../locales/uk/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/vi/LC_MESSAGES/togglebutton.mo | Bin 0 -> 380 bytes .../locales/vi/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/zh-cn/LC_MESSAGES/togglebutton.mo | Bin 0 -> 365 bytes .../locales/zh-cn/LC_MESSAGES/togglebutton.po | 15 +++++ .../locales/zh-tw/LC_MESSAGES/togglebutton.mo | Bin 0 -> 365 bytes .../locales/zh-tw/LC_MESSAGES/togglebutton.po | 15 +++++ 69 files changed, 615 insertions(+), 3 deletions(-) create mode 100644 sphinx_togglebutton/translations/README.md create mode 100644 sphinx_togglebutton/translations/_convert.py create mode 100644 sphinx_togglebutton/translations/jsons/Hide.json create mode 100644 sphinx_togglebutton/translations/jsons/Show.json create mode 100644 sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/fa/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/fa/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/fr/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/fr/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/hu/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/hu/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/id/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/id/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ms/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ms/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/nl/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/nl/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/no/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/no/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/sv/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/sv/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/sw/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/sw/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/ta/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/ta/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/vi/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/vi/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/zh-cn/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/zh-cn/LC_MESSAGES/togglebutton.po create mode 100644 sphinx_togglebutton/translations/locales/zh-tw/LC_MESSAGES/togglebutton.mo create mode 100644 sphinx_togglebutton/translations/locales/zh-tw/LC_MESSAGES/togglebutton.po diff --git a/.gitignore b/.gitignore index b6e4761..ac90f23 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,7 @@ coverage.xml .pytest_cache/ # Translations -*.mo +# *.mo *.pot # Django stuff: diff --git a/MANIFEST.in b/MANIFEST.in index 443bb8b..f1df7ba 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,9 @@ graft doc/ + +recursive-include sphinx_togglebutton *.js +recursive-include sphinx_togglebutton *.css + +recursive-include sphinx_togglebutton *.json +recursive-include sphinx_togglebutton *.mo +recursive-include sphinx_togglebutton *.po +recursive-include sphinx_togglebutton *.py \ No newline at end of file diff --git a/sphinx_togglebutton/__init__.py b/sphinx_togglebutton/__init__.py index 0792641..c96c957 100644 --- a/sphinx_togglebutton/__init__.py +++ b/sphinx_togglebutton/__init__.py @@ -3,6 +3,10 @@ from docutils.parsers.rst import Directive, directives from docutils import nodes +from sphinx.locale import get_translation +MESSAGE_CATALOG_NAME = "togglebutton" +translate = get_translation(MESSAGE_CATALOG_NAME) + __version__ = "0.3.2" @@ -50,6 +54,12 @@ def run(self): # We connect this function to the step after the builder is initialized def setup(app): + # add translations + package_dir = os.path.abspath(os.path.dirname(__file__)) + locale_dir = os.path.join(package_dir, "translations", "locales") + app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) + + # Add our static path app.connect("builder-inited", st_static_path) @@ -59,8 +69,8 @@ def setup(app): # Add the string we'll use to select items in the JS # Tell Sphinx about this configuration variable app.add_config_value("togglebutton_selector", ".toggle, .admonition.dropdown", "html") - app.add_config_value("togglebutton_hint", "Click to show", "html") - app.add_config_value("togglebutton_hint_hide", "Click to hide", "html") + app.add_config_value("togglebutton_hint", f"{translate('Click to show')}", "html") + app.add_config_value("togglebutton_hint_hide", f"{translate('Click to hide')}", "html") app.add_config_value("togglebutton_open_on_print", True, "html") # Run the function after the builder is initialized diff --git a/sphinx_togglebutton/translations/README.md b/sphinx_togglebutton/translations/README.md new file mode 100644 index 0000000..8dff863 --- /dev/null +++ b/sphinx_togglebutton/translations/README.md @@ -0,0 +1,3 @@ +JSONs created using GitHub Copilot Pro. + +To convert to locale files run `_convert.py` in this folder. diff --git a/sphinx_togglebutton/translations/_convert.py b/sphinx_togglebutton/translations/_convert.py new file mode 100644 index 0000000..45829b4 --- /dev/null +++ b/sphinx_togglebutton/translations/_convert.py @@ -0,0 +1,58 @@ +import json +import os +from pathlib import Path +import subprocess + +MESSAGE_CATALOG_NAME = "togglebutton" + +def convert_json(folder=None): + folder = folder or Path(__file__).parent + + # remove exising + for path in (folder / "locales").glob(f"**/{MESSAGE_CATALOG_NAME}.po"): + path.unlink() + + # compile po + for path in (folder / "jsons").glob("*.json"): + data = json.loads(path.read_text("utf8")) + assert data[0]["symbol"] == "en" + english = data[0]["text"] + for item in data[1:]: + language = item["symbol"] + out_path = folder / "locales" / language / "LC_MESSAGES" / f"{MESSAGE_CATALOG_NAME}.po" + if not out_path.parent.exists(): + out_path.parent.mkdir(parents=True) + if not out_path.exists(): + header = f""" +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\\n" +"MIME-Version: 1.0\\n" +"Content-Type: text/plain; charset=UTF-8\\n" +"Content-Transfer-Encoding: 8bit\\n" +"Language: {language}\\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\\n" +""" + out_path.write_text(header) + + with out_path.open("a", encoding="utf8") as f: + f.write("\n") + f.write(f'msgid "{english}"\n') + text = item["text"].replace('"', '\\"') + f.write(f'msgstr "{text}"\n') + + # compile mo + for path in (folder / "locales").glob(f"**/{MESSAGE_CATALOG_NAME}.po"): + print(path) + subprocess.check_call( + [ + "msgfmt", + os.path.abspath(path), + "-o", + os.path.abspath(path.parent / f"{MESSAGE_CATALOG_NAME}.mo"), + ] + ) + + +if __name__ == "__main__": + convert_json() diff --git a/sphinx_togglebutton/translations/jsons/Hide.json b/sphinx_togglebutton/translations/jsons/Hide.json new file mode 100644 index 0000000..1e8ceaf --- /dev/null +++ b/sphinx_togglebutton/translations/jsons/Hide.json @@ -0,0 +1,34 @@ +[ + {"language":"English","symbol":"en","text":"Click to hide"}, + {"language":"Chinese (Simplified)","symbol":"zh-cn","text":"点击隐藏"}, + {"language":"Chinese (Traditional)","symbol":"zh-tw","text":"點擊隱藏"}, + {"language":"Hindi","symbol":"hi","text":"छुपाने के लिए क्लिक करें"}, + {"language":"Spanish","symbol":"es","text":"Haz clic para ocultar"}, + {"language":"French","symbol":"fr","text":"Cliquez pour masquer"}, + {"language":"Arabic","symbol":"ar","text":"انقر للإخفاء"}, + {"language":"Bengali","symbol":"bn","text":"লুকাতে ক্লিক করুন"}, + {"language":"Russian","symbol":"ru","text":"Нажмите, чтобы скрыть"}, + {"language":"Portuguese","symbol":"pt","text":"Clique para ocultar"}, + {"language":"Indonesian","symbol":"id","text":"Klik untuk menyembunyikan"}, + {"language":"Japanese","symbol":"ja","text":"クリックして非表示"}, + {"language":"German","symbol":"de","text":"Klicken zum Ausblenden"}, + {"language":"Korean","symbol":"ko","text":"숨기려면 클릭"}, + {"language":"Turkish","symbol":"tr","text":"Gizlemek için tıklayın"}, + {"language":"Vietnamese","symbol":"vi","text":"Nhấp để ẩn"}, + {"language":"Tamil","symbol":"ta","text":"மறைக்க கிளிக் செய்யவும்"}, + {"language":"Italian","symbol":"it","text":"Clicca per nascondere"}, + {"language":"Thai","symbol":"th","text":"คลิกเพื่อซ่อน"}, + {"language":"Dutch","symbol":"nl","text":"Klik om te verbergen"}, + {"language":"Greek","symbol":"el","text":"Κάντε κλικ για απόκρυψη"}, + {"language":"Polish","symbol":"pl","text":"Kliknij, aby ukryć"}, + {"language":"Ukrainian","symbol":"uk","text":"Натисніть, щоб приховати"}, + {"language":"Persian","symbol":"fa","text":"برای مخفی کردن کلیک کنید"}, + {"language":"Malay","symbol":"ms","text":"Klik untuk menyembunyikan"}, + {"language":"Swahili","symbol":"sw","text":"Bonyeza kuficha"}, + {"language":"Romanian","symbol":"ro","text":"Faceți clic pentru a ascunde"}, + {"language":"Czech","symbol":"cs","text":"Klikněte pro skrytí"}, + {"language":"Hungarian","symbol":"hu","text":"Kattintson az elrejtéshez"}, + {"language":"Hebrew","symbol":"he","text":"לחץ להסתרה"}, + {"language":"Swedish","symbol":"sv","text":"Klicka för att dölja"}, + {"language":"Norwegian","symbol":"no","text":"Klikk for å skjule"} +] diff --git a/sphinx_togglebutton/translations/jsons/Show.json b/sphinx_togglebutton/translations/jsons/Show.json new file mode 100644 index 0000000..c10fb4d --- /dev/null +++ b/sphinx_togglebutton/translations/jsons/Show.json @@ -0,0 +1,34 @@ +[ + {"language":"English","symbol":"en","text":"Click to show"}, + {"language":"Chinese (Simplified)","symbol":"zh-cn","text":"点击显示"}, + {"language":"Chinese (Traditional)","symbol":"zh-tw","text":"點擊顯示"}, + {"language":"Hindi","symbol":"hi","text":"दिखाने के लिए क्लिक करें"}, + {"language":"Spanish","symbol":"es","text":"Haz clic para mostrar"}, + {"language":"French","symbol":"fr","text":"Cliquez pour afficher"}, + {"language":"Arabic","symbol":"ar","text":"انقر للعرض"}, + {"language":"Bengali","symbol":"bn","text":"দেখাতে ক্লিক করুন"}, + {"language":"Russian","symbol":"ru","text":"Нажмите, чтобы показать"}, + {"language":"Portuguese","symbol":"pt","text":"Clique para mostrar"}, + {"language":"Indonesian","symbol":"id","text":"Klik untuk menampilkan"}, + {"language":"Japanese","symbol":"ja","text":"クリックして表示"}, + {"language":"German","symbol":"de","text":"Klicken zum Anzeigen"}, + {"language":"Korean","symbol":"ko","text":"표시하려면 클릭"}, + {"language":"Turkish","symbol":"tr","text":"Göstermek için tıklayın"}, + {"language":"Vietnamese","symbol":"vi","text":"Nhấp để hiển thị"}, + {"language":"Tamil","symbol":"ta","text":"காட்ட கிளிக் செய்யவும்"}, + {"language":"Italian","symbol":"it","text":"Clicca per mostrare"}, + {"language":"Thai","symbol":"th","text":"คลิกเพื่อแสดง"}, + {"language":"Dutch","symbol":"nl","text":"Klik om te tonen"}, + {"language":"Greek","symbol":"el","text":"Κάντε κλικ για εμφάνιση"}, + {"language":"Polish","symbol":"pl","text":"Kliknij, aby pokazać"}, + {"language":"Ukrainian","symbol":"uk","text":"Натисніть, щоб показати"}, + {"language":"Persian","symbol":"fa","text":"برای نمایش کلیک کنید"}, + {"language":"Malay","symbol":"ms","text":"Klik untuk menunjukkan"}, + {"language":"Swahili","symbol":"sw","text":"Bonyeza kuonyesha"}, + {"language":"Romanian","symbol":"ro","text":"Faceți clic pentru a afișa"}, + {"language":"Czech","symbol":"cs","text":"Klikněte pro zobrazení"}, + {"language":"Hungarian","symbol":"hu","text":"Kattintson a megjelenítéshez"}, + {"language":"Hebrew","symbol":"he","text":"לחץ להצגה"}, + {"language":"Swedish","symbol":"sv","text":"Klicka för att visa"}, + {"language":"Norwegian","symbol":"no","text":"Klikk for å vise"} +] diff --git a/sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..63f81e0dd3e9bb1727c290f86cafc82544b82893 GIT binary patch literal 380 zcmZ9E&q~8U5XRR(r-&Clc=52_^ss8hLrKWR(n6tyfYJM!tjTJe4Vw+7M@!Ks@ButX zZ$dAEKFQ|dvp7*{r62R-n;E{DudVfGf?7j%kyB&?86b@+WD^bt59f`Z2o{x{wN7dY-2eDi*3F$;4S{ zi~?uaA9fds*5R?!QD6iZ7LIb^QX?vJlxJLmN28SMLKy!d?6LMDr#TeYLbEPJDwdGA zw0$LwGvJVvJi#AaJ3&@zp0S?NcZEwK{}~Ja#G}8hzYlcJr>z6eA$D3n)?+)P^`xHI SSNm2!*r|P4+JD%YeJ9_sL2MWR literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..15fc833 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ar/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ar\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "انقر للإخفاء" + +msgid "Click to show" +msgstr "انقر للعرض" diff --git a/sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..2a6fe24c9f72136a46a40878695e7c1cd503fd49 GIT binary patch literal 432 zcma)!y-ve06otdj6vV>JU^W;`DPpJ+Wua=NO05)$z@8>1F@)>LaYeep)Tv{60^~3v zMh18j{+B}$N#$IM!#A{F(y(Iq*pP$h9q_-%Ryr^up*5qn}MR bBXy|e^@IMzxykyqX}w@yW5?*HfA+rt`!|pA literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..e7d2af6 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/bn/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: bn\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "লুকাতে ক্লিক করুন" + +msgid "Click to show" +msgstr "দেখাতে ক্লিক করুন" diff --git a/sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..57c72bccb692102273a3c234edd687a1e895b1d2 GIT binary patch literal 383 zcmZ9EO-jQ+6vxMpRm6=TxNz~@>0;E1i;|FyrG;V(0i*kAGEK(BH(_RiNiWb7xbh5M zz^$Icv-qOYO8>kc|M&fMu=~PDJH#<@P3#d9qEkcc6YZZb$=`|Y=#YrE7&{`LlT)nJ z{oB;`|HhzHNdZnnu2RWXmCf}ti;RAhiR0sxKS*PhMj!5~Tw%jwon@uGsh!j4O~=#W zdZTxK=?yeGiH^r@C4F$RaTir76b6vw!dU6T`*_6r>pdgT&ZXf)OmwO+^PxXe&YK9# zYLU^8#ClO#8&UF+Hc!?EtbR%xUIp-*hNlQ8A@t4ykKLB4z|U7Fp)wk5VOsa`w$WYa KnGp+#H24PPlw$J$ literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..85e701e --- /dev/null +++ b/sphinx_togglebutton/translations/locales/cs/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: cs\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Klikněte pro skrytí" + +msgid "Click to show" +msgstr "Klikněte pro zobrazení" diff --git a/sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..68bff258a7d0855d3c330ffd140684021e92de5b GIT binary patch literal 380 zcmZ9HO-{ow5QWXpDu@k2tXP;GEDRK}s1juXRV!7rQX~R9n|T_K+D= z-6$c-Oyi^xBkSfq=2(A?KD|o#cblFfKS_D-EQ#1%_bouaZ07u?@iPNh0{)G030hJ3 E345kq!~g&Q literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..ae676dc --- /dev/null +++ b/sphinx_togglebutton/translations/locales/de/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Klicken zum Ausblenden" + +msgid "Click to show" +msgstr "Klicken zum Anzeigen" diff --git a/sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..60021177f38140313af6a401edbfb03d98f95274 GIT binary patch literal 424 zcmaKk%}T>S6ouo@D&oeqi*cvOs1+9_B^yf%g%%1{_c0lh(Kr((6HLK{;_t$(8=t{V zks^)y3U}VXXYs~LD=s|Tk2Cjj=6o*AKU%0cWEt5(7LYblDn}NP{*T|G7fAVO9qG=D z{Tv-_$up~~6Jh3s*ui4E8)wRkX;Z4x)FC4IUQ>6wM#fKfRge{zRMu*?1yAq{ALbf{ o1PXYA5flVo&;|qs=E6KcVJ^*$xrf((vqN|{w`CQK%oS$80B8w{s{jB1 literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..f6273f6 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/el/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: el\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Κάντε κλικ για απόκρυψη" + +msgid "Click to show" +msgstr "Κάντε κλικ για εμφάνιση" diff --git a/sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..bf37e5f5cce6002574f1aebce3cd8df364da01d5 GIT binary patch literal 380 zcmZ9H&q~8U5XR%5Q^bql&BJ)p!>SbzB_S6}i-i^fR`2U(o2+hU!|nuAU%)5m%lI%p zixVrY^kaT}Gas`9`+ah_idYBC8FR-RF%za!%N#SyKmTO^V!B7COuo1FIXl-z-MwAy z{|^S%s5c-7l__+znL_2>quje!tw@Xu@vMC?4ik8+D}$|=xw5qSz9DiLPsh{YcB6N7 z6Av7cMiR4StrH;K(sga6!4y;_ebAIW%|@cX-SZN|TzfG@(u$Gui;w`;zhlU5Q&_jz1;Tj-y~{L?9^?lo{uhghaDhChKX6@M AYybcN literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..b16c536 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/es/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Haz clic para ocultar" + +msgid "Click to show" +msgstr "Haz clic para mostrar" diff --git a/sphinx_togglebutton/translations/locales/fa/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/fa/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..ec6f79e804f0ce28861c03f12233b14b92523ae6 GIT binary patch literal 419 zcmZvUKTE?v7{=qDDdOVna1Mfkr&b(FLKaI4g%%1%_cOUBr|~Y_T`(OS1dU5pKZAC$ z2u^;IqyayRZ&cbMKHQJzd5`CPKQ~sN4A2U&2^<4!Ko6*u0_(u&*B`+@fO=^U7%Uma zHux<#yqW5If3>{$(TbRNg|t8+^QkeLR48tYffSe2)41#7b1D@R+(M^u$asof5d;xE zNwgN+?05U^d84s^Xto5`lxyscVrn5xQ+*IegmD{rA(4t|=gjTk=Da5fS3@dsn|s1% zJg`vnf@!lyc#x0)ZVZVzh!RO6+!69xS%}BqqjHXH^b?&Oj{j%#7*PG5gH&$5-s{O#kSRNwI&CO|+eT^XL}se0#+%lAL*aZnA8#fG z=a=EgkVo<&TQ(Sh$If3gwbT?tuB3J7le=sphMPGn$(3lum~vBSsv;OZXdlibRjsUe zM`^>fZmq1v#Mp(4fSRx9lB*cLugNLFNdkkjIP5?2+~O-VrnRt;j)VPM%CgkC;`S3L C_g>%t literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/fr/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/fr/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..5704221 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/fr/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Cliquez pour masquer" + +msgid "Click to show" +msgstr "Cliquez pour afficher" diff --git a/sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..560f453eff403f4e1578cf668fc09ffc983845f1 GIT binary patch literal 374 zcmZ9EzfQw25XQ})DTo1B8O#QQfg*+~Q5LFJs??u_2rz+Y#v#uvbMaEDRvT zBk&^Lcor^zTHw?D^xb{ByN}J)dxBa)wvl6G4H+S=8e|=r{P-REJJKF)A;}UU8|XPY z)?Dqs|62YX^h%XoQ>Up^xghh&N_|Tbqpw8f*f3}3!dRstq^Ffs(6Ce&MJY~d=QIT4 z;kdup=0Ch(((Z+F z!H7dq^8$ZJ5hP`8c*zFZ+}Myp^)=e~D5BqOybE+Erk%YgApX%m_-BeX^H2WGzxvsq J?8Q$p`2--8XT1Ob literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..59ac8b1 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/he/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: he\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "לחץ להסתרה" + +msgid "Click to show" +msgstr "לחץ להצגה" diff --git a/sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..86a735ccfca649043f502b8e56646701f889deb4 GIT binary patch literal 466 zcmbV^ze~h09L4L8sp8`75H}s7o;VyW1@X9pgF7f#-D4ZuXiZ9*VsF&tCJ~2oam|T1 ziKB!5Cz3zKZ(F$&M<4m{^1{peT3eo2pe0}(*audC0Z^#~R)NuvkHO!8>eB(>FEoA+ z4riun@2?hrKXg(SULYkEBv_R~U=6!(O@%pJtDI_BP{bBU8 knU0aslg8eR{xtfodAK#Y$&)(kSLhgh0|QTW?cu)z-?cQQ$N&HU literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..020601e --- /dev/null +++ b/sphinx_togglebutton/translations/locales/hi/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: hi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "छुपाने के लिए क्लिक करें" + +msgid "Click to show" +msgstr "दिखाने के लिए क्लिक करें" diff --git a/sphinx_togglebutton/translations/locales/hu/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/hu/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..e9ddd5a349625b25a52417fa2ee3fd3913a41306 GIT binary patch literal 394 zcmZ9EOHKko5QfLcYK$9~#+Y)ai&il%$dK7cAR$6RBD!yfa;BlFo^;nl-~yh&L%8q) zZn=kNvG4)vpZfCG`+aZwITCFN2g0SWBXotOroyf;`}QaCH(`0SFZ4H}=umttF0s<` z-+yiXZZxgQ#=s5=GsI|Bg~B~XeeXt?vFZ%f9r|D#C2&&~hNf!Z^4#K8#q22Vb$YG! zM(y-GZaQKlR)blI2{2CithCxt1F}NDvkd7)1HRJqnBXXd+DRjht~IkE4vs+20jJ3c zXYoX(mHwQM|J=V$4nG*_fH)`ai6de`4C;tuqW|-E@=szoIwO)j#!kuC%GBXIbTk<8>8#n zU}Dfq^gQhw8G@IcziG5k7(rGF>!gpL(-|Lc_pCtoDlMO4W^#o^2;-IV!9rlsih_Qq zJVNT# EH+b4%VE_OC literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/id/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/id/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..e7b67d6 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/id/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: id\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Klik untuk menyembunyikan" + +msgid "Click to show" +msgstr "Klik untuk menampilkan" diff --git a/sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..8217e7d92912eccba2ebab875f3c705c6dbf4c4a GIT binary patch literal 378 zcmZ9H&q~8U5XR%5Q^bqn&BJ)p!&WOENk}(uY=FOmgw2tuurXyws(^R%BEZm40r#Ck$tk*=XO< z?>&S=La)(_Y+36Fyl(w{T}gv6s8U*|ee#-(#bDoOCAzt`VuXrvgGB^`cjLpU#G;V} z@8FPDjg^%clU=w7uwF-(JjSs3CbtMT3H0ycaD9l9P-_b)og&P&-JG|rF35Q+x%LOU CQeFfA literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..a03667f --- /dev/null +++ b/sphinx_togglebutton/translations/locales/it/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Clicca per nascondere" + +msgid "Click to show" +msgstr "Clicca per mostrare" diff --git a/sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..30a2b039697e40f1596132ec5297f9af99e2476b GIT binary patch literal 389 zcmca7#4?ou2$+Fb28d07m>Ytb=B1Y=rUT8$O5_U2 zDJ@FO(RIr&$}P51$SVMIi*1dp6(CGojXVWKTLnW+Yc7VzP3s>wuX^0v3}Q4+f84n2 S<=lBM7Or@{WEU1Ws00AA2y#RK literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..35810f9 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ja/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "クリックして非表示" + +msgid "Click to show" +msgstr "クリックして表示" diff --git a/sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..b6a68bd3d0ffcbff8e15bbd0177d069a80c6522f GIT binary patch literal 379 zcmca7#4?ou2$+Fb28d07m>Ytb=B1Y=rUT8$&gTlq zDJ@FO(RIr&$}P51$SVMIi*1dp6(CGojXVWKTLnW+Yc7U29V=e#*zkJ6lGiJ@D73vcIpgNVE|15Ylr{< literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..e75629e --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ko/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ko\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "숨기려면 클릭" + +msgid "Click to show" +msgstr "표시하려면 클릭" diff --git a/sphinx_togglebutton/translations/locales/ms/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ms/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..b2b458a22ac5c0006cf651be85b836f7faaecbd2 GIT binary patch literal 385 zcmZ9E%SyvQ6o%tv6>;N25L_I0x)`ZK}oMNNl->&xm zHzrDEH8>5W%tf%NY^mRZ)aXiNj?HuSB8-(9BY0{{i5*+%qEO<&JEt*R&X?2e#_0Ms zoM?0c9b5ISh`@=?-L#5Jj3FzzvBD+Ks~H<__Y6n-Dh!)qrgMo!1mm@I;eun~c|kuK z8>Y$|uGmbQ#zuhcPid387=F{_65%3&(N!DBM%}*u z+TRTZMi&bnEU$D4Y*YElzO&5PS15uQm*N?m*A`UQe(o4N;(fAeac6ozwL7p{R=oT#KM*uRm}Ty9ioXu)ksA< z&_tPOoHSx&-O^J~|CTbKE0WznOPq0zA@4caZFqjd&Gq3)Dru|;>TafKZx$=h)A{=J0Q==sn+WL z{nz&IV4zi2fj3a9T(b4#O7p@JYvwZZe4O(KX`M0{!d+b|YL`8Ru3PO=qD Cj$JYU literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/no/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/no/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..a097237 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/no/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: no\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Klikk for å skjule" + +msgid "Click to show" +msgstr "Klikk for å vise" diff --git a/sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..38483ba8def8c2de20759a941082e71a0cf3b40c GIT binary patch literal 378 zcmZ9EO-{ow5QWXpDu@k;9SgGq2?IqeszljPwNgbZMIx|w6XUosW6O3#!UcK)F2kC0 za26&AwZPMSdYU&sp9i~d1hs=4BR9w%GDCW`$Uf5j_zL|U>5mSPY>SX1^b#Fwt^VJC zZT}8NS`{@7hE}Q+WZn77ypYV9r6>ZMmh4eDuMEWW-c|})mK!OxxNSl(5Y4Ca@n&Oi zaTSdW1Ob8NofR<+q79c;a|H=4D(<`p=|etY!_A)K;GcwJV<=3iK*n^qP$8OekPVmk z!|Ev0jpLe4jC=Mm1^eCl^g6*|KS@u4o}_eemPF)Es~Xhuobp9So7#0BtG}5wHGk!p FegVQoUbO%K literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..a7e1104 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/pl/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Kliknij, aby ukryć" + +msgid "Click to show" +msgstr "Kliknij, aby pokazać" diff --git a/sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..35f2cfcdbe78ecaaaa65897ca0ccc1cc275e7b47 GIT binary patch literal 376 zcmZ9HO-{ow5QW3fDu@kiSqwW^7${;0vkv z6N*~kX+FJ~r}0SsJlg+=SbNL~bHf}kGp1L^95Txve`jAY{i9+bVh1Sp=_iNin9A+B8J;NFEKnRFUDBfN@JbC@KIAdlUTR1<{OUU x+_YXAF|mFT5mq*%tyCU3>rl literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..05cfc6c --- /dev/null +++ b/sphinx_togglebutton/translations/locales/pt/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Clique para ocultar" + +msgid "Click to show" +msgstr "Clique para mostrar" diff --git a/sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..99c916fddae65d34765ad12760e85ee6290051b1 GIT binary patch literal 395 zcmZ{f%SyvQ6o%tv6>;NQ;keVqs1+9_Asb5rg%$!v_v2(b8I5PcTrhnCpTLFqCO$!* z!e{ZsN-Kgt^YPD_b79Ws!R~8B+93{!D`JnB61_TNpIH3(3;74pHyshh)~XN5>8#by z`>XBW52HqlNALz}UCC%2x!OEOg*6XScs8lnowQCHOyH)iHFm5tN;UF2cyBPCO=jaw z#o+8B9vSo!Ju4TjOu);|pSKOyn1ZOeb<$_IWzL41I?K_`rDbCjrqZYq7~X3iPdTc< z70s|FE}CF@!*XMvTmsmBhc3HJVRg+;5RNk#oThP-NNfI+ Ko$KWrkG=qW`elUx literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..e126413 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ro/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ro\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Faceți clic pentru a ascunde" + +msgid "Click to show" +msgstr "Faceți clic pentru a afișa" diff --git a/sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..3272a99789f4b55a1767bff65ed4c5ff9074b468 GIT binary patch literal 420 zcmaKky-ve06otdj6vV>JU?xCdpopPLm4&L6Dz#E10=r2}VhDERI3nFjmkwoRYu zk0J!GV7~y*!c9RfV&KT1&b`*T=W}iO-U2NF>%bAP0(5~&1+WVAe|!X90@cwb;4N6z z4tN0$Z>Fm6uNHrQG!qtFAtg}ELTb&nEEYGGC&eWV6z+uhjLM7&?x2%2X1u_@h@ylZ z=Sm4~_d31SJW<;_u$zJ_$`$teDRq#dh1yRO!gvD(F_9Tn?y29#^?6Pbo?TFhTRadU z?f%OL9pP+!pdWa}ZCbYvvv{(D&$WakSy0+IGXX^n;%0XZ@yM l%}_t>A~OPi*NLk%-2Io+A8=4Y&5NE)vtJf)hX?=w literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..59f376f --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ru/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ru\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Нажмите, чтобы скрыть" + +msgid "Click to show" +msgstr "Нажмите, чтобы показать" diff --git a/sphinx_togglebutton/translations/locales/sv/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/sv/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..fc536aa62b559eb7ea502a2f52a3b8616005d700 GIT binary patch literal 380 zcmZXP&rZWI493HsQxO-0IB_sHI0P8tFtzH1X_F>4sS<;GXtOjUI8~C4?g@ATUS$Wa zdk>xk7tn^_lYjbb%eLf?gWWeq+98gKYhsTW5v>|xpIH3(EBQOoE*%ls7GsCxikxDt z_TFD@|8De*&YvJyD0Ly(y7HxcVVSctnFl^B_=9v_Ta4kZDm6BIVwE!TrVhbkG#-xo zn~Bc(Wz@46BnCcNR5FGjn{ZJXp)rBH6wb?#-cJU+yP0zW{Zu;M$J`bgRSexn9iovy zRSQKo{5;A`?S$b2>z;iKSbdc~y-MIaO-~U{Qs|r|5xZ^Q5-?pY9f%O1SS`&={ACqDQoUz9Ii4x<{u(a=_Rb`3pInt-5{x zb+}&`l{#C3H&EzYvTbsOS+T^LH<@`p&H1ymP8$s2u_`n+JT*#{a#(wBFqlv0I7{||->BPm^A#OTEtvHlBPSDaqp@o9gJ>JE;=$Rb36x-3Ix^xk`xbzz& zh`2cDH<5f4pPbT)n}70q-tvE*&yCfo2U-C(fkR*o=m1VbU>z9!$^$Vu_4&mv5r0xdsd-*_;9JhqLDFeidsx6~~5Pg@?Hb+|#s_lfnXSKHa*_sEd tr`Aj$B3J1Tt6!?oEXL|rYwp~tnZO0Gzgs=4{$~GO{{jrlsWSio literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/ta/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/ta/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..63c8e85 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/ta/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ta\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "மறைக்க கிளிக் செய்யவும்" + +msgid "Click to show" +msgstr "காட்ட கிளிக் செய்யவும்" diff --git a/sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..e21de4dbfa2e7850add9e0393685364b97e708a1 GIT binary patch literal 416 zcmaKkze~eF6vyL_DdOVna8BxQYQ>=>WU;hRXrW+qkI9*w#=CI2V7gf-RB+Y7#mz-< z6TJAx$oo@#vD%7*U*3oBdynsXA8X6^7HSDuM-Gq`q=(chkyT{)?GyBOq(0h21`AU! z(XnQ#|NYhC??o%+;RVr>Bs^l)Y|0aPWet=(XQ8Iuh@LQ&b158hlqFo0)R%Fbvcp1a zDeQi?-<~HLJ9~CZ3eAM3{xD+>(X7um|L;gQC+Yg=H(V4lFdf*C<| d4dxNd8&o%7UclV`G!Osgsu7rHFn3@k)+e2Hhy?%u literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..06b91bb --- /dev/null +++ b/sphinx_togglebutton/translations/locales/th/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: th\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "คลิกเพื่อซ่อน" + +msgid "Click to show" +msgstr "คลิกเพื่อแสดง" diff --git a/sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..3bda369657bdf758ece869f902694ed2219b4ab6 GIT binary patch literal 390 zcmZvUyH3L}6o$=Z3SwbHFqjPn14Rr~qAXNxRjHLC5!g*)5;yK~WIH113-AOy19KM! z*7iAg7ES=Q2=VKD`p^C2VE2Wfc93J_8reg}NUIvzN17jhMt?`zqeCRxBIF2tijJ{X z`|q!|e>ZwcCIxkx<}wvzUD;eek;v$&NE{ob>|PivHTd+l%q7$;)>)>+P34>hZ!((n zHyfSvORuNF32-cKO5sx{YIjj8E+L>v&W#l=yo(2{yV)}w?4vNO4~b4CWIpXaNau|? zWEIcaAI6JRWw>GkZD!V|P=1v*yb9=d8lD0@32Emn@W@ckm6(Zw%H^vB>Q;+F@n*FE MGF-k{C(OUIPu+rN!vFvP literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..da60039 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/tr/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Gizlemek için tıklayın" + +msgid "Click to show" +msgstr "Göstermek için tıklayın" diff --git a/sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..080365996f524cf3fad8a0f2417959bdbe0842ca GIT binary patch literal 426 zcmaKkPfNov7{=?LQ^kvC5AmjG)QN}D(u-q*!3G7Z_u9rbt|lc(vAc*4Lfn=Iln zWr>68Csf&;kR?T!z>cD4`&l8v47a#Amkwh2Pn6!Ci^f-PouM@k)izw)(ocG52Kvoh l>v!{L2IhVXnLGWVpOOAFS1`DN@G>s_--g~u5B2M$`welAi;MsO literal 0 HcmV?d00001 diff --git a/sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.po b/sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.po new file mode 100644 index 0000000..ad640c0 --- /dev/null +++ b/sphinx_togglebutton/translations/locales/uk/LC_MESSAGES/togglebutton.po @@ -0,0 +1,15 @@ + +msgid "" +msgstr "" +"Project-Id-Version: Sphinx-ToggleButton\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: uk\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +msgid "Click to hide" +msgstr "Натисніть, щоб приховати" + +msgid "Click to show" +msgstr "Натисніть, щоб показати" diff --git a/sphinx_togglebutton/translations/locales/vi/LC_MESSAGES/togglebutton.mo b/sphinx_togglebutton/translations/locales/vi/LC_MESSAGES/togglebutton.mo new file mode 100644 index 0000000000000000000000000000000000000000..c777a46961502854ad3a116b369f4f06dbc51f64 GIT binary patch literal 380 zcmZ9EJx;?w5QUeY%7_9wB#NPfVu2uv$d((TM2eIkOBi~`Uc3ut)>^N@sZ&r;QE&tb zuHdws1IagG3@8Df=F^*bnwgL7^%q83BX)^XVuKhFttw)ZnEv=9c}=uOTSTzJ*be!G zoNA%=-+!(C4tkl2Z^3GiDiLfk6;eO2z~~zhTRu$ql`w_U=)y%V6;?ddX_|?%(prtq zcsTAaH#&#MPEVs1Xn8ozg$q_x_9)LHg&xE*GKH}IWjNs7<(`SKxE6-@G1iH~)P?Ru zS!WbsT1F}TxK~b)l_tvgK%2Y51YKSl3=jWBA=9TD%R2HOKDU_sEl;{`aBxdGWDYKSl3=jWBA=9TD%R2HOKDU_sEl;{`aBxdGWD Date: Wed, 30 Jul 2025 15:55:09 +0200 Subject: [PATCH 2/4] 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. --- setup.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3556000..4b698f3 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,15 @@ license="MIT License", packages=find_packages(), package_data={ - "sphinx_togglebutton": ["_static/togglebutton.css", "_static/togglebutton.js", "_static/togglebutton-chevron.svg"] + "sphinx_togglebutton": [ + "_static/togglebutton.css", + "_static/togglebutton.js", + "_static/togglebutton-chevron.svg", + "translations/README.md", + "translations/_convert.py", + "translations/jsons/*.json", + "translations/locales/**/*" + ] }, install_requires=["setuptools", "wheel", "sphinx", "docutils"], extras_require={"sphinx": ["matplotlib", "numpy", "myst_nb", "sphinx_book_theme", "sphinx_design", "sphinx_examples"]}, From f4f9e43bd5c13727e30882b4d55390008ba19c25 Mon Sep 17 00:00:00 2001 From: Dennis den Ouden-van der Horst Date: Wed, 30 Jul 2025 16:15:55 +0200 Subject: [PATCH 3/4] 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. --- sphinx_togglebutton/_static/togglebutton.js | 46 +++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/sphinx_togglebutton/_static/togglebutton.js b/sphinx_togglebutton/_static/togglebutton.js index d67ccf1..a07c5e8 100644 --- a/sphinx_togglebutton/_static/togglebutton.js +++ b/sphinx_togglebutton/_static/togglebutton.js @@ -123,6 +123,25 @@ var toggleHidden = (button) => { } }; +// Function to synchronize the data-toggle-hint with the current state +var syncToggleHint = (button) => { + const target = button.dataset["target"]; + const itemToToggle = document.getElementById(target); + + if (itemToToggle && itemToToggle.classList.contains("toggle-hidden")) { + button.dataset.toggleHint = toggleHintShow; + button.setAttribute("aria-expanded", false); + } else if (itemToToggle) { + button.dataset.toggleHint = toggleHintHide; + button.setAttribute("aria-expanded", true); + } +}; + +// Function to sync all toggle buttons - can be called by external extensions +var syncAllToggleHints = () => { + document.querySelectorAll('.toggle-button').forEach(syncToggleHint); +}; + var toggleClickHandler = (click) => { // Be cause the admonition title is clickable and extends to the whole admonition // We only look for a click event on this title to trigger the toggle. @@ -170,6 +189,33 @@ const sphinxToggleRunWhenDOMLoaded = (cb) => { sphinxToggleRunWhenDOMLoaded(addToggleToSelector); sphinxToggleRunWhenDOMLoaded(initToggleItems); +// Set up MutationObserver to watch for external changes to toggle states +sphinxToggleRunWhenDOMLoaded(() => { + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.type === 'attributes' && mutation.attributeName === 'class') { + const target = mutation.target; + // Check if this is a toggle item that had its class changed + if (target.classList.contains('toggle')) { + // Find the associated toggle button and sync its hint + const button = target.querySelector('.toggle-button'); + if (button) { + syncToggleHint(button); + } + } + } + }); + }); + + // Start observing class changes on all toggle elements + document.querySelectorAll('.toggle').forEach((toggleElement) => { + observer.observe(toggleElement, { + attributes: true, + attributeFilter: ['class'] + }); + }); +}); + /** Toggle details blocks to be open when printing */ if (toggleOpenOnPrint == "true") { window.addEventListener("beforeprint", () => { From 7af7c7b2d5baddbdb9f914462b78760113948ac5 Mon Sep 17 00:00:00 2001 From: Dennis den Ouden-van der Horst Date: Mon, 15 Dec 2025 11:28:54 +0100 Subject: [PATCH 4/4] 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. --- sphinx_togglebutton/_static/togglebutton.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sphinx_togglebutton/_static/togglebutton.js b/sphinx_togglebutton/_static/togglebutton.js index a07c5e8..e88c0e3 100644 --- a/sphinx_togglebutton/_static/togglebutton.js +++ b/sphinx_togglebutton/_static/togglebutton.js @@ -17,8 +17,13 @@ var initToggleItems = () => { itemsToToggle.forEach((item, index) => { if (item.classList.contains("admonition")) { // If it's an admonition block, then we'll add a button inside - // Generate unique IDs for this item - var toggleID = `toggle-${index}`; + // Generate unique IDs for this item, + // IF AND ONLY IF THE ITEM DOESN'T ALREADY HAVE AN ID + if (!item.id) { + var toggleID = `toggle-${index}`; + } else { + var toggleID = item.id; + } var buttonID = `button-${toggleID}`; item.setAttribute("id", toggleID);