Skip to content

Instantly share code, notes, and snippets.

@Sumolari
Created April 18, 2016 16:36
Show Gist options
  • Save Sumolari/4b6b1cd3a88c3c062cb758dcea0d5969 to your computer and use it in GitHub Desktop.
Save Sumolari/4b6b1cd3a88c3c062cb758dcea0d5969 to your computer and use it in GitHub Desktop.
Custom translation with MawKit
#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