2014-06-14 16:52:32 +02:00
|
|
|
#include "bind_locale.h"
|
|
|
|
#include "util/language.h"
|
|
|
|
|
|
|
|
void locale_create(const char *lang) {
|
2014-06-16 07:17:08 +02:00
|
|
|
get_or_create_locale(lang);
|
2014-06-14 16:52:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void locale_set(const char *lang, const char *key, const char *str) {
|
2014-06-16 07:17:08 +02:00
|
|
|
struct locale *loc = get_locale(lang);
|
2014-06-14 16:52:32 +02:00
|
|
|
if (loc) {
|
|
|
|
locale_setstring(loc, key, str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const char * locale_get(const char *lang, const char *key) {
|
2014-06-16 07:17:08 +02:00
|
|
|
struct locale *loc = get_locale(lang);
|
2014-06-14 16:52:32 +02:00
|
|
|
if (loc) {
|
|
|
|
return locale_getstring(loc, key);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|