mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
libobs: Add obs_module_get_string helper function
Allows getting a translated string for the current module, returning false if no string available.
This commit is contained in:
parent
8836592d92
commit
988bbc6080
|
@ -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); \
|
||||
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue