Empty .ts file after lupdate
-
Maybe you have hit the old qmake/ lupdate bug: it does not send QML files to lupdate.
Add this in your .pro file:
@
hack_for_lupdate { # or any other text - it does not matter.
SOURCES += your/qml/files.qml
}
@ -
Whwn building the project, qmake will completely ignore it. lupdate, however will now treat your QML files as real source files: and so it will parse them in search for translatable strings.
I think this bug was fixed in Qt5, probably also in recent Qt 4 versions (4.8.x).
-
It's problem becouse I use QT5. Qt Creator 2.5.0 Based on Qt 4.8.2 (64 bit).
Another problem is that I can't build this project on my computer(compiler problem with listing but will be solved in couple days).
My project file:TEMPLATE = lib
include(../smarteyeradar.pri)
unix:DEFINES += _LINUX
_x86
BOOST_THREAD_USE_LIBwin32:QMAKE_CXXFLAGS = -Zc:wchar_t
QT += opengl gui core declarative sql network
DEFINES += GUI_REVISION=\"$(REVISION)\"
TARGET = gui-$(REVISION)
unix:QMAKE_POST_LINK += ln -s -f $(TARGET) $$DESTDIR/libgui.a
CONFIG += static
HEADERS +=
headers_files.hSOURCES +=
files.cppRESOURCES += resources.qrc
hack_for_lupdate{
OTHER_FILES +=
\qml\qml_files.qml
}
TRANSLATIONS = gui3.tsIs it right? Becouse it doesn't work.
-
If you only have one QML file and it's path is "\qml\qml_files.qml", then yes - you just need to change that into SOURCES and not OTHER_FILES. Also, Qt expects you to use Unix paths (forward slashes "/"). Lastly, QtQuick1 (devlarative) module is deprecated in Qt5.2. You might consider porting to QtQuick2.
However, I don't see QMLFILES variable anywhere in this listing. I guess you need to create a small example application and see if it works there, then go over your config slowly and see what is wrong.
-
Project is much bigger but I don't want you to scroll all of this files thats why I call him "qml_filles.qml". All of files I put between {}.
Now it looks:
TEMPLATE = libinclude(../smarteyeradar.pri)
unix:DEFINES += _LINUX \ _x86 \ BOOST_THREAD_USE_LIB
win32:QMAKE_CXXFLAGS = -Zc:wchar_t
QT += opengl gui core declarative sql network
DEFINES += GUI_REVISION=\\”$(REVISION)\\”
TARGET = gui-$(REVISION)
unix:QMAKE_POST_LINK += ln -s -f $(TARGET) $$DESTDIR/libgui.a
CONFIG += static
HEADERS += headers_files.h
SOURCES += files.cpp
RESOURCES += resources.qrc
hack_for_lupdate{
OTHER_FILES +=
/qml/qml_files.qml
}
TRANSLATIONS = gui3.tsIt is still not working.
-
I got some progress but... When I use lupdate (even with -recursive) gui.pro the .ts file is empty. I tried to create the .ts file with one qml file and it's ok, the file is created.
What's wrong when I want to make the ts from all project file where are qml files...The problem is that I haven't got in my file.pro SOURCES qml files with strings. QT locates those files in "OTHER FILES" and lupdate doesn't see them. I tried put them into SOURCES and it's ok but project doesn't compiling.
Solutions:
- How can I tell lupdate to translate "OTHER FILES"??
- Solving the problem with compiling
PS: -recursive does not help...
PLZ help