diff --git a/docs/Makefile b/docs/Makefile index 294a89c98adc..0313a269c0b7 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -50,6 +50,7 @@ update-docs: @uv run --no-sync ../manage.py list_permissions --sections roles > snippets/roles.rst @uv run --no-sync ../manage.py list_checks -s checks -o snippets/checks-autogenerated.rst @uv run --no-sync ../manage.py list_checks -s flags -o snippets/check-flags-autogenerated.rst + @uv run --no-sync ../manage.py list_format_features -o snippets/format-features # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/admin/management.rst b/docs/admin/management.rst index 841f198f6a6f..b5cadd99ecdf 100644 --- a/docs/admin/management.rst +++ b/docs/admin/management.rst @@ -808,6 +808,24 @@ list_change_events Lists all possible change event types. +list_format_features +-------------------- + +.. weblate-admin:: list_format_features + +Generates RST documentation snippets describing the supported features for every file format. + +The command generates one file for every format, that can be found in the specified output directory. + +.. weblate-admin-option:: --output PATH + + Directory where the format feature snippets will be written. + +.. note:: + + The generated documentation files are meant to be included in documentation sources such as :doc:`/formats`. See also :file:`weblate/formats/management/commands/list_format_features.py` for customization and merging logic. + + loadpo ------ diff --git a/docs/changes.rst b/docs/changes.rst index 2405f7df7361..b872cf2ded24 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -6,6 +6,7 @@ Weblate 5.17 .. rubric:: New features * Added :setting:`WEBSITE_ALERTS_ENABLED` setting to allow disabling project website availability checks and alerts. +* Added new management command :wladmin:`list_format_features`, which generates RST documentation snippets describing the supported features for every file format. * Shared components can now be categorized within the target project. * :ref:`api` supports specifying a category when sharing a component via ``category_id`` parameter. * Added :ref:`addon-weblate.gettext.xgettext`, :ref:`addon-weblate.gettext.django`, and :ref:`addon-weblate.gettext.sphinx` to update POT files with configurable update cadence. @@ -19,6 +20,7 @@ Weblate 5.17 * Improved error messages in some of the :ref:`api` endpoints. * Improved performance of project and category search result pages with very large match sets. * :envvar:`WEBLATE_COMMIT_PENDING_HOURS` is now available in Docker container. +* Improved documentation with auto-generated snippets for :ref:`addons`, :ref:`fmt_capabs`, :ref:`checks`, and :ref:`machine-translation` machines. * Improved performance of :ref:`mt-weblate` lookups. * Screenshot and font upload forms now honor :setting:`ALLOWED_ASSET_SIZE` which now defaults to 10 MB. diff --git a/docs/conf.py b/docs/conf.py index 4fa06a749b96..1f6bee75a66e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -112,6 +112,11 @@ def setup(app) -> None: "Thumbs.db", ".DS_Store", "devel/reporting-example.rst", + # exclude snippets from being treated as standalone documents + # as they are already included in the real pages + # this prevents some labels defined in snippets from being marked as duplicate + "snippets/*", + "snippets/**/*", ] ogp_social_cards = { diff --git a/docs/formats.rst b/docs/formats.rst index e2483a36e95e..b57a3378b116 100644 --- a/docs/formats.rst +++ b/docs/formats.rst @@ -31,335 +31,8 @@ format (JSON, YAML, properties) or file encoding, so please verify that Translation types capabilities ------------------------------ -.. list-table:: Capabilities of all supported formats - :header-rows: 1 - - * - Format - - Linguality [#m]_ - - Plurals [#p]_ - - Descriptions [#n]_ - - Context [#c]_ - - Location [#l]_ - - Flags [#f]_ - - Additional states [#a]_ - * - :ref:`gettext` - - bilingual - - yes - - yes - - yes - - yes - - yes [#po]_ - - needs editing - * - :ref:`mono_gettext` - - mono - - yes - - yes - - yes - - yes - - yes [#po]_ - - needs editing - * - :ref:`xliff` - - both - - yes - - yes - - yes - - yes - - yes - - needs editing, approved - * - :ref:`javaprop` - - both - - no - - yes - - no - - no - - no - - - * - :ref:`mi18n-lang` - - mono - - no - - yes - - no - - no - - no - - - * - :ref:`gwt` - - mono - - yes - - yes - - no - - no - - no - - - * - :ref:`joomla` - - mono - - no - - yes - - no - - yes - - no - - - * - :ref:`qtling` - - both - - yes - - yes - - no - - yes - - yes - - needs editing - * - :ref:`aresource` - - mono - - yes - - yes [#x]_ - - no - - no - - yes - - - * - :ref:`apple` - - both - - no - - yes - - no - - no - - no - - - * - :ref:`php` - - mono - - no [#lp]_ - - yes - - no - - no - - no - - - * - :ref:`json` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`js-i18next` - - mono - - yes - - no - - no - - no - - no - - - * - :ref:`go-i18n-json` - - mono - - yes - - yes - - no - - no - - no - - - * - :ref:`gotext-json` - - mono - - yes - - yes - - no - - yes - - no - - - * - :ref:`arb` - - mono - - yes - - yes - - no - - no - - no - - - * - :ref:`webex` - - mono - - yes - - yes - - no - - no - - no - - - * - :ref:`dotnet` - - mono - - no - - yes - - no - - no - - yes - - - * - :ref:`resourcedict` - - mono - - no - - no - - no - - no - - yes - - - * - :ref:`csv` - - both - - no - - yes - - yes - - yes - - no - - needs editing - * - :ref:`yaml` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`ryaml` - - mono - - yes - - no - - no - - no - - no - - - * - :ref:`dtd` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`flatxml` - - mono - - no - - no - - no - - no - - yes - - - * - :ref:`winrc` - - mono - - no - - yes - - no - - no - - no - - - * - :ref:`xlsx` - - mono - - no - - yes - - yes - - yes - - no - - needs editing - * - :ref:`appstore` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`subtitles` - - mono - - no - - no - - no - - yes - - no - - - * - :ref:`html` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`markdown` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`odf` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`idml` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`ini` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`islu` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`tbx` - - bilingual - - no - - yes - - yes - - no - - yes - - - * - :ref:`txt` - - mono - - no - - no - - no - - no - - no - - - * - :ref:`stringsdict` - - mono - - yes - - no - - no - - no - - no - - - * - :ref:`fluent` - - mono - - no [#fp]_ - - yes - - no - - no - - no - - - -.. [#m] See :ref:`bimono` -.. [#p] See :ref:`format-plurals` -.. [#n] See :ref:`format-description` -.. [#c] See :ref:`format-context` -.. [#l] See :ref:`format-location` -.. [#a] See :ref:`format-states` -.. [#x] XML comment placed before the ```` element, parsed as a source string description. -.. [#f] See :ref:`format-flags`. -.. [#po] The gettext type comments are used as flags. -.. [#lp] The plurals are supported only for Laravel which uses in string syntax to define them, see `Localization in Laravel`_. -.. [#fp] Plurals are handled in the syntax of the strings and not exposed as plurals in Weblate. - -.. _Localization in Laravel: https://laravel.com/docs/localization +Please refer to the documentation page of each individual file format +for information about which features are supported in that format. .. _bimono: diff --git a/docs/formats/android.rst b/docs/formats/android.rst index a45da7a938a6..6091848b7e1e 100644 --- a/docs/formats/android.rst +++ b/docs/formats/android.rst @@ -67,6 +67,8 @@ Weblate does following escaping of strings: * :doc:`/formats/moko-resources` * :doc:`tt:formats/android` +.. include:: /snippets/format-features/aresource-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/apple.rst b/docs/formats/apple.rst index 8d40efcdb598..4ee2a2e3ebc5 100644 --- a/docs/formats/apple.rst +++ b/docs/formats/apple.rst @@ -19,6 +19,8 @@ Apple iOS strings are usually used as monolingual. * `Message Catalog File Format in PWG 5100.13 `_ * :doc:`tt:formats/strings` +.. include:: /snippets/format-features/strings-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/appstore.rst b/docs/formats/appstore.rst index c55a985581c0..addab071f00d 100644 --- a/docs/formats/appstore.rst +++ b/docs/formats/appstore.rst @@ -20,6 +20,8 @@ separate strings to translate. mark them read-only (see :ref:`custom-checks`). This can be automated by the :ref:`addon-weblate.flags.bulk`. +.. include:: /snippets/format-features/appstore-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/arb.rst b/docs/formats/arb.rst index f537c8d803d7..6b5eec26cfd7 100644 --- a/docs/formats/arb.rst +++ b/docs/formats/arb.rst @@ -23,6 +23,8 @@ with (what is most often the) English strings. .. _Internationalization of Flutter apps: https://docs.flutter.dev/ui/internationalization .. _Application Resource Bundle Specification: https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification +.. include:: /snippets/format-features/arb-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/asciidoc.rst b/docs/formats/asciidoc.rst index 4d8a2d5f6e0c..87f26b95f99a 100644 --- a/docs/formats/asciidoc.rst +++ b/docs/formats/asciidoc.rst @@ -19,6 +19,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.adoc +.. include:: /snippets/format-features/asciidoc-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/catkeys.rst b/docs/formats/catkeys.rst index ea15b8ee4591..0cc55e5614d5 100644 --- a/docs/formats/catkeys.rst +++ b/docs/formats/catkeys.rst @@ -19,6 +19,8 @@ Example file: source1 context1 remarks1 target1 source2 context2 remarks2 target2 +.. include:: /snippets/format-features/catkeys-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/compose-multiplatform-resources.rst b/docs/formats/compose-multiplatform-resources.rst index 5a12df5805a9..da707032af7e 100644 --- a/docs/formats/compose-multiplatform-resources.rst +++ b/docs/formats/compose-multiplatform-resources.rst @@ -17,6 +17,8 @@ A variant of :doc:`/formats/android`. It differs in escaping. * :doc:`/formats/android` * :doc:`tt:formats/android` +.. include:: /snippets/format-features/cmp-resource-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/csv.rst b/docs/formats/csv.rst index 398699f6b6ab..df368ad280cb 100644 --- a/docs/formats/csv.rst +++ b/docs/formats/csv.rst @@ -58,6 +58,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.csv :language: text +.. include:: /snippets/format-features/csv-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/dtd.rst b/docs/formats/dtd.rst index 5ede00ed0ee2..05eda1378b4c 100644 --- a/docs/formats/dtd.rst +++ b/docs/formats/dtd.rst @@ -15,6 +15,8 @@ Example DTD file: .. literalinclude:: ../../weblate/trans/tests/data/cs.dtd :language: yaml +.. include:: /snippets/format-features/dtd-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/excel.rst b/docs/formats/excel.rst index 9e44ab0b5232..ed54e7aca53c 100644 --- a/docs/formats/excel.rst +++ b/docs/formats/excel.rst @@ -13,6 +13,8 @@ contains the translation). Additionally there should be the column called ``cont download for exporting the translations into an Excel workbook, you already get a file with the correct file format. +.. include:: /snippets/format-features/xlsx-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/flatxml.rst b/docs/formats/flatxml.rst index c242e6a17ef5..e3d53dce6125 100644 --- a/docs/formats/flatxml.rst +++ b/docs/formats/flatxml.rst @@ -23,6 +23,8 @@ Example of flat XML files: .. literalinclude:: ../../weblate/trans/tests/data/cs-flat-custom.xml :language: xml +.. include:: /snippets/format-features/flatxml-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/fluent.rst b/docs/formats/fluent.rst index b1db8112305a..dc7c30ea6c22 100644 --- a/docs/formats/fluent.rst +++ b/docs/formats/fluent.rst @@ -21,6 +21,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.ftl +.. include:: /snippets/format-features/fluent-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/formatjs.rst b/docs/formats/formatjs.rst index e91bbfd1bda6..f5e0cab640f7 100644 --- a/docs/formats/formatjs.rst +++ b/docs/formats/formatjs.rst @@ -35,6 +35,8 @@ Example file: } } +.. include:: /snippets/format-features/formatjs-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/gettext.rst b/docs/formats/gettext.rst index e5c5f58d304a..6bae443f6231 100644 --- a/docs/formats/gettext.rst +++ b/docs/formats/gettext.rst @@ -134,6 +134,10 @@ While the base language file will be: msgstr "None" +.. include:: /snippets/format-features/po-mono-features.rst + +.. include:: /snippets/format-features/po-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/go-i18n.rst b/docs/formats/go-i18n.rst index ed4ae14986f0..6735d6f3679e 100644 --- a/docs/formats/go-i18n.rst +++ b/docs/formats/go-i18n.rst @@ -42,6 +42,10 @@ Example file v2: .. literalinclude:: ../../weblate/trans/tests/data/cs-go18n-v2.json :language: json +.. include:: /snippets/format-features/go-i18n-toml-features.rst + +.. include:: /snippets/format-features/go-i18n-json-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/gotext.rst b/docs/formats/gotext.rst index e270edd503b3..4c39d39452e9 100644 --- a/docs/formats/gotext.rst +++ b/docs/formats/gotext.rst @@ -19,6 +19,8 @@ with (what is most often the) English strings. * :ref:`addon-weblate.json.customize` * :ref:`addon-weblate.cleanup.generic` +.. include:: /snippets/format-features/gotext-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/gwt.rst b/docs/formats/gwt.rst index a62c63ee934d..f0ff63722542 100644 --- a/docs/formats/gwt.rst +++ b/docs/formats/gwt.rst @@ -19,6 +19,8 @@ GWT properties are usually used as monolingual translations. * :ref:`addon-weblate.properties.sort` * :ref:`addon-weblate.cleanup.generic` +.. include:: /snippets/format-features/gwt-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/html.rst b/docs/formats/html.rst index e904530585a8..2aee531a4f5f 100644 --- a/docs/formats/html.rst +++ b/docs/formats/html.rst @@ -18,6 +18,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.html :language: html +.. include:: /snippets/format-features/html-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/i18next.rst b/docs/formats/i18next.rst index 579b81bf0a4e..f83602cf83af 100644 --- a/docs/formats/i18next.rst +++ b/docs/formats/i18next.rst @@ -53,6 +53,10 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/en.i18next.json :language: json +.. include:: /snippets/format-features/i18nextv4-features.rst + +.. include:: /snippets/format-features/i18next-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/idml.rst b/docs/formats/idml.rst index 88e711d63170..a30a01be1577 100644 --- a/docs/formats/idml.rst +++ b/docs/formats/idml.rst @@ -9,6 +9,8 @@ IDML Format The translatable content is extracted from the Adobe InDesign Markup Language files and offered for the translation. +.. include:: /snippets/format-features/idml-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/ini.rst b/docs/formats/ini.rst index 5bfb1e4b1dfe..c79185c18727 100644 --- a/docs/formats/ini.rst +++ b/docs/formats/ini.rst @@ -35,6 +35,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.ini :language: ini +.. include:: /snippets/format-features/ini-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/innosetup.rst b/docs/formats/innosetup.rst index cf48c0a7c793..f008e7d57821 100644 --- a/docs/formats/innosetup.rst +++ b/docs/formats/innosetup.rst @@ -28,6 +28,8 @@ Inno Setup INI translations are usually used as monolingual translations. * :ref:`joomla` * :ref:`ini` +.. include:: /snippets/format-features/islu-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/java.rst b/docs/formats/java.rst index ff9c22d148d5..d487438744b1 100644 --- a/docs/formats/java.rst +++ b/docs/formats/java.rst @@ -31,6 +31,8 @@ all others encode characters directly either in UTF-8 or UTF-16. * :ref:`addon-weblate.properties.sort` * :ref:`addon-weblate.cleanup.generic` +.. include:: /snippets/format-features/properties-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/joomla.rst b/docs/formats/joomla.rst index 248a6e8f6a56..ed40bf991f8e 100644 --- a/docs/formats/joomla.rst +++ b/docs/formats/joomla.rst @@ -21,6 +21,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.joomla.ini :language: ini +.. include:: /snippets/format-features/joomla-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/json.rst b/docs/formats/json.rst index fbdc040c70ad..e7edbb9ab7d6 100644 --- a/docs/formats/json.rst +++ b/docs/formats/json.rst @@ -67,6 +67,8 @@ Nested files are supported as well (see above for requirements), such a file can .. literalinclude:: ../../weblate/trans/tests/data/cs-nested.json :language: json +.. include:: /snippets/format-features/json-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/laravel.rst b/docs/formats/laravel.rst index 1d5923544abf..d34f3aeff20e 100644 --- a/docs/formats/laravel.rst +++ b/docs/formats/laravel.rst @@ -22,6 +22,8 @@ The Laravel PHP localization files are supported as well with plurals: .. _Localization in Laravel: https://laravel.com/docs/localization +.. include:: /snippets/format-features/laravel-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/markdown.rst b/docs/formats/markdown.rst index 3fc112c0cd7a..66ec7f53ec97 100644 --- a/docs/formats/markdown.rst +++ b/docs/formats/markdown.rst @@ -20,6 +20,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.md :language: md +.. include:: /snippets/format-features/markdown-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/mi18n.rst b/docs/formats/mi18n.rst index b7eca2946e1e..f6b657c5478b 100644 --- a/docs/formats/mi18n.rst +++ b/docs/formats/mi18n.rst @@ -26,6 +26,8 @@ File format used for JavaScript localization by `draggable/i18n`_. Syntactically .. _draggable/i18n: https://github.com/Draggable/i18n +.. include:: /snippets/format-features/mi18n-lang-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/moko-resources.rst b/docs/formats/moko-resources.rst index f16b42c9ec58..0eedbc469f72 100644 --- a/docs/formats/moko-resources.rst +++ b/docs/formats/moko-resources.rst @@ -17,6 +17,8 @@ A variant of :doc:`/formats/android`. It differs in plural tag (``plural`` is us * :doc:`/formats/android` * :doc:`tt:formats/android` +.. include:: /snippets/format-features/moko-resource-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/nextcloud-json.rst b/docs/formats/nextcloud-json.rst index c4c763ac525a..f0378bc6b4a1 100644 --- a/docs/formats/nextcloud-json.rst +++ b/docs/formats/nextcloud-json.rst @@ -20,6 +20,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.nextjson :language: json +.. include:: /snippets/format-features/nextcloud-json-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/odf.rst b/docs/formats/odf.rst index f3e26052240d..677906310e8d 100644 --- a/docs/formats/odf.rst +++ b/docs/formats/odf.rst @@ -11,6 +11,8 @@ The translatable content is extracted from the OpenDocument files and offered fo :doc:`tt:formats/odf` +.. include:: /snippets/format-features/odf-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/php.rst b/docs/formats/php.rst index abec8ddce621..a8326abb3c83 100644 --- a/docs/formats/php.rst +++ b/docs/formats/php.rst @@ -20,6 +20,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.php :language: php +.. include:: /snippets/format-features/php-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/qt.rst b/docs/formats/qt.rst index 5e5480f70d2e..9dc2e45296df 100644 --- a/docs/formats/qt.rst +++ b/docs/formats/qt.rst @@ -22,6 +22,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.ts :language: xml +.. include:: /snippets/format-features/ts-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/resjson.rst b/docs/formats/resjson.rst index 06f482fa52cd..4543fb681bd1 100644 --- a/docs/formats/resjson.rst +++ b/docs/formats/resjson.rst @@ -20,6 +20,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.resjson :language: json +.. include:: /snippets/format-features/resjson-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/resourcedict.rst b/docs/formats/resourcedict.rst index 92c3029603b8..205b4eb4a15e 100644 --- a/docs/formats/resourcedict.rst +++ b/docs/formats/resourcedict.rst @@ -26,6 +26,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.xaml :language: xml +.. include:: /snippets/format-features/resourcedictionary-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/resx.rst b/docs/formats/resx.rst index 8474fbd6d0eb..a9b49ceb1627 100644 --- a/docs/formats/resx.rst +++ b/docs/formats/resx.rst @@ -26,6 +26,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.resx :language: xml +.. include:: /snippets/format-features/resx-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/ruby.rst b/docs/formats/ruby.rst index e744d00a82a9..f16716db4204 100644 --- a/docs/formats/ruby.rst +++ b/docs/formats/ruby.rst @@ -18,6 +18,8 @@ Example Ruby i18n YAML file: .. literalinclude:: ../../weblate/trans/tests/data/cs.ryml :language: yaml +.. include:: /snippets/format-features/ruby-yaml-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/stringsdict.rst b/docs/formats/stringsdict.rst index 989a757e5def..1828737997fa 100644 --- a/docs/formats/stringsdict.rst +++ b/docs/formats/stringsdict.rst @@ -19,6 +19,8 @@ Example file: :language: xml +.. include:: /snippets/format-features/stringsdict-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/subtitles.rst b/docs/formats/subtitles.rst index 3acb204229cf..fabd91b869ac 100644 --- a/docs/formats/subtitles.rst +++ b/docs/formats/subtitles.rst @@ -14,6 +14,8 @@ Weblate can translate various subtitle files: :doc:`tt:formats/subtitles` +.. include:: /snippets/format-features/srt-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/tbx.rst b/docs/formats/tbx.rst index 995191f1bd2c..1ca3fe5a774b 100644 --- a/docs/formats/tbx.rst +++ b/docs/formats/tbx.rst @@ -3,19 +3,6 @@ TermBase eXchange format ------------------------ -.. list-table:: Supported features - - * - :ref:`format-explanation` - - Source string explanation is saved and loaded from the ```` - tag, translation string explanation from ````. - - * - Administrative status - - Terms with administrative status ``forbidden`` or ``obsolete`` in ```` - are marked with the ``forbidden`` flag (:ref:`glossary-forbidden`). - * - Translation needed - - Terms with ```` containing ``no`` are marked as read-only (:ref:`glossary-untranslatable`). - * - Usage notes - - Usage notes from ```` tags are displayed in the glossary. .. versionadded:: 4.5 .. versionchanged:: 5.12 @@ -28,6 +15,8 @@ TBX is an XML format for the exchange of terminology data. * :doc:`tt:formats/tbx` * :ref:`glossary` +.. include:: /snippets/format-features/tbx-features.rst + Explanations ++++++++++++ diff --git a/docs/formats/toml.rst b/docs/formats/toml.rst index 4ee630cd995b..b1ab5483dcd5 100644 --- a/docs/formats/toml.rst +++ b/docs/formats/toml.rst @@ -27,6 +27,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.goi18n.toml :language: toml +.. include:: /snippets/format-features/toml-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/txt.rst b/docs/formats/txt.rst index 4f89768954ed..f2bf1fb0661a 100644 --- a/docs/formats/txt.rst +++ b/docs/formats/txt.rst @@ -26,6 +26,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs.txt +.. include:: /snippets/format-features/txt-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/webextension.rst b/docs/formats/webextension.rst index a57bee0ef640..f383590e293a 100644 --- a/docs/formats/webextension.rst +++ b/docs/formats/webextension.rst @@ -22,6 +22,8 @@ Example file: .. literalinclude:: ../../weblate/trans/tests/data/cs-webext.json :language: json +.. include:: /snippets/format-features/webextension-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/winrc.rst b/docs/formats/winrc.rst index 1fb9c757705f..49f3918e0e7a 100644 --- a/docs/formats/winrc.rst +++ b/docs/formats/winrc.rst @@ -27,6 +27,8 @@ Example Windows RC file: .. literalinclude:: ../../weblate/trans/tests/data/cs-CZ.rc :language: c +.. include:: /snippets/format-features/rc-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/wxl.rst b/docs/formats/wxl.rst index 2c14a356383b..bb77d32d11e3 100644 --- a/docs/formats/wxl.rst +++ b/docs/formats/wxl.rst @@ -20,6 +20,8 @@ Example WXL file: .. literalinclude:: ../../weblate/trans/tests/data/cs-cz.wxl :language: xml +.. include:: /snippets/format-features/wxl-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/xliff.rst b/docs/formats/xliff.rst index bbed69f6319a..b4e05fc6eb45 100644 --- a/docs/formats/xliff.rst +++ b/docs/formats/xliff.rst @@ -136,6 +136,8 @@ Example XLIFF file: .. literalinclude:: ../../weblate/trans/tests/data/cs.xliff :language: xml +.. include:: /snippets/format-features/xliff-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/xliff2.rst b/docs/formats/xliff2.rst index 0c419ad1df46..a47180cd1a26 100644 --- a/docs/formats/xliff2.rst +++ b/docs/formats/xliff2.rst @@ -38,6 +38,8 @@ Example XLIFF file: .. literalinclude:: ../../weblate/trans/tests/data/cs.xliff2 :language: xml +.. include:: /snippets/format-features/xliff2-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/formats/yaml.rst b/docs/formats/yaml.rst index 8612e004ce96..7a1a0f97403c 100644 --- a/docs/formats/yaml.rst +++ b/docs/formats/yaml.rst @@ -23,6 +23,8 @@ Example of a YAML file: .. literalinclude:: ../../weblate/trans/tests/data/cs.pyml :language: yaml +.. include:: /snippets/format-features/yaml-features.rst + Weblate configuration +++++++++++++++++++++ diff --git a/docs/snippets/format-features/appstore-features.rst b/docs/snippets/format-features/appstore-features.rst new file mode 100644 index 000000000000..3731e92632a3 --- /dev/null +++ b/docs/snippets/format-features/appstore-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features appstore +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.txt`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``appstore`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features appstore diff --git a/docs/snippets/format-features/arb-features.rst b/docs/snippets/format-features/arb-features.rst new file mode 100644 index 000000000000..4cff167f160e --- /dev/null +++ b/docs/snippets/format-features/arb-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features arb +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``arb`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features arb diff --git a/docs/snippets/format-features/aresource-features.rst b/docs/snippets/format-features/aresource-features.rst new file mode 100644 index 000000000000..7073bbfef5c6 --- /dev/null +++ b/docs/snippets/format-features/aresource-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features aresource +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``aresource`` + * - Supports read-only strings :ref:`ⓘ ` + - ``Yes`` + +.. AUTOGENERATED END: format-features aresource diff --git a/docs/snippets/format-features/asciidoc-features.rst b/docs/snippets/format-features/asciidoc-features.rst new file mode 100644 index 000000000000..152cabc2fea2 --- /dev/null +++ b/docs/snippets/format-features/asciidoc-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features asciidoc +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.adoc`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``asciidoc`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features asciidoc diff --git a/docs/snippets/format-features/catkeys-features.rst b/docs/snippets/format-features/catkeys-features.rst new file mode 100644 index 000000000000..e00511ee35c2 --- /dev/null +++ b/docs/snippets/format-features/catkeys-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features catkeys +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.catkeys`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``Yes`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``catkeys`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features catkeys diff --git a/docs/snippets/format-features/cmp-resource-features.rst b/docs/snippets/format-features/cmp-resource-features.rst new file mode 100644 index 000000000000..ecbd3d832410 --- /dev/null +++ b/docs/snippets/format-features/cmp-resource-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features cmp-resource +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``cmp-resource`` + * - Supports read-only strings :ref:`ⓘ ` + - ``Yes`` + +.. AUTOGENERATED END: format-features cmp-resource diff --git a/docs/snippets/format-features/csv-features.rst b/docs/snippets/format-features/csv-features.rst new file mode 100644 index 000000000000..a43090aaa63b --- /dev/null +++ b/docs/snippets/format-features/csv-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features csv +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.csv`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - Additional states :ref:`ⓘ ` + - ``Needs editing`` + * - API identifier + - ``csv``, ``csv-multi``, ``csv-simple`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features csv diff --git a/docs/snippets/format-features/dtd-features.rst b/docs/snippets/format-features/dtd-features.rst new file mode 100644 index 000000000000..914e643f639e --- /dev/null +++ b/docs/snippets/format-features/dtd-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features dtd +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.dtd`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``dtd`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features dtd diff --git a/docs/snippets/format-features/flatxml-features.rst b/docs/snippets/format-features/flatxml-features.rst new file mode 100644 index 000000000000..613e06d9bf33 --- /dev/null +++ b/docs/snippets/format-features/flatxml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features flatxml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``flatxml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features flatxml diff --git a/docs/snippets/format-features/fluent-features.rst b/docs/snippets/format-features/fluent-features.rst new file mode 100644 index 000000000000..845442e7a691 --- /dev/null +++ b/docs/snippets/format-features/fluent-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features fluent +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.ftl`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``fluent`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features fluent diff --git a/docs/snippets/format-features/formatjs-features.rst b/docs/snippets/format-features/formatjs-features.rst new file mode 100644 index 000000000000..b223a13813a0 --- /dev/null +++ b/docs/snippets/format-features/formatjs-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features formatjs +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``formatjs`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features formatjs diff --git a/docs/snippets/format-features/go-i18n-json-features.rst b/docs/snippets/format-features/go-i18n-json-features.rst new file mode 100644 index 000000000000..74cc581d2a6f --- /dev/null +++ b/docs/snippets/format-features/go-i18n-json-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features go-i18n-json +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``go-i18n-json``, ``go-i18n-json-v2`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features go-i18n-json diff --git a/docs/snippets/format-features/go-i18n-toml-features.rst b/docs/snippets/format-features/go-i18n-toml-features.rst new file mode 100644 index 000000000000..700f58892551 --- /dev/null +++ b/docs/snippets/format-features/go-i18n-toml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features go-i18n-toml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.toml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``go-i18n-toml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features go-i18n-toml diff --git a/docs/snippets/format-features/gotext-features.rst b/docs/snippets/format-features/gotext-features.rst new file mode 100644 index 000000000000..a4e6aaf76929 --- /dev/null +++ b/docs/snippets/format-features/gotext-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features gotext +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``gotext`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features gotext diff --git a/docs/snippets/format-features/gwt-features.rst b/docs/snippets/format-features/gwt-features.rst new file mode 100644 index 000000000000..8f4f35f6b93f --- /dev/null +++ b/docs/snippets/format-features/gwt-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features gwt +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.properties`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``gwt`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features gwt diff --git a/docs/snippets/format-features/html-features.rst b/docs/snippets/format-features/html-features.rst new file mode 100644 index 000000000000..5207bc4c45d8 --- /dev/null +++ b/docs/snippets/format-features/html-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features html +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.html`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``html`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features html diff --git a/docs/snippets/format-features/i18next-features.rst b/docs/snippets/format-features/i18next-features.rst new file mode 100644 index 000000000000..54a6b5b3300c --- /dev/null +++ b/docs/snippets/format-features/i18next-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features i18next +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``i18next`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features i18next diff --git a/docs/snippets/format-features/i18nextv4-features.rst b/docs/snippets/format-features/i18nextv4-features.rst new file mode 100644 index 000000000000..d49ca2f72fd3 --- /dev/null +++ b/docs/snippets/format-features/i18nextv4-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features i18nextv4 +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``i18nextv4`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features i18nextv4 diff --git a/docs/snippets/format-features/idml-features.rst b/docs/snippets/format-features/idml-features.rst new file mode 100644 index 000000000000..5ff73ab6113d --- /dev/null +++ b/docs/snippets/format-features/idml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features idml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.idml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``idml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features idml diff --git a/docs/snippets/format-features/ini-features.rst b/docs/snippets/format-features/ini-features.rst new file mode 100644 index 000000000000..031e5a3aaae5 --- /dev/null +++ b/docs/snippets/format-features/ini-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features ini +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.ini`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``ini`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features ini diff --git a/docs/snippets/format-features/islu-features.rst b/docs/snippets/format-features/islu-features.rst new file mode 100644 index 000000000000..2123a508d390 --- /dev/null +++ b/docs/snippets/format-features/islu-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features islu +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.islu`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``islu`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features islu diff --git a/docs/snippets/format-features/joomla-features.rst b/docs/snippets/format-features/joomla-features.rst new file mode 100644 index 000000000000..b304108ef2d5 --- /dev/null +++ b/docs/snippets/format-features/joomla-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features joomla +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.ini`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``joomla`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features joomla diff --git a/docs/snippets/format-features/json-features.rst b/docs/snippets/format-features/json-features.rst new file mode 100644 index 000000000000..37d5d070a458 --- /dev/null +++ b/docs/snippets/format-features/json-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features json +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``json``, ``json-nested`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features json diff --git a/docs/snippets/format-features/laravel-features.rst b/docs/snippets/format-features/laravel-features.rst new file mode 100644 index 000000000000..0832b0030d65 --- /dev/null +++ b/docs/snippets/format-features/laravel-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features laravel +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.php`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``laravel`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features laravel diff --git a/docs/snippets/format-features/markdown-features.rst b/docs/snippets/format-features/markdown-features.rst new file mode 100644 index 000000000000..cc8bc0cfbd51 --- /dev/null +++ b/docs/snippets/format-features/markdown-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features markdown +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.md`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``markdown`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features markdown diff --git a/docs/snippets/format-features/mi18n-lang-features.rst b/docs/snippets/format-features/mi18n-lang-features.rst new file mode 100644 index 000000000000..84d7e24c08c9 --- /dev/null +++ b/docs/snippets/format-features/mi18n-lang-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features mi18n-lang +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.properties`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``mi18n-lang`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features mi18n-lang diff --git a/docs/snippets/format-features/moko-resource-features.rst b/docs/snippets/format-features/moko-resource-features.rst new file mode 100644 index 000000000000..38f4776bc979 --- /dev/null +++ b/docs/snippets/format-features/moko-resource-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features moko-resource +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``moko-resource`` + * - Supports read-only strings :ref:`ⓘ ` + - ``Yes`` + +.. AUTOGENERATED END: format-features moko-resource diff --git a/docs/snippets/format-features/nextcloud-json-features.rst b/docs/snippets/format-features/nextcloud-json-features.rst new file mode 100644 index 000000000000..5d1ed06ffc20 --- /dev/null +++ b/docs/snippets/format-features/nextcloud-json-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features nextcloud-json +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``nextcloud-json`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features nextcloud-json diff --git a/docs/snippets/format-features/odf-features.rst b/docs/snippets/format-features/odf-features.rst new file mode 100644 index 000000000000..8882497adad2 --- /dev/null +++ b/docs/snippets/format-features/odf-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features odf +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.odt`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``odf`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features odf diff --git a/docs/snippets/format-features/php-features.rst b/docs/snippets/format-features/php-features.rst new file mode 100644 index 000000000000..326a70587022 --- /dev/null +++ b/docs/snippets/format-features/php-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features php +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.php`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``php`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features php diff --git a/docs/snippets/format-features/po-features.rst b/docs/snippets/format-features/po-features.rst new file mode 100644 index 000000000000..dca01007b992 --- /dev/null +++ b/docs/snippets/format-features/po-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features po +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.po``, ``.pot`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - Additional states :ref:`ⓘ ` + - ``Needs editing`` + * - API identifier + - ``po`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features po diff --git a/docs/snippets/format-features/po-mono-features.rst b/docs/snippets/format-features/po-mono-features.rst new file mode 100644 index 000000000000..81c69cb694c9 --- /dev/null +++ b/docs/snippets/format-features/po-mono-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features po-mono +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.po``, ``.pot`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - Additional states :ref:`ⓘ ` + - ``Needs editing`` + * - API identifier + - ``po-mono`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features po-mono diff --git a/docs/snippets/format-features/properties-features.rst b/docs/snippets/format-features/properties-features.rst new file mode 100644 index 000000000000..fc5da89b501b --- /dev/null +++ b/docs/snippets/format-features/properties-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features properties +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.properties`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``properties`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features properties diff --git a/docs/snippets/format-features/rc-features.rst b/docs/snippets/format-features/rc-features.rst new file mode 100644 index 000000000000..c6a1fe2ec3c2 --- /dev/null +++ b/docs/snippets/format-features/rc-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features rc +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.rc`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``rc`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features rc diff --git a/docs/snippets/format-features/resjson-features.rst b/docs/snippets/format-features/resjson-features.rst new file mode 100644 index 000000000000..03fb7c0007a2 --- /dev/null +++ b/docs/snippets/format-features/resjson-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features resjson +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``resjson`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features resjson diff --git a/docs/snippets/format-features/resourcedictionary-features.rst b/docs/snippets/format-features/resourcedictionary-features.rst new file mode 100644 index 000000000000..1ea6a41ebf2f --- /dev/null +++ b/docs/snippets/format-features/resourcedictionary-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features resourcedictionary +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xaml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``resourcedictionary`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features resourcedictionary diff --git a/docs/snippets/format-features/resx-features.rst b/docs/snippets/format-features/resx-features.rst new file mode 100644 index 000000000000..aa1fa9a84279 --- /dev/null +++ b/docs/snippets/format-features/resx-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features resx +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.resx`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``resx`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features resx diff --git a/docs/snippets/format-features/ruby-yaml-features.rst b/docs/snippets/format-features/ruby-yaml-features.rst new file mode 100644 index 000000000000..a54407ec62e3 --- /dev/null +++ b/docs/snippets/format-features/ruby-yaml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features ruby-yaml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.yml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``ruby-yaml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features ruby-yaml diff --git a/docs/snippets/format-features/srt-features.rst b/docs/snippets/format-features/srt-features.rst new file mode 100644 index 000000000000..aabb5342b5d7 --- /dev/null +++ b/docs/snippets/format-features/srt-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features srt +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.srt`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``srt`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features srt diff --git a/docs/snippets/format-features/strings-features.rst b/docs/snippets/format-features/strings-features.rst new file mode 100644 index 000000000000..f409e9a64d5b --- /dev/null +++ b/docs/snippets/format-features/strings-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features strings +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.strings`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``strings`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features strings diff --git a/docs/snippets/format-features/stringsdict-features.rst b/docs/snippets/format-features/stringsdict-features.rst new file mode 100644 index 000000000000..dab77ac365cb --- /dev/null +++ b/docs/snippets/format-features/stringsdict-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features stringsdict +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.stringsdict`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``stringsdict`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features stringsdict diff --git a/docs/snippets/format-features/tbx-features.rst b/docs/snippets/format-features/tbx-features.rst new file mode 100644 index 000000000000..a8e7665b36ef --- /dev/null +++ b/docs/snippets/format-features/tbx-features.rst @@ -0,0 +1,36 @@ +.. AUTOGENERATED START: format-features tbx +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.tbx`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``Yes`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - API identifier + - ``tbx`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features tbx + +:Administrative status: Terms with administrative status ``forbidden`` or ``obsolete`` in ```` are marked with the ``forbidden`` flag (:ref:`glossary-forbidden`)., +:Translation needed: Terms with ```` containing ``no`` are marked as read-only (:ref:`glossary-untranslatable`)., +:Usage notes: Usage notes from ```` tags are displayed in the glossary., + +.. note:: + + :ref:`format-explanation`: Source string explanation is saved and loaded from the ```` tag, translation string explanation from ```` diff --git a/docs/snippets/format-features/toml-features.rst b/docs/snippets/format-features/toml-features.rst new file mode 100644 index 000000000000..0527c2eaeec7 --- /dev/null +++ b/docs/snippets/format-features/toml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features toml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.toml`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``toml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features toml diff --git a/docs/snippets/format-features/ts-features.rst b/docs/snippets/format-features/ts-features.rst new file mode 100644 index 000000000000..963c09ceb540 --- /dev/null +++ b/docs/snippets/format-features/ts-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features ts +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.ts`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - Additional states :ref:`ⓘ ` + - ``Needs editing`` + * - API identifier + - ``ts`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features ts diff --git a/docs/snippets/format-features/txt-features.rst b/docs/snippets/format-features/txt-features.rst new file mode 100644 index 000000000000..f8e49fe2bddd --- /dev/null +++ b/docs/snippets/format-features/txt-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features txt +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.txt`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``dokuwiki``, ``mediawiki``, ``txt`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features txt diff --git a/docs/snippets/format-features/webextension-features.rst b/docs/snippets/format-features/webextension-features.rst new file mode 100644 index 000000000000..2bc6667bdb20 --- /dev/null +++ b/docs/snippets/format-features/webextension-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features webextension +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.json`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``webextension`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features webextension diff --git a/docs/snippets/format-features/wxl-features.rst b/docs/snippets/format-features/wxl-features.rst new file mode 100644 index 000000000000..72b09f1d1fda --- /dev/null +++ b/docs/snippets/format-features/wxl-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features wxl +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.wxl`` + * - Linguality :ref:`ⓘ ` + - ``Monolingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``wxl`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features wxl diff --git a/docs/snippets/format-features/xliff-features.rst b/docs/snippets/format-features/xliff-features.rst new file mode 100644 index 000000000000..9c68ade88db1 --- /dev/null +++ b/docs/snippets/format-features/xliff-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features xliff +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.sdlxliff``, ``.xlf``, ``.xliff`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - Additional states :ref:`ⓘ ` + - ``Approved``, ``Needs editing`` + * - API identifier + - ``apple-xliff``, ``plainxliff``, ``poxliff``, ``xliff`` + * - Supports read-only strings :ref:`ⓘ ` + - ``Yes`` + +.. AUTOGENERATED END: format-features xliff diff --git a/docs/snippets/format-features/xliff2-features.rst b/docs/snippets/format-features/xliff2-features.rst new file mode 100644 index 000000000000..77432564c8cd --- /dev/null +++ b/docs/snippets/format-features/xliff2-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features xliff2 +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.xlf``, ``.xliff`` + * - Linguality :ref:`ⓘ ` + - ``Bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``Yes`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``Yes`` + * - Additional states :ref:`ⓘ ` + - ``Approved``, ``Needs editing`` + * - API identifier + - ``xliff2``, ``xliff2-placeables`` + * - Supports read-only strings :ref:`ⓘ ` + - ``Yes`` + +.. AUTOGENERATED END: format-features xliff2 diff --git a/docs/snippets/format-features/xlsx-features.rst b/docs/snippets/format-features/xlsx-features.rst new file mode 100644 index 000000000000..a7b23e06fbee --- /dev/null +++ b/docs/snippets/format-features/xlsx-features.rst @@ -0,0 +1,30 @@ +.. AUTOGENERATED START: format-features xlsx +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.csv``, ``.xlsx`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``Yes`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``Yes`` + * - Supports location :ref:`ⓘ ` + - ``Yes`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - Additional states :ref:`ⓘ ` + - ``Needs editing`` + * - API identifier + - ``xlsx`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features xlsx diff --git a/docs/snippets/format-features/yaml-features.rst b/docs/snippets/format-features/yaml-features.rst new file mode 100644 index 000000000000..2d6a23265cec --- /dev/null +++ b/docs/snippets/format-features/yaml-features.rst @@ -0,0 +1,28 @@ +.. AUTOGENERATED START: format-features yaml +.. This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. + +.. list-table:: Supported features + :stub-columns: 1 + + * - File extensions + - ``.yml`` + * - Linguality :ref:`ⓘ ` + - ``Both monolingual and bilingual`` + * - Supports plural :ref:`ⓘ ` + - ``No`` + * - Supports descriptions :ref:`ⓘ ` + - ``No`` + * - Supports explanation :ref:`ⓘ ` + - ``No`` + * - Supports context :ref:`ⓘ ` + - ``No`` + * - Supports location :ref:`ⓘ ` + - ``No`` + * - Supports flags :ref:`ⓘ ` + - ``No`` + * - API identifier + - ``yaml`` + * - Supports read-only strings :ref:`ⓘ ` + - ``No`` + +.. AUTOGENERATED END: format-features yaml diff --git a/weblate/formats/base.py b/weblate/formats/base.py index e1f7795688f9..ee784d0074ff 100644 --- a/weblate/formats/base.py +++ b/weblate/formats/base.py @@ -37,6 +37,7 @@ from weblate.lang.models import Language, Plural from weblate.trans.file_format_params import FileFormatParams from weblate.trans.models import Component, Translation, Unit + from weblate.utils.state import StringState EXPAND_LANGS = {code[:2]: f"{code[:2]}_{code[3:].upper()}" for code in DEFAULT_LANGS} @@ -393,6 +394,12 @@ class TranslationFormat[S: InnerStore, U: InnerUnit, T: TranslationUnit]: has_multiple_strings: bool = False supports_explanation: bool = False supports_plural: bool = False + supports_descriptions: bool = False + supports_context: bool = False + supports_location: bool = False + supports_flags: bool = False + supports_read_only: bool = False + additional_states: tuple[StringState, ...] = () can_edit_base: bool = True strict_format_plurals: bool = False plural_preference: tuple[int, ...] | None = None diff --git a/weblate/formats/convert.py b/weblate/formats/convert.py index f9c8360c0a11..2ee1db56aa07 100644 --- a/weblate/formats/convert.py +++ b/weblate/formats/convert.py @@ -566,6 +566,7 @@ class WindowsRCFormat[S: pofile, U: pounit, T: ConvertPoUnit](ConvertFormat[S, U format_id = "rc" autoload = ("*.rc",) language_format = "bcp" + supports_descriptions: bool = True @staticmethod def needs_target_sync(template_store: TranslationFormat | None) -> bool: diff --git a/weblate/formats/management/__init__.py b/weblate/formats/management/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/weblate/formats/management/commands/__init__.py b/weblate/formats/management/commands/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/weblate/formats/management/commands/list_format_features.py b/weblate/formats/management/commands/list_format_features.py new file mode 100644 index 000000000000..f9eba28abed9 --- /dev/null +++ b/weblate/formats/management/commands/list_format_features.py @@ -0,0 +1,216 @@ +# Copyright © Michal Čihař +# +# SPDX-License-Identifier: GPL-3.0-or-later + +from itertools import chain +from typing import TYPE_CHECKING + +from django.core.management.base import CommandError + +from weblate.formats.models import FILE_FORMATS +from weblate.utils.management.base import DocGeneratorCommand + +if TYPE_CHECKING: + from pathlib import Path + +FORMAT_DOC_SNIPPETS_MERGES = { + "xliff": [ + "apple-xliff", + "plainxliff", + "poxliff", + ], + "xliff2": [ + "xliff2-placeables", + ], + "subtitles": [ + "ass", + "ssa", + "sub", + ], + "csv": [ + "csv-multi", + "csv-simple", + ], + "go-i18n-json": [ + "go-i18n-json-v2", + ], + "json": [ + "json-nested", + ], + "javaprop": [ + "xwiki-fullpage", + "xwiki-java-properties", + "xwiki-page-properties", + ], + "txt": [ + "mediawiki", + "dokuwiki", + ], +} + + +class Command(DocGeneratorCommand): + help = "Update format features snippets" + output_required = True + + def handle(self, *args, **options) -> None: + snippets_dir: Path = options["output"] + + if not snippets_dir.is_dir(): + msg = f"Error: {snippets_dir} must be a directory" + raise CommandError(msg) + + # ignore formats that are merged into other formats + ignore_list = set(chain(*FORMAT_DOC_SNIPPETS_MERGES.values())) + + for format_id, file_format in FILE_FORMATS.items(): + if format_id in ignore_list: + continue + file_path = snippets_dir / f"{format_id}-features.rst" + output = [] + output.extend( + [ + ".. list-table:: Supported features", + " :stub-columns: 1", + "", + ] + ) + + match file_format.monolingual: + case True: + linguality = "Monolingual" + case False: + linguality = "Bilingual" + case None: + linguality = "Both monolingual and bilingual" + case _: + msg = f"Invalid monolinguality: {file_format.monolingual}" + raise ValueError(msg) + + self.new_list_table_row( + output, + "File extensions", + [ + f".{extension}" + for extension in sorted(self.get_extensions(file_format)) + ], + ) + self.new_list_table_row(output, "Linguality", linguality, "bimono") + self.new_list_table_row( + output, + "Supports plural", + file_format.supports_plural, + "format-plurals", + ) + self.new_list_table_row( + output, + "Supports descriptions", + file_format.supports_descriptions, + "format-description", + ) + self.new_list_table_row( + output, + "Supports explanation", + file_format.supports_explanation, + "format-explanation", + ) + self.new_list_table_row( + output, + "Supports context", + file_format.supports_context, + "format-context", + ) + self.new_list_table_row( + output, + "Supports location", + file_format.supports_location, + "format-location", + ) + self.new_list_table_row( + output, + "Supports flags", + file_format.supports_flags, + "format-flags", + ) + self.new_list_table_row( + output, + "Additional states", + sorted([str(state.label) for state in file_format.additional_states]), + "format-states", + ) + api_identifiers = [file_format.format_id] + api_identifiers.extend( + FORMAT_DOC_SNIPPETS_MERGES.get(file_format.format_id, []) + ) + + self.new_list_table_row(output, "API identifier", sorted(api_identifiers)) + + self.new_list_table_row( + output, + "Supports read-only strings", + file_format.supports_read_only, + "read-only-strings", + ) + + if file_path.exists(): + lines = file_path.read_text(encoding="utf-8").splitlines() + else: + file_path.parent.mkdir(parents=True, exist_ok=True) + lines = [] + + start_marker, end_marker = self.autogenerated_markers( + f"format-features {format_id}" + ) + output = self.insert_markers(output, start_marker, end_marker) + lines = self.insert_content_in_lines( + output, + lines, + start_marker, + end_marker, + ) + lines.append("") + file_path.write_text("\n".join(lines), encoding="utf-8") + + def new_list_table_row( + self, + lines, + feature_name: str, + value: str | bool | list[str], + doc_link: str | None = "", + ) -> None: + if isinstance(value, bool): + value = "Yes" if value else "No" + + if isinstance(value, list): + value = ", ".join([f"``{item}``" for item in value]) + else: + value = f"``{value}``" + + if not value: + return + + if doc_link: + feature_name = f"{feature_name} :ref:`ⓘ <{doc_link}>`" + + lines.extend( + [ + f" * - {feature_name}", + f" - {value}", + ] + ) + + def get_extensions(self, file_format) -> set[str]: + try: + common_extensions = list(file_format.get_class().Extensions) + except AttributeError: + # non TTKitFormat formats + common_extensions = [] + common_extensions.append(file_format.extension()) + + if file_format.format_id in FORMAT_DOC_SNIPPETS_MERGES: + for similar_format in FORMAT_DOC_SNIPPETS_MERGES[file_format.format_id]: + common_extensions.extend( + self.get_extensions(FILE_FORMATS[similar_format]) + ) + + return set(common_extensions) diff --git a/weblate/formats/tests/test_commands.py b/weblate/formats/tests/test_commands.py new file mode 100644 index 000000000000..cc601dde2400 --- /dev/null +++ b/weblate/formats/tests/test_commands.py @@ -0,0 +1,31 @@ +# Copyright © Michal Čihař +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Test for management commands.""" + +import tempfile +from pathlib import Path + +from django.core.management import CommandError, call_command +from django.test import SimpleTestCase + + +class CommandsTest(SimpleTestCase): + def test_list_format_features(self) -> None: + + with self.assertRaisesRegex( + CommandError, "the following arguments are required: -o/--output" + ): + call_command("list_format_features") + + with ( + tempfile.NamedTemporaryFile(suffix=".rst", delete=False) as tmp_file, + self.assertRaisesRegex(CommandError, "must be a directory"), + ): + call_command("list_format_features", "-o", tmp_file.name) + + with tempfile.TemporaryDirectory() as tmp_dir: + call_command("list_format_features", "-o", tmp_dir) + php_features_path = Path(tmp_dir) / "php-features.rst" + self.assertTrue(php_features_path.exists()) diff --git a/weblate/formats/ttkit.py b/weblate/formats/ttkit.py index f349784d01c8..13affaff8714 100644 --- a/weblate/formats/ttkit.py +++ b/weblate/formats/ttkit.py @@ -50,7 +50,7 @@ from translate.storage.pypo import pofile, pounit from translate.storage.resx import RESXFile from translate.storage.tbx import tbxfile, tbxunit -from translate.storage.ts2 import tsfile, tsunit +from translate.storage.ts2 import tsfile from translate.storage.xliff import ID_SEPARATOR, Xliff1File, Xliff1Unit from translate.storage.xliff2 import Xliff2File, Xliff2Unit from translate.storage.xliff_common import XliffUnit as TranslateToolkitXliffUnit @@ -78,6 +78,7 @@ FUZZY_STATES, STATE_APPROVED, STATE_EMPTY, + STATE_FUZZY, STATE_READONLY, STATE_TRANSLATED, ) @@ -98,7 +99,6 @@ LOCATIONS_RE = re.compile(r"^([+-]|.*, [+-]|.*:[+-])") PO_DOCSTRING_LOCATION = re.compile(r":docstring of [a-zA-Z0-9._]+:[0-9]+") -SUPPORTS_FUZZY = (pounit, tsunit, csvunit) XLIFF_FUZZY_STATES = {"new", "needs-translation", "needs-adaptation", "needs-l10n"} @@ -163,7 +163,7 @@ def is_fuzzy(self, fallback=False): return False # Most of the formats do not support this, but they # happily return False - if isinstance(self.unit, SUPPORTS_FUZZY): + if STATE_FUZZY in self.parent.additional_states: return self.unit.isfuzzy() return fallback @@ -1250,6 +1250,11 @@ class BasePoFormat[S: pofile, U: pounit, T: BasePoUnit](TTKitFormat[S, U, T]): loader = pofile # type: ignore[assignment] plural_preference = None supports_plural: bool = True + supports_descriptions = True + supports_context = True + supports_location = True + supports_flags = True + additional_states = (STATE_FUZZY,) def get_plural(self, language: Language) -> Plural: """Return matching plural object.""" @@ -1417,6 +1422,10 @@ class TSFormat(TTKitFormat): set_context_bilingual = False supports_plural: bool = True plural_preference = (Plural.SOURCE_QT,) + supports_descriptions = True + supports_location = True + supports_flags = True + additional_states = (STATE_FUZZY,) class XliffFormat(TTKitFormat): @@ -1424,6 +1433,13 @@ class XliffFormat(TTKitFormat): name = gettext_lazy("XLIFF 1.2 translation file") format_id = "plainxliff" loader = Xliff1File + supports_plural = True + supports_descriptions = True + supports_context = True + supports_location = True + supports_flags = True + supports_read_only = True + additional_states = (STATE_FUZZY, STATE_APPROVED) autoload: tuple[str, ...] = ("*.xlf", "*.xliff") unit_class = XliffUnit language_format = "bcp" @@ -1547,6 +1563,7 @@ class StringsFormat(PropertiesBaseFormat): "utf-8": ("properties", "stringsutf8file"), "utf-16": ("properties", "stringsfile"), } + supports_descriptions = True @classmethod def get_new_translation(cls, encoding: str | None = None): @@ -1568,6 +1585,7 @@ class PropertiesFormat(PropertiesBaseFormat): empty_file_template = "\n" autoload: tuple[str, ...] = ("*.properties",) check_flags = ("auto-java-messageformat",) + supports_descriptions = True class JoomlaFormat(PropertiesBaseFormat): @@ -1578,6 +1596,8 @@ class JoomlaFormat(PropertiesBaseFormat): monolingual = True empty_file_template = "\n" autoload: tuple[str, ...] = ("*.ini",) + supports_descriptions: bool = True + supports_location: bool = True class GWTFormat(PropertiesBaseFormat): @@ -1594,6 +1614,8 @@ class GWTFormat(PropertiesBaseFormat): check_flags = ("auto-java-messageformat",) language_format = "linux" supports_plural: bool = True + supports_descriptions = True + monolingual = True class PhpFormat[S: phpfile, U: phpunit, T: PHPUnit](TTKitFormat[S, U, T]): @@ -1604,6 +1626,8 @@ class PhpFormat[S: phpfile, U: phpunit, T: PHPUnit](TTKitFormat[S, U, T]): empty_file_template = " str: @@ -1635,7 +1659,8 @@ class RESXFormat(TTKitFormat): empty_file_template = RESXFile.XMLskeleton autoload: tuple[str, ...] = ("*.resx",) language_format = "bcp" - supports_plural: bool = True + supports_descriptions: bool = True + supports_flags: bool = True store: RESXFile @@ -1659,6 +1684,10 @@ class AndroidFormat(TTKitFormat): ) strict_format_plurals: bool = True supports_plural: bool = True + supports_plurals = True + supports_descriptions = True + supports_flags = True + supports_read_only = True class MOKOFormat(AndroidFormat): @@ -1728,6 +1757,7 @@ class WebExtensionJSONFormat(JSONFormat): autoload: tuple[str, ...] = ("messages*.json",) unit_class = PlaceholdersJSONUnit supports_plural: bool = True + supports_descriptions: bool = True class I18NextFormat(JSONFormat): @@ -1756,6 +1786,7 @@ class GoI18JSONFormat(JSONFormat): autoload: tuple[str, ...] = () empty_file_template = "[]\n" supports_plural: bool = True + supports_descriptions = True class GoI18V2JSONFormat(JSONFormat): @@ -1765,6 +1796,7 @@ class GoI18V2JSONFormat(JSONFormat): loader = GoI18NV2JsonFile autoload: tuple[str, ...] = () supports_plural: bool = True + supports_descriptions = True class ARBFormat(JSONFormat): @@ -1775,6 +1807,8 @@ class ARBFormat(JSONFormat): autoload: tuple[str, ...] = ("*.arb",) unit_class = PlaceholdersJSONUnit check_flags = ("icu-message-format",) + supports_plural: bool = True + supports_descriptions = True class GoTextFormat(JSONFormat): @@ -1785,6 +1819,8 @@ class GoTextFormat(JSONFormat): autoload: tuple[str, ...] = () unit_class = PlaceholdersJSONUnit supports_plural: bool = True + supports_descriptions = True + supports_location = True class FormatJSFormat(JSONFormat): @@ -1854,6 +1890,10 @@ class CSVFormat[S: csvfile, U: csvunit, T: CSVUnit](TTKitFormat[S, U, T]): loader = ("csvl10n", "csvfile") unit_class = CSVUnit # type: ignore[assignment] autoload: tuple[str, ...] = ("*.csv",) + supports_descriptions: bool = True + supports_context: bool = True + supports_location: bool = True + additional_states = (STATE_FUZZY,) def __init__( self, @@ -2001,6 +2041,7 @@ class RubyYAMLFormat(YAMLFormat): loader = ("yaml", "RubyYAMLFile") autoload: tuple[str, ...] = ("*.ryml", "*.yml", "*.yaml") supports_plural: bool = True + monolingual = True class DTDFormat(TTKitFormat): @@ -2012,6 +2053,7 @@ class DTDFormat(TTKitFormat): unit_class = MonolingualSimpleUnit empty_file_template = "\n" can_add_unit: bool = False + monolingual = True @staticmethod def mimetype() -> str: @@ -2057,6 +2099,7 @@ class SubRipFormat(TTKitFormat): autoload: tuple[str, ...] = ("*.srt",) monolingual = True autoaddon: ClassVar[dict[str, dict[str, Any]]] = {"weblate.flags.same_edit": {}} + supports_location = True @staticmethod def mimetype() -> str: @@ -2096,6 +2139,7 @@ class FlatXMLFormat(TTKitFormat): monolingual = True unit_class = FlatXMLUnit empty_file_template = '\n' + supports_flags: bool = True def get_format_class_kwargs(self): return { @@ -2383,6 +2427,9 @@ class TBXFormat[S: tbxfile, U: tbxunit, T: TBXUnit](TTKitFormat[S, U, T]): use_settarget = True monolingual = False supports_explanation: bool = True + supports_descriptions = True + supports_flags = True + supports_context = True def __init__( self, @@ -2416,6 +2463,7 @@ class PropertiesMi18nFormat(PropertiesBaseFormat): language_format = "bcp_legacy" check_flags = ("es-format",) monolingual = True + supports_descriptions = True class CatkeysFormat[S: CatkeysFile, U: CatkeysUnit, T: TTKitUnit](TTKitFormat[S, U, T]): @@ -2511,6 +2559,8 @@ class FluentFormat(TTKitFormat): "ignore-xml-tags", "ignore-xml-invalid", ) + supports_descriptions = True + monolingual = True @staticmethod def mimetype() -> str: diff --git a/weblate/utils/management/base.py b/weblate/utils/management/base.py index c84343833a2a..cde53287833a 100644 --- a/weblate/utils/management/base.py +++ b/weblate/utils/management/base.py @@ -228,6 +228,7 @@ def handle(self, *args, **options) -> None: class DocGeneratorCommand(BaseCommand): sections: ClassVar[list[tuple[str, list[str]]]] = [] + output_required: bool = False def add_arguments(self, parser): parser.add_argument( @@ -236,7 +237,8 @@ def add_arguments(self, parser): dest="output", type=Path, default=None, - help="Optional output file path for the generated add-ons list", + required=self.output_required, + help="Optional output path for the generated documentation", ) def autogenerated_markers(self, name: str) -> tuple[str, str]: