Created
April 18, 2016 16:36
-
-
Save Sumolari/4b6b1cd3a88c3c062cb758dcea0d5969 to your computer and use it in GitHub Desktop.
Custom translation with MawKit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "MawKit/Device.hpp" | |
std::map<std::string, std::map<std:string, std::string>> languages; | |
std::string translate( const std::string &key ) | |
{ | |
std::map<std::string, std::string> &translations = languages[MK::Device::language()]; | |
if ( translations.find( key ) == translations.end() ) { | |
translations[key] = key; | |
} | |
return translations[key]; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment