This is needed for out-of-tree modules. We need to translate their
plugin descriptor strings from their domain.
VLC_EXPORT( const char *, module_get_help, ( const module_t *m ) );
VLC_EXPORT( const char *, module_get_capability, ( const module_t *m ) );
VLC_EXPORT( int, module_get_score, ( const module_t *m ) );
+VLC_EXPORT( const char *, module_gettext, ( const module_t *, const char * ) );
static inline module_t *module_get_main (void)
{
module_get_name
module_get_object
module_get_score
+module_gettext
module_hold
module_list_free
module_list_get
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+#ifdef ENABLE_NLS
+# include <libintl.h>
+#endif
#include "config/configuration.h"
return m->i_score;
}
+/**
+ * Translate a string using the module's text domain
+ *
+ * \param m the module
+ * \param str the American English ASCII string to localize
+ * \return the gettext-translated string
+ */
+const char *module_gettext (const module_t *m, const char *str)
+{
+#ifdef ENABLE_NLS
+ const char *domain = m->domain ? m->domain : PACKAGE_NAME;
+ return dgettext (domain, str);
+#else
+ (void)m;
+ return str;
+#endif
+}
+
module_t *module_hold (module_t *m)
{
vlc_hold (&m->vlc_gc_data);