]> git.sesse.net Git - vlc/commitdiff
Remove the nine years old --language hack
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 12 Jul 2012 19:48:13 +0000 (22:48 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 12 Jul 2012 19:52:48 +0000 (22:52 +0300)
This was apparently put in place to work around the lack of language
setting in BeOS. Then it was extended to Windows and MacOS since
gettext failed to retrieve the user language configuration.
BeOS is no longer supported and Windows support and MacOS support were
fixed in gettext 0.18.

Also calling setlocale() from a library can crash.

src/libvlc.c

index 3a321c744007373b5419f53b0d2654bee6caea5e..0aac070808ffdee12e7b27d1949806095c85e0d2 100644 (file)
@@ -49,9 +49,6 @@
 
 #include "config/vlc_getopt.h"
 
-#ifdef HAVE_LOCALE_H
-#   include <locale.h>
-#endif
 #ifdef HAVE_UNISTD_H
 #   include <unistd.h> /* isatty() */
 #endif
@@ -95,10 +92,6 @@ static bool b_daemon = false;
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-#if defined( ENABLE_NLS ) && (defined (__APPLE__) || defined (WIN32)) && \
-    ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
-static void SetLanguage   ( char const * );
-#endif
 static void GetFilenames  ( libvlc_int_t *, unsigned, const char *const [] );
 
 /**
@@ -223,13 +216,6 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
      */
 #if defined( ENABLE_NLS ) \
      && ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
-# if defined (WIN32) || defined (__APPLE__)
-    /* Check if the user specified a custom language */
-    char *lang = var_InheritString (p_libvlc, "language");
-    if (lang != NULL && strcmp (lang, "auto"))
-        SetLanguage (lang);
-    free (lang);
-# endif
     vlc_bindtextdomain (PACKAGE_NAME);
 #endif
     /*xgettext: Translate "C" to the language code: "fr", "en_GB", "nl", "ru"... */
@@ -805,28 +791,6 @@ int libvlc_InternalAddIntf( libvlc_int_t *p_libvlc, char const *psz_module )
     return ret;
 }
 
-#if defined( ENABLE_NLS ) && (defined (__APPLE__) || defined (WIN32)) && \
-    ( defined( HAVE_GETTEXT ) || defined( HAVE_INCLUDED_GETTEXT ) )
-/*****************************************************************************
- * SetLanguage: set the interface language.
- *****************************************************************************
- * We set the LC_MESSAGES locale category for interface messages and buttons,
- * as well as the LC_CTYPE category for string sorting and possible wide
- * character support.
- *****************************************************************************/
-static void SetLanguage ( const char *psz_lang )
-{
-#ifdef __APPLE__
-    /* I need that under Darwin, please check it doesn't disturb
-     * other platforms. --Meuuh */
-    setenv( "LANG", psz_lang, 1 );
-
-#endif
-
-    setlocale( LC_ALL, psz_lang );
-}
-#endif
-
 /*****************************************************************************
  * GetFilenames: parse command line options which are not flags
  *****************************************************************************