This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 158606

Summary: better support for Qt translations
Product: cnd Reporter: Alexey Vladykin <alexey_vladykin>
Component: ProjectAssignee: issues@cnd <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Alexey Vladykin 2009-02-16 13:19:35 UTC
It is possible to create new Qt translation (*.ts) file and add it to Qt project. But neither lupdate, nor lrelease are
automatically invoked to actually do something with these files.

Usual workflow for translations (outside NetBeans):
1. Create new *.ts file, add it to TRANSLATIONS variable in Qt project file.
2. Run lupdate, which extracts translatable strings from sources and writes them to *.ts files.
3. Edit *.ts files with Qt Linguist.
4. Run lrelease, which compiles *.ts files into *.qm files. *.qm files can be used by Qt program.

NetBeans supports steps 1 and 3, but ignores 2 and 4.
Comment 1 Alexey Vladykin 2009-02-17 10:38:13 UTC
Context menu of *.ts file should include items:
1. Update this file
2. Update all translation files
3. Compile this file
4. Compile all translation files

1 and 2 invoke lupdate, 3 and 4 invoke lrelease.
Also lrelease should be invoked during build by default. There should be an option in project options to turn it off.
Comment 2 sarigalin 2014-01-22 08:34:04 UTC
I have a temporary solution for step 2,4 where Netbeans must update *.ts files and also generate *.qm files:

1-First of all you must Add your translation to project: Add New : Qt Translation file. after that nbproject/qt_Debug.pro must include your new empty translation file in TRANSLATION+=

2-open "Makefile" under "Important Files" of project
3- goto build section where you see this:

# build
build: .build-post

.build-pre:
# Add your pre 'build' code here...

.build-post: .build-impl
# Add your post 'build' code here...

4- replace that sections with these ones:

TEMPRO=.tmepqt.pro
# build
build: .build-post

.build-pre: nbproject/qt-${CONF}.pro
	cat nbproject/qt-${CONF}.pro > ${TEMPRO}
	lupdate ${TEMPRO}
	lrelease ${TEMPRO}
	rm ${TEMPRO}
# Add your pre 'build' code here...  

.build-post: .build-impl
# Add your post 'build' code here...