Python 3.0 Internationalization msgfmt.py on windows XP: TypeError: can't concat bytes to str
"DIVINE PAUL" <[email protected]> Fri, 17 Apr 2009 16:20:06 +0200
| Newsgroups | gmane.comp.python.internationalization |
|---|---|
| Message-ID | <E84C901545FD2B4BB4A6E07C2C544D8F0380BCCD@FRVELSMBS14.ad2.ad.alcatel.com> |
This is a multi-part message in MIME format. --===============0217526850== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C9BF67.9BAB3064" This is a multi-part message in MIME format. ------_=_NextPart_001_01C9BF67.9BAB3064 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, The file C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAGES\multilingue app.po contains # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR ORGANIZATION # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2009-04-17 10:08+Romance Daylight Time\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: fr <[email protected]>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=3DCHARSET\n" "Content-Transfer-Encoding: ENCODING\n" "Generated-By: pygettext.py 1.5\n" #: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85 msgid "albatross" msgstr "albatrosse" #: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85 msgid "mollusk" msgstr "mollosque" #: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85 msgid "python" msgstr "python" #: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85 msgid "rat" msgstr "python" The script msgfmt.py has the following result C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAGES>c:\python30 \python C:\Python30\Tools\i18n\msgfmt.py multilingueapp.po Traceback (most recent call last): File "C:\Python30\Tools\i18n\msgfmt.py", line 202, in <module> main() File "C:\Python30\Tools\i18n\msgfmt.py", line 198, in main make(filename, outfile) File "C:\Python30\Tools\i18n\msgfmt.py", line 165, in make output =3D generate() File "C:\Python30\Tools\i18n\msgfmt.py", line 92, in generate output +=3D ids TypeError: can't concat bytes to str What's wrong? Where to find a complete example of internationalization, with change of lang on the fly. In advance, thanks for your help. Paul ------_=_NextPart_001_01C9BF67.9BAB3064 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 6.5.7652.24"> <TITLE>Python 3.0 Internationalization msgfmt.py on windows XP: = TypeError: can't concat bytes to str</TITLE> </HEAD> <BODY> <!-- Converted from text/rtf format --> <P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">The file</FONT> </P> <P><FONT SIZE=3D2 = FACE=3D"Arial">C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAG= ES\multilingueapp.po</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">contains</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial"># SOME DESCRIPTIVE TITLE.</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"># Copyright (C) YEAR = ORGANIZATION</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"># FIRST AUTHOR <EMAIL@ADDRESS>, = YEAR.</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">#</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgid ""</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr ""</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Project-Id-Version: PACKAGE = VERSION\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"POT-Creation-Date: 2009-04-17 = 10:08+Romance Daylight Time\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"PO-Revision-Date: YEAR-MO-DA = HO:MI+ZONE\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Last-Translator: FULL NAME = <EMAIL@ADDRESS>\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Language-Team: fr = <[email protected]>\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"MIME-Version: 1.0\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Content-Type: text/plain; = charset=3DCHARSET\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Content-Transfer-Encoding: = ENCODING\n"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">"Generated-By: pygettext.py = 1.5\n"</FONT> </P> <BR> <P><FONT SIZE=3D2 FACE=3D"Arial">#: = C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgid "albatross"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr "albatrosse"</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">#: = C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgid "mollusk"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr "mollosque"</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">#: = C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgid "python"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr "python"</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">#: = C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgid "rat"</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr "python"</FONT> </P> <BR> <BR> <P><FONT SIZE=3D2 FACE=3D"Arial">The script msgfmt.py has the following = result</FONT> </P> <BR> <P><FONT SIZE=3D2 = FACE=3D"Arial">C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAG= ES>c:\python30\python C:\Python30\Tools\i18n\msgfmt.py = multilingueapp.po</FONT></P> <P><FONT SIZE=3D2 FACE=3D"Arial">Traceback (most recent call = last):</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> File = "C:\Python30\Tools\i18n\msgfmt.py", line 202, in = <module></FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> main()</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> File = "C:\Python30\Tools\i18n\msgfmt.py", line 198, in main</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> make(filename, = outfile)</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> File = "C:\Python30\Tools\i18n\msgfmt.py", line 165, in make</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> output =3D = generate()</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> File = "C:\Python30\Tools\i18n\msgfmt.py", line 92, in = generate</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial"> output +=3D = ids</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">TypeError: can't concat bytes to = str</FONT> </P> <BR> <P><FONT SIZE=3D2 FACE=3D"Arial">What's wrong?</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">Where to find a complete example of = internationalization, with change of lang on the fly.</FONT> </P> <P><FONT SIZE=3D2 FACE=3D"Arial">In advance, thanks for your = help.</FONT> <BR><FONT SIZE=3D2 FACE=3D"Arial">Paul</FONT> </P> </BODY> </HTML> ------_=_NextPart_001_01C9BF67.9BAB3064-- --===============0217526850== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ I18n-sig mailing list [email protected] http://mail.python.org/mailman/listinfo/i18n-sig --===============0217526850==--