[vlc-devel] [PATCH 2/2] [WiP] Win32: reactivate language selection.

Jean-Baptiste Kempf jb at videolan.org
Tue Sep 3 15:28:43 CEST 2013


Looking at this technique, only setenv works.
setlocale is useless, and same for setThreadLocale.
SetEnvironmentVariable does not work either...

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

-- 
Best regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list