#ifndef SERVER
#include "common.hpp"
#include "yaml-cpp/yaml.h"
#include <cstring>
#include <iostream>
#define LOCALE_LOC "locale.yaml"

static std::map <std::string, std::string> locale;

void LocaleUpdate() {
    YAML::Node _locale = YAML::LoadFile(Pathify(LOCALE_LOC));
    for(YAML::const_iterator it=_locale.begin();it!=_locale.end();++it)
    {
        locale[it->first.as<std::string>()] = it->second.as<std::string>();
    }
}
const std::string LocaleGet(const std::string loc) {
    if(locale.find(loc) != locale.end()) {
        return locale[loc];
    }
    return loc;
}
const std::string GetKeycodeName(KeyboardKey key) {
    const char* name = GetKeyName(key);
    if(name == NULL) //fallback
        name = KeyCodeToString((KeyCode)key);
    return std::string(name);
}
#endif