Works the same as before, but now can load a language from multiple files (CHEATER can now have its separate JSON files, instead of modifying the original language files).
Fixed some memory leaks and added the "NONE" string (when a string id has no value) as a member or the LanguageEntry struct.
void load_language_file(const char *filename)
Load a JSON file from anywhere in the code. The filename must be the absolute or relative path (from the exe) to the JSON file.
Note that every JSON file present in the "build/us_pc/res/texts" folder is automatically loaded when launching the game.
void add_key_value_string(struct LanguageEntry *lang, const char *key, const char *value)
Add a key/value string from anywhere in the code, for a specified language.
int get_num_languages()
Return the number of loaded languages. This value can change if a new language is loaded during runtime.
Works the same as before, but now can load a language from multiple files (CHEATER can now have its separate JSON files, instead of modifying the original language files). Fixed some memory leaks and added the "NONE" string (when a string id has no value) as a member or the LanguageEntry struct.
void load_language_file(const char *filename) Load a JSON file from anywhere in the code. The filename must be the absolute or relative path (from the exe) to the JSON file. Note that every JSON file present in the "build/us_pc/res/texts" folder is automatically loaded when launching the game.
void add_key_value_string(struct LanguageEntry *lang, const char *key, const char *value) Add a key/value string from anywhere in the code, for a specified language.
int get_num_languages() Return the number of loaded languages. This value can change if a new language is loaded during runtime.