weblate/docs/formats/webextension.rst
Gersona 725bd96349
feat(docs): Automatically generate format features docmentation (#18106)
* initial implementation suggestion

* basic supported features snippets generation

* Add API identifiers, read-only strings and common extensions to features table

* generate doc features snippet files

* autogenerated snippets cleanup

* changelog update

* delete one file to test auto-update

* replace SUPPORTS_FUZZY with file format additional_states flag

* docs: Documentation snippets update

* fix include statetement typo

* fix incorrect monolingual attributes

* minor styling change

* docs: Documentation snippets update

* exclude snippets from being treated as standalone documents

* Set YAMLFormat as both mono/bilingual

* docs: Documentation snippets update

* fix duplicate format IDs

* only use backwards quotes for literals

---------

Co-authored-by: gersona <6675010+gersona@users.noreply.github.com>
Co-authored-by: Michal Čihař <michal@weblate.org>
2026-04-01 15:41:20 +00:00

40 lines
1.6 KiB
ReStructuredText

.. _webex:
WebExtension JSON
-----------------
File format used when translating extensions for Mozilla Firefox or Google Chromium.
.. note::
While this format is called JSON, its specification allows including
"//"-style comments. Weblate does strip these comments while parsing the
files and discards them when saving.
.. seealso::
* :doc:`tt:formats/json`
* `Google chrome.i18n <https://developer.chrome.com/docs/extensions/reference/api/i18n>`_
* `Mozilla Extensions Internationalization <https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization>`_
Example file:
.. literalinclude:: ../../weblate/trans/tests/data/cs-webext.json
:language: json
.. include:: /snippets/format-features/webextension-features.rst
Weblate configuration
+++++++++++++++++++++
+-------------------------------------------------------------------+
| Typical Weblate :ref:`component` |
+================================+==================================+
| File mask | ``_locales/*/messages.json`` |
+--------------------------------+----------------------------------+
| Monolingual base language file | ``_locales/en/messages.json`` |
+--------------------------------+----------------------------------+
| Template for new translations | `Empty` |
+--------------------------------+----------------------------------+
| File format | `WebExtension JSON file` |
+--------------------------------+----------------------------------+