PDA

View Full Version : translation file issue (files not included in .ts with lupdate)



BigDams
21st September 2006, 10:06
Hello, i'm using Visual Studio 2005 with Qt integration 4.1.3
I'm facing a strange issue and i've found nothing to help me on the internet

When i run lupdate from Visual Studio (or from the command line), then i check the generated .ts file with qt linguist (qdict_fr.ts for exemple) and i see that i have 2 missing contexts... :confused:
As i'm only using tr() and that i didn't forget any QObject macro i don't understand.

Here are all the files that contain tr() (or translate("context","xxxx") for ui files)
and in red, the files that are missing in the .ts :

addeditdictionary.cpp & ui_addeditdictionary.h
addeditserver.cpp & ui_addeditserver.h
databasesmanager.cpp & ui_databasesmanager.h
dictindexfile.cpp
dictionary.cpp
dictionarymanager.cpp
dictsourcefile.cpp
qdict.cpp & ui_qdict.h (inherit QMainWindow)
server.cpp
servermanager.cpp
settings.cpp

it seems that theses missing files are not even parsed with lupdate (there is no error of course)

If someone had the same issue or have any idea about how to fix it...
thanks

here is the .pro file (the .pri file is well generated as well) :

TEMPLATE = app
TARGET = QDICT
DESTDIR = ../debug
QT += network
CONFIG += debug
INCLUDEPATH += ./GeneratedFiles \
./GeneratedFiles/Debug \
. \
./GeneratedFiles/debug \
./GeneratedFiles
DEPENDPATH += .
MOC_DIR += ./GeneratedFiles/debug
OBJECTS_DIR += debug
UI_DIR += ./GeneratedFiles

#Include file(s)
include(QDICT.pri)

#Translation files
TRANSLATIONS += Resources/locale/qdict_fr.ts \
Resources/locale/qdict_lt.ts

#Windows resource file
win32:RC_FILE = QDICT.rc

wysota
21st September 2006, 10:50
My guess is those files are not listed in SOURCES variable in your project file. Check that and rerun qmake if needed.

BigDams
21st September 2006, 11:11
Unfortunately, it is not that simple i fear :(
when i generate the pri file, i can see that those files are included in sources (and the program is compiled and works well).

here is the .pri file

# -----------------------------------------------------------
# This file is generated by the Qt Visual Studio Integration.
# -----------------------------------------------------------


#Header files
HEADERS += ./addeditdictionary.h \
./addeditserver.h \
./include/base64.h \
./include/data.h \
./databasesmanager.h \
./dictindexfile.h \
./dictionary.h \
./dictionarymanager.h \
./dictsourcefile.h \
./include/dictzip.h \
./qdict.h \
./server.h \
./servermanager.h \
./settings.h \
./include/zconf.h \
./include/zlib.h

#Source files
SOURCES += ./addeditdictionary.cpp \
./addeditserver.cpp \
./include/base64.cpp \
./include/data.cpp \
./databasesmanager.cpp \
./dictindexfile.cpp \
./dictionary.cpp \
./dictionarymanager.cpp \
./dictsourcefile.cpp \
./main.cpp \
./qdict.cpp \
./server.cpp \
./servermanager.cpp \
./settings.cpp

#Forms
FORMS += ./addeditdictionary.ui \
./addeditserver.ui \
./databasesmanager.ui \
./qdict.ui

#Resource file(s)
RESOURCES += resources_collection.qrc

wysota
21st September 2006, 11:31
Are tr() entries from those files mentioned in .ts files at all (even without proper context)?

BigDams
21st September 2006, 11:35
Are tr() entries from those files mentioned in .ts files at all (even without proper context)?
Not at all, i don't find any of them...so i get finally an uncomplete translated program which is not very nice.

BigDams
22nd September 2006, 09:04
:eek: Ok i finally fix the problem but don't ask me why this problem appeared...
I just created 2 new blank files, and i copied the text of the "corrupted" files into them, and now thoses new files are magically parsed with lupdate...
:crying: it is so stupid ! why did i choose to work in the computing world :D
but thanks anyway for your help ;)