Localization , app configs etc

well it is both qml, c++

i try to get tasklist running and have issues with localization of the tasklist.

first of all:
in pro file ibuse: sailfishapp_i18n
tasklist uses: CONFIG += sailfishapp_i18n_idbased

what is the difference between those two ?
in the docs i did find this:

In your main .pro file, add
CONFIG += sailfishapp_i18n
If you use id based translations also add:
CONFIG += sailfishapp_i18n_idbased

does that mean i need both statements ?

second:
i use
TRANSLATIONS += which converts ts files to qm and deploys them too

tasklist does:

localization.files = translations/*
localization.path = /usr/share/$${TARGET}/localization
INSTALLS += localization

this actually does deploy them but not convert them. so it seems a build step is missing here, that would do the conversion

I do use qsTr and tasklist does use qsTrId but imho the only difference is here the ts file. whether the key as an id or the english or technical english so to say.
so i did hope that just by get the deployment fixed, translation would work.
well it does not.

cause finally:
Tasklist is creating its own translator
defaultTranslator.load(“en_US”, SailfishApp::pathTo(QString(“localization”)).toLocalFile());

a lot of qmake, make and rpm mystery here

and one more:
if i use
CONFIG += sailfishapp_i18n_idbased
alone or in combination with

CONFIG += sailfishapp_i18n

no translation files get deployed


with CONFIG += sailfishapp_i18n only they do but …

Have you read I18n | Sailfish OS Documentation ? It might be a bit out of date, but it should give you some basic understanding how the lupdate/lrelease tools work.

yes i know it, i do cite it actually

and it does not explain why my apps do work but tasklist not.

or at least why filez are not even deployed

Well, the documentation quite clearly instructs you to use lrelease for generating the qm files. I was quite sure this was the “build step missing” which you were wondering. But your question is so vague that it’s quite hard to give any definite answers, that’s why I figured it’s best to just guide you towards the documentation.

Hello vige,
thank you for your time.
actually not, i was looking only here: libsailfishapp docs - Sailfish OS
your link is better.
Thanks !

sick of qmake black magic. i’m giving up.
tasklist without dropbox would be buildable and functionable but i have now wasted hours of my free time on that and do not use it neither

i can not let it go:

this:
TRANSLATIONS += some-other-folder-then-translations/harbour-tasklist_ca.ts

WILL NOT TRIGGER QM GENERATION
highly surprising and imho not documented, that the folder has to be called translations too.

i am now using TRANSLATIONS += to generate qm files and this

localization.files = $$OUT_PWD/translations/*.qm
localization.path = /usr/share/$${TARGET}/localization
INSTALLS += localization

to deploy them to localization subfolder as expected by taskist code.

That would indeed be surprising, if that was true. However, I have several projects on my hard drive, which have the translation files placed elsewhere. And just to be sure, I just created a test project, using the app template from SDK, just renaming the ‘translations’ folder to ‘kaannokset’ and modifying the .pro file accordingly. The .qm file was still generated and ended up in the package. So the problem lies somewhere else. But then again, if it now works for you, the translation files being in translations folder, maybe you should just follow the “if it ain’t broken, don’t fix it” rule… :slight_smile:

the only difference i can see is that in my projects the naming pattern is:
harbour-sailkick-de.ts

while here its is harbour-tasklist_de_DE.ts

so we have a _ between app name and localization identifier.
but yes it works