|
From: Fredrik K. <sci...@us...> - 2010-08-29 19:39:17
|
Module: performous
Branch: master
Commit: dda8d2b20c17edd548ef5d2ef1a585d83e0ee015
Author: Fredrik Klasson <fr...@li...>
Date: Sun Aug 29 21:38:43 2010 +0200
[+] I18N of XML locale blocks. Now the configuration UI should be translatable
---
game/screen_configuration.cc | 7 ++++---
lang/README | 26 +++++++++++++++++++++++---
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/game/screen_configuration.cc b/game/screen_configuration.cc
index e61ecf3..e9fc8ac 100644
--- a/game/screen_configuration.cc
+++ b/game/screen_configuration.cc
@@ -4,6 +4,7 @@
#include "joystick.hh"
#include "theme.hh"
#include "audio.hh"
+#include "i18n.hh"
ScreenConfiguration::ScreenConfiguration(std::string const& name, Audio& audio): Screen(name), m_audio(audio), selected() {
@@ -48,19 +49,19 @@ void ScreenConfiguration::draw() {
theme->bg.draw();
if (!configuration.empty()) {
ConfigItem const& ci = config[configuration[selected]];
- theme->item.draw(ci.getShortDesc());
+ theme->item.draw(_(ci.getShortDesc().c_str()));
theme->value.draw(ci.getValue());
// Key help
theme->short_comment_bg.dimensions.fixedHeight(0.025);
theme->short_comment_bg.dimensions.right(-0.04).screenBottom(-0.054);
theme->short_comment_bg.draw();
theme->short_comment.dimensions.left(-0.48).screenBottom(-0.067);
- theme->short_comment.draw("Ctrl + S to save, Ctrl + R to reset defaults");
+ theme->short_comment.draw(_("Ctrl + S to save, Ctrl + R to reset defaults"));
// Long description
theme->comment_bg.dimensions.middle().screenBottom(-0.01);
theme->comment_bg.draw();
theme->comment.dimensions.left(-0.48).screenBottom(-0.028);
- theme->comment.draw(ci.getLongDesc());
+ theme->comment.draw(_(ci.getLongDesc().c_str()));
}
}
diff --git a/lang/README b/lang/README
index 87652ad..7916afc 100644
--- a/lang/README
+++ b/lang/README
@@ -1,21 +1,41 @@
To add new languages:
Download POEdit (http://www.poedit.net/)
+
+Creating the catalog
+--------------------
1. Start POEdit
2. Click File -> New Catalog
3. Enter a project name (performous)
4. Click the Paths tab at the top
5. Click the New Item icon (second one, looks like a little square)
- 6. Enter the path to the directory containing your plugin file ("." tells POEdit to scan the directory that you will save the file to, usually only need to include ../game), press enter
+ 6. Enter the path to the directory containing your plug-in file ("." tells POEdit to scan the directory that you will save the file to, usually only need to include ../game and ../data), press enter
7. Click the Keywords tab at the top
8. Click the New Item icon
9. Enter _ (that's underscore), press enter
12. Click Okay
13. Choose a name for your .po file (performous)
-
+
REMEMBER TO SAVE WITH YOU LOCALE NAME
Example for English:
en.po
-Thanks to guide at http://codex.wordpress.org/User:Skippy/Creating_POT_Files
\ No newline at end of file
+Configuring the performous XML parser
+-------------------------------------
+These steps enable translation of the XML locate bits.
+ 1. Click Edit -> Preferences
+ 2. Click the Parsers tab
+ 3. Click the New button and fill out the form like this:
+ Language: Performous XML
+ List of extensions: *.xml
+ Parser command: $SOURCE_ROOT/tools/scripts/xml_gettext.sh %o %C %F
+ An item in keywords list:
+ An item in input files list: %f
+ Source code charset: %c
+ Where $SOURCE_ROOT is the path to the performous sources root.
+ 4. Click Okay
+
+Acknowledgements
+--------------
+Thanks to guide at http://codex.wordpress.org/User:Skippy/Creating_POT_Files
|