Closed osmaczko closed 2 years ago
@osmaczko this is somewhat wrong; only Qt (and QTranslator) knows about the available UI languages, and you can query such list with Qt.locale().uiLanguages
(see https://doc.qt.io/qt-5/qml-qtqml-locale.html#uiLanguages-prop). No need to build the model; scanning *.ts
files would be equally wrong, you want the *.qm
files, and those better be bundled in the qrc resource file when compiling.
@osmaczko this is somewhat wrong; only Qt (and QTranslator) knows about the available UI languages, and you can query such list with
Qt.locale().uiLanguages
(see https://doc.qt.io/qt-5/qml-qtqml-locale.html#uiLanguages-prop). No need to build the model; scanning*.ts
files would be equally wrong, you want the*.qm
files, and those better be bundled in the qrc resource file when compiling.
We still need to build the model, because we need other properties.
EDIT:
I agree that scanning/listing
We still need to scan *.ts
files can be simplified to QLocale::uiLanguages()
thanks to https://doc.qt.io/qt-6/qtranslator.html#load (description updated)*.qm
files because QLocale::uiLanguages()
only returns system langauges.
Description
Currently, the language model is created in
LanguageStore.qml
. Instead, it should be made by the backend: https://github.com/status-im/status-desktop/pull/5853#pullrequestreview-981841672Motivation
Target languages are driven by the Lokalise platform now. The app should be able to auto-adapt to added/removed target languages or the adaptation should require as least code as possible.
Acceptance criteria
qml_*.qm
filesinitializeLanguageModel
is removed