qt module: fix error message typo, translation qresource accepts qm not ts

Fixes #7925
pull/8164/head
Eli Schwartz 4 years ago committed by Nirbheek Chauhan
parent ab4373855f
commit d38ef1d2e6
  1. 3
      docs/markdown/Qt5-module.md
  2. 2
      mesonbuild/modules/qt.py

@ -79,7 +79,8 @@ executable('myprog', 'main.cpp', 'myclass.cpp', moc_files,
``` ```
Sometimes, translations are embedded inside the binary using qresource files. Sometimes, translations are embedded inside the binary using qresource files.
In this case the ts files do not need to be explicitly listed. For example: In this case the ts files do not need to be explicitly listed, but will be
inferred from the built qm files listed in the qresource file. For example:
```meson ```meson
qt5 = import('qt5') qt5 = import('qt5')

@ -236,7 +236,7 @@ class QtBaseModule(ExtensionModule):
if c.endswith('.qm'): if c.endswith('.qm'):
ts_files.append(c.rstrip('.qm')+'.ts') ts_files.append(c.rstrip('.qm')+'.ts')
else: else:
raise MesonException('qt.compile_translations: qresource can only contain ts files, found {}'.format(c)) raise MesonException('qt.compile_translations: qresource can only contain qm files, found {}'.format(c))
results = self.preprocess(state, [], {'qresources': qresource, 'rcc_extra_arguments': kwargs.get('rcc_extra_arguments', [])}) results = self.preprocess(state, [], {'qresources': qresource, 'rcc_extra_arguments': kwargs.get('rcc_extra_arguments', [])})
self._detect_tools(state.environment, kwargs.get('method', 'auto')) self._detect_tools(state.environment, kwargs.get('method', 'auto'))
translations = [] translations = []

Loading…
Cancel
Save