2007-07-17 04:36:16 +00:00
|
|
|
__________________________ Localization of DeSmuME _____________________________
|
|
|
|
|
|
|
|
Users and translators:
|
|
|
|
1) Supported UIs
|
2007-07-17 05:51:14 +00:00
|
|
|
2) Starting a new translation
|
2007-07-17 04:36:16 +00:00
|
|
|
3) Editors
|
|
|
|
4) Contact Us
|
|
|
|
|
|
|
|
Developpers:
|
|
|
|
5) Creating translation friendly strings (gtk-glade)
|
|
|
|
6) Updating the template (gtk-glade)
|
2007-07-19 06:41:50 +00:00
|
|
|
7) Integrating new translations
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
|
2007-07-17 04:36:16 +00:00
|
|
|
1 Supported UIs ________________________________________________________________
|
|
|
|
|
2007-08-11 19:23:45 +00:00
|
|
|
Although there are 4 UIs, only 3 currently support localization:
|
2008-04-01 04:59:52 +00:00
|
|
|
windows, gtk-glade, and Cocoa (Mac OS X).
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-17 05:51:14 +00:00
|
|
|
To translate DeSmuME, see "Starting a new translation" below.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
If you have created a new translation, or improved an existing one, please
|
|
|
|
send us your translation by getting in touch with us: see "Contact Us" below.
|
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
1.1 gtk-glade UI _____________________________________________________________
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Localization is done with gettext. gettext uses po files.
|
|
|
|
The po files are located in the po/ folder.
|
|
|
|
Note that there is one po file per language.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
To use the available translations, set up your environment properly.
|
|
|
|
e.g. under GNU/Linux you can verify that the value of your LANG variable.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
1.2 Windows UI ______________________________________________________________
|
2007-07-17 05:51:14 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Localization is located in one single file: src/windows/resources.rc .
|
2007-07-17 05:51:14 +00:00
|
|
|
|
2007-08-11 21:56:15 +00:00
|
|
|
1.3 Mac OS X (Cocoa) UI _____________________________________________________
|
2007-08-11 19:23:45 +00:00
|
|
|
|
2008-04-01 04:59:52 +00:00
|
|
|
Localization files are located within the application bundle (in Finder right
|
|
|
|
click on DeSmuME and select "Show Package Contents"). Within the
|
|
|
|
Contents/Resources folder there is a folder for each localization.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-17 05:51:14 +00:00
|
|
|
2 Starting a new translation ___________________________________________________
|
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
2.1 gtk-glade UI _____________________________________________________________
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Grab a copy of po/desmume.pot and rename it.
|
|
|
|
You can use the two letter iso code of the language as the filename
|
|
|
|
e.g. fr.po
|
|
|
|
or you can specify the country code as well
|
|
|
|
e.g. fr_CA.po
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Open the newly created file with an editor: see "Editors" below.
|
|
|
|
Translate the strings.
|
2007-07-17 05:51:14 +00:00
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
2.2 Windows UI _______________________________________________________________
|
2007-07-17 05:51:14 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Grab a copy of src/windows/resources.rc .
|
|
|
|
Create a section for your language by looking at another language e.g. french.
|
|
|
|
Translate the strings.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
2.3 Max OS X (Cocoa) UI ______________________________________________________
|
2007-08-11 19:23:45 +00:00
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
Copy and paste one of the localization folders mentioned in 1.3.
|
2007-08-11 19:23:45 +00:00
|
|
|
Rename the part before ".lproj" to the language of the translation.
|
|
|
|
Within your newly created folder edit "Localizable.strings".
|
2007-08-19 10:47:35 +00:00
|
|
|
|
2008-04-01 04:59:52 +00:00
|
|
|
The MainMenu.nib opaque folder also contains localization of the Application
|
|
|
|
menu, however since this is a standard menu in Mac OS X, for most languages
|
|
|
|
standard strings can be generated by Apple's Interface Builder.
|
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
The strings file should stay in UTF-16 encoding (UTF-8 or others may work,
|
|
|
|
but UTF-16 is preferred).
|
|
|
|
|
|
|
|
If your strings file has an error, no translated strings will show in DeSmuME.
|
|
|
|
|
|
|
|
Debugging the string file:
|
|
|
|
If you have Mac OS X developer tools installed, from the console you can type
|
|
|
|
"plutil FILE", replacing FILE with the name and path of the string file, and
|
2008-04-01 04:59:52 +00:00
|
|
|
it will tell you if there are any errors (and on what line).
|
2007-07-17 04:36:16 +00:00
|
|
|
|
|
|
|
3 Editors ______________________________________________________________________
|
|
|
|
|
|
|
|
You can use plain text editors but there are many po file editors.
|
|
|
|
Here are some recommanded po editors, in no particular order.
|
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
3.1 GNU/Linux ________________________________________________________________
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
- gtranslator: http://gtranslator.sourceforge.net/
|
|
|
|
- KBabel: http://kbabel.kde.org/
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
3.2 OSX ______________________________________________________________________
|
2007-07-18 00:24:34 +00:00
|
|
|
|
|
|
|
- LocFactory Editor:
|
|
|
|
http://www.triplespin.com/en/products/locfactoryeditor.html
|
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
3.3 All platforms ____________________________________________________________
|
2007-07-18 00:24:34 +00:00
|
|
|
|
|
|
|
- poEdit: http://www.poedit.net/
|
|
|
|
- OmegaT: http://www.omegat.org/omegat/omegat.html
|
|
|
|
- GNUEmacs/XEmacs/AquaEmacs with po-mode
|
|
|
|
- Vim with PO ftplugin
|
|
|
|
- Eclipse with gted
|
2007-07-17 04:36:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
4 Contact Us ___________________________________________________________________
|
|
|
|
|
2007-07-18 00:21:12 +00:00
|
|
|
As there isn't many translations so far, we're still asking you to get in touch
|
2007-07-17 04:36:16 +00:00
|
|
|
via the forum located at http://forums.desmume.org/ .
|
|
|
|
|
|
|
|
You can upload your translation files to your favorite sharing site and paste
|
|
|
|
the link in a post under General.
|
|
|
|
|
|
|
|
|
|
|
|
5 Creating translation friendly strings (gtk-glade) ____________________________
|
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
5.1 In the code ______________________________________________________________
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Make sure libintl.h is included and that _() is defined.
|
|
|
|
e.g. see src/gtk-glade/globals.h
|
|
|
|
Add the filename to po/POTFILES.in if it's not already there.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
Where you would use "my text", use _("my text").
|
|
|
|
For long strings, for translators' sanity, please do something like:
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
printf( _(" This is a\n\
|
2007-07-17 04:36:16 +00:00
|
|
|
very long text\n") );
|
|
|
|
|
2007-07-18 13:11:11 +00:00
|
|
|
5.2 Glade interface __________________________________________________________
|
2007-07-17 04:36:16 +00:00
|
|
|
|
2007-07-18 00:24:34 +00:00
|
|
|
You have nothing special to do aside from adding the filename to
|
|
|
|
po/POTFILES.in.
|
2007-07-17 04:36:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
6 Updating the template (gtk-glade) ____________________________________________
|
|
|
|
|
|
|
|
To update po/desmume.pot, move to the po/ folder and execute "make update-po".
|
2007-07-19 06:41:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
7 Integrating new translations
|
|
|
|
|
|
|
|
7.1 gtk-glade UI _____________________________________________________________
|
|
|
|
|
|
|
|
Add the new po file to po/ .
|
|
|
|
Add the new language to ALL_LINGUAS in configure.ac .
|
|
|
|
Regenerated the build files (./autogen.sh) and rebuild (./configure && make).
|
|
|
|
You can also add the language to po/LINGUAS (it's a convention? it has no effect).
|
|
|
|
|
|
|
|
7.2 Windows UI _______________________________________________________________
|
|
|
|
|
|
|
|
Update the src/windows/resource.rc .
|
|
|
|
Add the new language to to the list in src/windows/resource.h .
|
|
|
|
Rebuild.
|
2007-07-19 06:50:57 +00:00
|
|
|
|
2007-08-11 21:56:15 +00:00
|
|
|
7.3 Max OS X (Cocoa) UI ______________________________________________________________
|
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
After following the steps in 2.3, your translation is ready to go.
|
|
|
|
You can set the DeSmuME language one of three ways:
|
2007-08-11 21:56:15 +00:00
|
|
|
|
|
|
|
1) Set the system language (System Preferences -> International).
|
|
|
|
|
|
|
|
2) Right click on DeSmuME in Finder, select Get Info and disable the other translations.
|
|
|
|
|
2007-08-19 10:47:35 +00:00
|
|
|
3) From a command line, run the following line after replacing LANG with the language:
|
2007-08-11 21:56:15 +00:00
|
|
|
|
|
|
|
DeSmuME.app/Contents/MacOS/DeSmuME -AppleLanguages '<array><string>LANG</string></array>'
|
|
|
|
|
|
|
|
All of these methods require a restart of DeSmuME.
|