Changeset 3370 for code/trunk/src/core/Language.h
- Timestamp:
- Jul 30, 2009, 2:10:44 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/resource (added) merged: 3328,3336-3340,3342-3350,3352-3366
- Property svn:mergeinfo changed
-
code/trunk/src/core/Language.h
r3280 r3370 37 37 Usage: 38 38 - Set the entry with the default string: 39 Language::get Language()->addEntry("label of the entry", "the string to translate");39 Language::getInstance()->addEntry("label of the entry", "the string to translate"); 40 40 41 41 - Get the localisation of the entry in the configured language: 42 std::cout << Language::get Language()->getLocalisation("name of the entry") << std::endl;42 std::cout << Language::getInstance()->getLocalisation("name of the entry") << std::endl; 43 43 */ 44 44 … … 51 51 #include <string> 52 52 #include <cassert> 53 #include "util/Singleton.h" 53 54 54 55 #define AddLanguageEntry(label, fallbackstring) \ 55 orxonox::Language::get Language().addEntry(label, fallbackstring)56 orxonox::Language::getInstance().addEntry(label, fallbackstring) 56 57 57 58 #define GetLocalisation(label) \ 58 orxonox::Language::get Language().getLocalisation(label)59 orxonox::Language::getInstance().getLocalisation(label) 59 60 60 61 … … 112 113 // ############################### 113 114 //! The Language class manges the language files and entries and stores the LanguageEntry objects in a map. 114 class _CoreExport Language 115 class _CoreExport Language : public Singleton<Language> 115 116 { 117 friend class Singleton<Language>; 116 118 friend class CoreConfiguration; 117 119 … … 120 122 ~Language(); 121 123 122 static Language& getLanguage() { assert(singletonRef_s); return *singletonRef_s; }123 124 void addEntry(const LanguageEntryLabel& label, const std::string& entry); 124 125 const std::string& getLocalisation(const LanguageEntryLabel& label) const; … … 137 138 std::map<std::string, LanguageEntry*> languageEntries_; //!< A map to store all LanguageEntry objects and their labels 138 139 139 static Language* singleton Ref_s;140 static Language* singletonPtr_s; 140 141 }; 141 142 }
Note: See TracChangeset
for help on using the changeset viewer.