Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template< struct T >
- class StringMap
- {
- public:
- static bool LoadFromFile( const std::string& filename )
- {
- // Probably load from the format:
- // key=value
- // With some way to put multiple lines in one string.
- }
- static std::string GetString( const std::string& str )
- {
- return strings[ str ];
- }
- private:
- StringMap() = delete;
- ~StringMap() = delete;
- static std::map< std::string, std::string > strings;
- };
- struct Localization_Def {};
- typedef StringMap< Localization_Def > Localization;
- AlertUser( Localization::GetString( "message.beat_game" ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement