DungeonCrawl
Loading...
Searching...
No Matches
local_handler.h
Go to the documentation of this file.
1
5#ifndef LOCAL_HANDLER_H
6#define LOCAL_HANDLER_H
7
8typedef enum {
9 LANGE_EN,
10 LANGE_DE,
11 MAX_LANG
12} local_lang_t;
13
14static const struct {
15 local_lang_t lang;
16 char* file_name;
17} local_file_mapping[] = {
18 {LANGE_EN, "local_en.properties"},
19 {LANGE_DE, "local_de.properties"}};
20
31int init_local_handler(local_lang_t lang);
32
40char* get_local_string(const char* key);
41
55int set_language(local_lang_t lang);
56
57
66local_lang_t get_language(void);
67
78void observe_local(void (*update_func)(void));
79
90void shutdown_local_handler(void);
91
92#endif//LOCAL_HANDLER_H
local_lang_t get_language(void)
Retrieve the currently set language of the local handler.
void shutdown_local_handler(void)
Shut down the local language handler by releasing resources and closing the resource file.
int init_local_handler(local_lang_t lang)
Initialize the local language handler by setting up the language and opening the corresponding resour...
char * get_local_string(const char *key)
Get the localized string for the given key.
void observe_local(void(*update_func)(void))
Registers an observer function to be notified of updates from the local handler.
int set_language(local_lang_t lang)
Sets the current language for the local handler and updates all registered observers.