Localisation, using Locale class

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@113 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-12 16:09:05 +00:00
parent c2a03bc445
commit ca42f31ccc
24 changed files with 540 additions and 40 deletions
+51
View File
@@ -0,0 +1,51 @@
//+----------------------------------------------------------------------------+
//| Description: Magic Set Editor - Program to make Magic (tm) cards |
//| Copyright: (C) 2001 - 2006 Twan van Laarhoven |
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_DATA_LOCALE
#define HEADER_DATA_LOCALE
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include <util/locale.hpp>
#include <util/reflect.hpp>
#include <util/io/package.hpp>
DECLARE_POINTER_TYPE(Locale);
DECLARE_POINTER_TYPE(GameLocale);
// ----------------------------------------------------------------------------- : Locale class
/// Translations of the texts of a game
class GameLocale {
public:
map<String,String> translations;
DECLARE_REFLECTION();
};
/// A collection of translations of messages
class Locale : public Packaged {
public:
/// Name of this locale
String full_name;
/// Translations of UI strings in each category
map<String,String> translations[LOCALE_CAT_MAX];
/// Translations of game specific texts, by game name
map<String,GameLocaleP> game_translations;
/// Open a locale with the given name
static LocaleP byName(const String& name);
protected:
String typeName() const;
DECLARE_REFLECTION();
};
/// The global locale object
extern LocaleP the_locale;
// ----------------------------------------------------------------------------- : EOF
#endif