[PyQt] trUtf8 and pylupdate

alban.minassian alban.minassian at free.fr
Mon Jan 21 12:33:36 GMT 2008


Hello
(sorry for my bad english)
 
I code in Unicode (Scite editor)
Pylupdate4.exe displays this error:
Test.py: 21: Non-ASCII character string detected in trUtf8

If there was any accented characters, it works!
If there is a Unicode character, I have this message pylupdate4, it is 
displayed in linguits.exe but in the end the message is not translated.

 
I do not understand is that happens.
Thanks for your help.
Alban
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_en.ts
Type: text/xml
Size: 543 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080121/09fdc027/test_en.xml
-------------- next part --------------
CODECFORTR = UTF-8
CODECFORSRC = UTF-8
SOURCES += test.py
TRANSLATIONS += test_en.ts
-------------- next part --------------
# -*- coding: utf-8 -*-
#!/usr/bin/env python

import sys, time
from PyQt4 import QtCore, QtGui

class MainWindow( QtGui.QDialog ):
	
	def __init__(self, parent=None):
		super( QtGui.QDialog, self ).__init__(parent)
		
		qtTranslator = QtCore.QTranslator()
		if qtTranslator.load ( "test_en" ) : 
			QtGui.qApp.installTranslator( qtTranslator )
		else :
			print "-- error load .qm"
			
		self.w1 = QtGui.QLabel(self)
		varMessage = self.trUtf8( """Vous etes. a bientot.""" ) # OK, if no 
		self.w1.setText( varMessage ) 
		
		self.w2 = QtGui.QLabel(self)
		varMessage = self.trUtf8( """Vous êtes. à bientôt.""" )
		self.w2.setText( varMessage ) 
		
		buttonLayout = QtGui.QHBoxLayout(self)
		buttonLayout.addWidget(self.w1)
		buttonLayout.addWidget(self.w2)
		
		
if __name__ == "__main__":
	app = QtGui.QApplication(sys.argv)
	mainwindow = MainWindow()
	mainwindow.show()
	sys.exit(app.exec_())
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_en.qm
Type: application/octet-stream
Size: 215 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20080121/09fdc027/test_en.obj


More information about the PyQt mailing list