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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="en">
<defaultcodec></defaultcodec>
<context>
    <name>MainWindow</name>
    <message>
        <location filename="test.py" line="18"/>
        <source>Vous etes. a bientot.</source>
        <translation>You are. Soon.</translation>
    </message>
    <message encoding="UTF-8">
        <location filename="test.py" line="22"/>
        <source>Vous �tes. � bient�t.</source>
        <translation>You are. Soon.</translation>
    </message>
</context>
</TS>
CODECFORTR = UTF-8
CODECFORSRC = UTF-8
SOURCES += test.py
TRANSLATIONS += test_en.ts
# -*- 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_())

Attachment: test_en.qm
Description: Binary data

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to