[vlc-devel] [PATCH 2/2] [WiP] Win32: reactivate language selection.
Rafaël Carré
funman at videolan.org
Tue Sep 3 15:41:48 CEST 2013
Le 03/09/2013 15:28, Jean-Baptiste Kempf a écrit :
> Looking at this technique, only setenv works.
> setlocale is useless, and same for setThreadLocale.
> SetEnvironmentVariable does not work either...
Looking at gettext, GetThreadLocale is only used in
gl_locale_name_default() (for some reason related to gnulib, there are 3
identical copies of that localename.c file, 2 LGPL and one GPL).
Perhaps patching gl_locale_name_environ would be the way to go?
> On 03 Sep, Jean-Baptiste Kempf wrote :
>> ---
>> src/libvlc.c | 14 ++++++++++++++
>> 1 file changed, 14 insertions(+)
>>
>> diff --git a/src/libvlc.c b/src/libvlc.c
>> index f1b0d65..eee6ccc 100644
>> --- a/src/libvlc.c
>> +++ b/src/libvlc.c
>> @@ -74,6 +74,12 @@
>> # include <libkern/OSAtomic.h>
>> #endif
>>
>> +#ifdef _WIN32
>> +# ifdef HAVE_LOCALE_H
>> +# include <locale.h>
>> +# endif
>> +#endif
>> +
>> #include <assert.h>
>>
>> /*****************************************************************************
>> @@ -185,6 +191,14 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
>> */
>> #if defined( ENABLE_NLS ) \
>> && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
>> +#ifdef _WIN32
>> + /* Check if the user specified a custom language */
>> + char *lang = var_InheritString (p_libvlc, "language");
>> + if (lang != NULL && strcmp (lang, "auto")) {
>> + setenv( "LC_ALL", lang, 1 );
>> + }
>> + free (lang);
>> +#endif
>> vlc_bindtextdomain (PACKAGE_NAME);
>> #endif
>> /*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
>> --
>> 1.8.4
>
More information about the vlc-devel
mailing list