|
@@ -55,9 +55,29 @@ static int load_module_exports(struct obs_module *mod, const char *path)
|
|
mod->name = os_dlsym(mod->module, "obs_module_name");
|
|
mod->name = os_dlsym(mod->module, "obs_module_name");
|
|
mod->description = os_dlsym(mod->module, "obs_module_description");
|
|
mod->description = os_dlsym(mod->module, "obs_module_description");
|
|
mod->author = os_dlsym(mod->module, "obs_module_author");
|
|
mod->author = os_dlsym(mod->module, "obs_module_author");
|
|
|
|
+ mod->get_string = os_dlsym(mod->module, "obs_module_get_string");
|
|
return MODULE_SUCCESS;
|
|
return MODULE_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool obs_module_get_locale_string(const obs_module_t *mod,
|
|
|
|
+ const char *lookup_string,
|
|
|
|
+ const char **translated_string)
|
|
|
|
+{
|
|
|
|
+ if (mod->get_string) {
|
|
|
|
+ return mod->get_string(lookup_string, translated_string);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return false;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const char *obs_module_get_locale_text(const obs_module_t *mod,
|
|
|
|
+ const char *text)
|
|
|
|
+{
|
|
|
|
+ const char *str = text;
|
|
|
|
+ obs_module_get_locale_string(mod, text, &str);
|
|
|
|
+ return str;
|
|
|
|
+}
|
|
|
|
+
|
|
static inline char *get_module_name(const char *file)
|
|
static inline char *get_module_name(const char *file)
|
|
{
|
|
{
|
|
static size_t ext_len = 0;
|
|
static size_t ext_len = 0;
|