nicer options for defaults in localization tr() functions

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@808 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-01-01 16:06:58 +00:00
parent f0be49c2e4
commit ed060aeb04
9 changed files with 54 additions and 72 deletions
+11 -11
View File
@@ -39,26 +39,26 @@ enum LocaleCategory
, LOCALE_CAT_MAX
};
typedef String (*DefaultLocaleFun)(const String&);
/// Return the input and issue a warning
String warn_and_identity(const String&);
/// Translate 'key' in the category 'cat' using the current locale
String tr(LocaleCategory cat, const String& key);
String tr(LocaleCategory cat, const String& key, DefaultLocaleFun def = warn_and_identity);
/// Translate 'key' in the for a Game using the current locale
String tr(const Game&, const String& key);
String tr(const Game&, const String& key, DefaultLocaleFun def);
/// Translate 'key' in the for a StyleSheet using the current locale
String tr(const StyleSheet&, const String& key);
String tr(const StyleSheet&, const String& key, DefaultLocaleFun def);
/// Translate 'key' in the for a SymbolFont using the current locale
String tr(const SymbolFont&, const String& key);
String tr(const SymbolFont&, const String& key, DefaultLocaleFun def);
/// Translate 'key' in the for a Game using the current locale
/** If the key is not found, use the default value */
String tr(const Game&, const String& key, const String& def);
String tr(const Game&, const String& subcat, const String& key, DefaultLocaleFun def);
/// Translate 'key' in the for a StyleSheet using the current locale
/** If the key is not found, use the default value */
String tr(const StyleSheet&, const String& key, const String& def);
String tr(const StyleSheet&, const String& subcat, const String& key, DefaultLocaleFun def);
/// Translate 'key' in the for a SymbolFont using the current locale
/** If the key is not found, use the default value */
String tr(const SymbolFont&, const String& key, const String& def);
String tr(const SymbolFont&, const String& subcat, const String& key, DefaultLocaleFun def);
/// A localized string for menus
#define _MENU_(s) tr(LOCALE_CAT_MENU, _(s))