From 6b5622f44b32c6808f4de2456744f81391c24235 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 9 Feb 2024 12:48:04 +0100 Subject: Qt Linguist example: Enable building translations with pyside6-project Remove the use of the "translations" directory and make it a resource prefix instead. Adapt the tutorial accordingly. Pick-to: 6.6 6.5 Change-Id: I9b7da17b4aac6a1470f5105b33a6267c78e1c26b Reviewed-by: Cristian Maureira-Fredes --- .../pyside6/doc/tutorials/basictutorial/translations.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sources/pyside6/doc/tutorials/basictutorial') diff --git a/sources/pyside6/doc/tutorials/basictutorial/translations.rst b/sources/pyside6/doc/tutorials/basictutorial/translations.rst index 6ca403ba7..ce28cb5dc 100644 --- a/sources/pyside6/doc/tutorials/basictutorial/translations.rst +++ b/sources/pyside6/doc/tutorials/basictutorial/translations.rst @@ -59,8 +59,14 @@ the files are converted to a binary form (``.qm`` files): .. code-block:: bash - mkdir translations - pyside6-lrelease example_de.ts -qm translations/example_de.qm + pyside6-lrelease example_de.ts -qm example_de.qm + +``pyside6-project`` will build the ``.qm`` file automatically when +``.ts`` file(s) are given in the ``.pyproject`` file: + +.. code-block:: bash + + pyside6-project build . To avoid having to ship the ``.qm`` files, it is recommend to put them into a Qt resource file along with icons and other @@ -71,8 +77,8 @@ under ``:/translations``: .. code-block:: xml - - translations/example_de.qm + + example_de.qm -- cgit v1.2.3