From: Jussi S. <jus...@pp...> - 2006-09-25 18:35:50
|
Cullen Newsom kirjoitti: > First question, I would like to make a multilingual GUI that the user=20 > selects the language at runtime. I had a bit of trouble using variable= s=20 > =20 My approach may not be quite what you are looking for because it does=20 the language selection at application start time. It does not use locale=20 information. Instead the resource file to be used is given on the=20 starting command line. The application is here: http://personal.inet.fi/cool/operator/ATrickCardGameDownload.html and here is the description of how to use the Finnish and English=20 versions and what needs to be done to translate the application into Fren= ch: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ATrickCardGame comes with a resource file for both English and Finnish.=20 To start with the English user interface give: python ATrickCardGame.pyw ATrickCardGame.English.rsrc.py and with the Finnish UI give: python ATrickCardGame.pyw ATrickCardGame.Finnish.rsrc.py But what if you don't want English or Finnish, but let's say French.=20 Here's what you do: 1. Make a copy of the files EnglishAbout.txt EnglishHelp.txt as files named FrenchAbout.txt FrenchHelp.txt respectively and translate them into French. 2. Make a copy of the file ATrickCardGame.Finnish.rsrc.py as a new file named ATrickCardGame.French.rsrc.py 3. With the PythonCard Layout Editor translate every label, menutext etc. from Finnish to French. Every string in that file that you don't understand is in Finnish and must be translated. As a guide you can=20 use the file ATrickCardGame.English.rsrc.py, which gives you the corresponding=20 term in English. 4. Voil=E0, your French GUI: python ATrickCardGame.pyw ATrickCardGame.French.rsrc.py =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Cheers, Jussi Salmela |