From Paul.Divine at alcatel-lucent.fr Fri Apr 17 16:20:06 2009 From: Paul.Divine at alcatel-lucent.fr (DIVINE PAUL) Date: Fri, 17 Apr 2009 16:20:06 +0200 Subject: [I18n-sig] Python 3.0 Internationalization msgfmt.py on windows XP: TypeError: can't concat bytes to str Message-ID: 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 , 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 \n" "Language-Team: fr \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\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 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 = generate() File "C:\Python30\Tools\i18n\msgfmt.py", line 92, in generate output += 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin at v.loewis.de Sat Apr 18 01:20:16 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 18 Apr 2009 01:20:16 +0200 Subject: [I18n-sig] Python 3.0 Internationalization msgfmt.py on windows XP: TypeError: can't concat bytes to str In-Reply-To: References: Message-ID: <49E90EB0.60009@v.loewis.de> > What's wrong? I guess msgfmt.py doesn't work with Python 3. Please provide a bug report to bugs.python.org; better yet including a patch. Regards, Martin From pander at users.sourceforge.net Thu Apr 23 17:39:37 2009 From: pander at users.sourceforge.net (Pander) Date: Thu, 23 Apr 2009 17:39:37 +0200 Subject: [I18n-sig] Lookup of localised language name by ISO 639 language code Message-ID: <49F08BB9.3080706@users.sourceforge.net> Hi all, Does a module exist that can look up localised language names for ISO 639 language codes? If not, could one be constructed according to (sort of) the following specifications? 1) Look up a localised language name for an ISO 639-1 language code for a required parameter named code, providing the language code, and an optional parameter named lang, providing the output language code, which by default is set to 'en'. Example input and output would would be: iso6391name(code='en') => 'English' iso6391name(code='zu', lang='en') => 'Zulu' iso6391name(code='zu', lang='nl') => 'Zoeloe' iso6391name(code='nl', lang='en') => 'Dutch' 2) Reverse lookup of 1) from localised language to language code, e.g.: iso6391code(name='English') => 'en' iso6391code(name='Zulu', lang='en') => 'zu' iso6391code(name='Zoeloe', lang='nl') => 'zu' iso6391code(name='Dutch', lang='en') => 'nl' 3) Look up native language name for an ISO 639-1 language code for a required parameter named code, providing the language code. Example input and output would would be: iso6391native(code='en') => 'English' iso6391native(code='nl) => 'Nederlands' 4) Retrieving a tuple with all language codes. Example output would be: iso6391codes() => ('aa', 'ab', ..., 'zu') 5) Retrieving a tuple with all localised language names for an optional parameter named lang, providing the output language code, which by default is set to 'en'. Example input and output would be: iso6391names() => ('Afar', 'Abkhazian', ..., 'Zulu') iso6391names(lang='nl') => ('Afar', 'Abchazisch', ..., 'Zoeloe') 6), 7), 8), 9), 10) Something similar for ISO 639-2 language codes 11), 12), 13), 14), 15) Something similar for ISO 639-2 language codes sources: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes http://nl.wikipedia.org/wiki/Lijst_van_ISO_639-1-codes I have a very simple implementation for English and Dutch but figured that such a module should be available for all developers in all languages. Hence this request to build something from scratch in the Python localisation community. Please reply to this list for constructive feedback. Thanks, Pander