実行すると、qml ファイルのlupdate
どれも認識されません。qsTr
結果の .ts ファイルには、翻訳コンテキストが含まれていません。
$ lupdate -verbose App.pro
Updating 'translations/en.ts'...
Found 0 source text(s) (0 new and 0 already existing)
プロジェクトを正しく設定する必要があります。
OTHER_FILES += \
content/main.qml
TRANSLATIONS += \
translations/en.ts
特にmain.qmlでは:
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Open")
onTriggered: Qt.quit();
}
}
Menu {
title: qsTr("...")
MenuItem {
text: qsTr("About")
onTriggered: {
aboutApplicationDialog.open()
}
}
}
}