Skip to content

Commit

Permalink
libobs: Add obs_module_get_string helper function
Browse files Browse the repository at this point in the history
Allows getting a translated string for the current module, returning
false if no string available.
  • Loading branch information
jp9000 committed Sep 7, 2016
1 parent 8836592 commit 988bbc6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libobs/obs-module.h
Expand Up @@ -112,6 +112,10 @@ MODULE_EXPORT void obs_module_free_locale(void);
text_lookup_getstr(obs_module_lookup, val, &out); \
return out; \
} \
bool obs_module_get_string(const char *val, const char **out) \
{ \
return text_lookup_getstr(obs_module_lookup, val, out); \
} \
void obs_module_set_locale(const char *locale) \
{ \
if (obs_module_lookup) text_lookup_destroy(obs_module_lookup); \
Expand All @@ -127,6 +131,11 @@ MODULE_EXPORT void obs_module_free_locale(void);
/** Helper function for looking up locale if default locale handler was used */
MODULE_EXTERN const char *obs_module_text(const char *lookup_string);

/** Helper function for looking up locale if default locale handler was used,
* returns true if text found, otherwise false */
MODULE_EXTERN bool obs_module_get_string(const char *lookup_string,
const char **translated_string);

/** Helper function that returns the current module */
MODULE_EXTERN obs_module_t *obs_current_module(void);

Expand Down

0 comments on commit 988bbc6

Please sign in to comment.