Add module callbacks for loading locale data

The module callback obs_module_set_locale will be called after loading
the module, and any time the locale is manually changed via core API.

When this function is called, the module is expected to load new text
lookup values for all the text it uses based upon the current locale.
This commit is contained in:
jp9000
2014-06-25 00:22:54 -07:00
parent 0b4a259e56
commit 1abf91577e
4 changed files with 19 additions and 7 deletions

View File

@@ -578,6 +578,13 @@ void obs_set_locale(const char *locale)
if (obs->locale)
bfree(obs->locale);
obs->locale = bstrdup(locale);
for (size_t i = 0; i < obs->modules.num; i++) {
struct obs_module *module = obs->modules.array+i;
if (module->set_locale)
module->set_locale(locale);
}
}
const char *obs_get_locale(void)