I am writing a Sailfish application called Pigeon in C++ and QML, and want to include translations. I looked into the descriptions on I18n | Sailfish OS Documentation but don’t get it working.
When running the project, I get the following, and application is not deploying/starting on my device. Build is running fine
Updating ‘../Pigeon/translations/Pigeon.ts’…Found 15 source text(s) (15 new and 0 already existing)Updating ‘../Pigeon/translations/Pigeon.ts’…Found 15 source text(s) (0 new and 15 already existing)Updating ‘/home/ajonck/Sailfishprojects/build-Pigeon-SailfishOS_5_1_0_11_aarch64_in_Sailfish_SDK_Build_Engine-Debug/translations/Pigeon.qm’…Dropped 14 message(s) which had no ID.Generated 0 translation(s) (0 finished and 0 unfinished)
RPM build errors:error:
File not found: /home/deploy/installroot/usr/share/translations/.qm
File not found: /home/deploy/installroot/usr/share/translations/.qm
12:02:08: The process “/home/ajonck/SailfishOS/bin/sfdk” exited with code 1.
Error while building/deploying project Pigeon (kit: SailfishOS-5.1.0.11-aarch64 (in Sailfish SDK Build Engine))
When executing step "RPM Build"
I am also getting the message in QT Creator
The file Pigeon.ts has been changed on disk. Do you want to reload it.
I normally start coding by creating a template with SDK to avoid simple typos etc. By creating untitled1 with Sailfish SDK 3.13.5 gives pro-file slightly different than yours. Translations seem to work on Jolla C2 5.1.0.11 fine.
# The name of your application
TARGET = untitled1
CONFIG += sailfishapp
SOURCES += src/untitled1.cpp
DISTFILES += qml/untitled1.qml \
qml/cover/CoverPage.qml \
qml/pages/FirstPage.qml \
qml/pages/SecondPage.qml \
rpm/untitled1.changes.in \
rpm/untitled1.changes.run.in \
rpm/untitled1.spec \
translations/*.ts \
untitled1.desktop
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
# German translation is enabled as an example. If you aren't
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.