Commit 64ae2cbf authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Support for custom text domain in module strings

parent 129717e2
......@@ -122,17 +122,18 @@ E_(vlc_entry) ( module_t *p_module );
goto error;
#define set_shortname( shortname ) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, \
(const char *)(shortname))) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, domain, \
(const char *)(shortname))) \
goto error;
#define set_description( desc ) \
if (vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, \
if (vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, domain, \
(const char *)(desc))) \
goto error;
#define set_help( help ) \
if (vlc_module_set (p_submodule, VLC_MODULE_HELP, (const char *)(help))) \
if (vlc_module_set (p_submodule, VLC_MODULE_HELP, domain, \
(const char *)(help))) \
goto error;
#define set_capability( cap, score ) \
......@@ -162,16 +163,19 @@ enum vlc_module_properties
* Append new items at the end ONLY. */
VLC_MODULE_CPU_REQUIREMENT,
VLC_MODULE_SHORTCUT,
VLC_MODULE_SHORTNAME,
VLC_MODULE_DESCRIPTION,
VLC_MODULE_HELP,
VLC_MODULE_SHORTNAME_NODOMAIN,
VLC_MODULE_DESCRIPTION_NODOMAIN,
VLC_MODULE_HELP_NODOMAIN,
VLC_MODULE_CAPABILITY,
VLC_MODULE_SCORE,
VLC_MODULE_PROGRAM,
VLC_MODULE_PROGRAM, /* obsoleted */
VLC_MODULE_CB_OPEN,
VLC_MODULE_CB_CLOSE,
VLC_MODULE_NO_UNLOAD,
VLC_MODULE_NAME,
VLC_MODULE_SHORTNAME,
VLC_MODULE_DESCRIPTION,
VLC_MODULE_HELP,
};
enum vlc_config_properties
......
......@@ -108,17 +108,26 @@ int vlc_module_set (module_t *module, int propid, ...)
break;
}
case VLC_MODULE_SHORTNAME:
module->psz_shortname = dgettext (PACKAGE, va_arg (ap, char *));
case VLC_MODULE_SHORTNAME_NODOMAIN:
{
const char *name = va_arg (ap, char *);
ret = vlc_module_set (module, VLC_MODULE_SHORTNAME, NULL, name);
break;
}
case VLC_MODULE_DESCRIPTION:
module->psz_longname = dgettext (PACKAGE, va_arg (ap, char *));
case VLC_MODULE_DESCRIPTION_NODOMAIN:
{
const char *desc = va_arg (ap, char *);
ret = vlc_module_set (module, VLC_MODULE_DESCRIPTION, NULL, desc);
break;
}
case VLC_MODULE_HELP:
module->psz_help = dgettext (PACKAGE, va_arg (ap, char *));
case VLC_MODULE_HELP_NODOMAIN:
{
const char *help = va_arg (ap, char *);
ret = vlc_module_set (module, VLC_MODULE_HELP, NULL, help);
break;
}
case VLC_MODULE_CAPABILITY:
module->psz_capability = va_arg (ap, char *);
......@@ -128,6 +137,10 @@ int vlc_module_set (module_t *module, int propid, ...)
module->i_score = va_arg (ap, int);
break;
case VLC_MODULE_PROGRAM:
msg_Warn (module, "deprecated module property %d", propid);
break;
case VLC_MODULE_CB_OPEN:
module->pf_activate = va_arg (ap, int (*) (vlc_object_t *));
break;
......@@ -151,9 +164,32 @@ int vlc_module_set (module_t *module, int propid, ...)
break;
}
case VLC_MODULE_PROGRAM:
msg_Warn (module, "deprecated module property %d", propid);
case VLC_MODULE_SHORTNAME:
{
const char *domain = va_arg (ap, const char *);
if (domain == NULL)
domain = PACKAGE;
module->psz_shortname = dgettext (domain, va_arg (ap, char *));
break;
}
case VLC_MODULE_DESCRIPTION:
{
const char *domain = va_arg (ap, const char *);
if (domain == NULL)
domain = PACKAGE;
module->psz_longname = dgettext (domain, va_arg (ap, char *));
break;
}
case VLC_MODULE_HELP:
{
const char *domain = va_arg (ap, const char *);
if (domain == NULL)
domain = PACKAGE;
module->psz_help = dgettext (domain, va_arg (ap, char *));
break;
}
default:
msg_Err (module, "unknown module property %d", propid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment