[vlc-commits] Remove the nine years old --language hack

Rémi Denis-Courmont git at videolan.org
Thu Jul 12 21:55:55 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 12 22:48:13 2012 +0300| [e64f39306bd71c20dfcf6eeb5c862ca81fbb7488] | committer: Rémi Denis-Courmont

Remove the nine years old --language hack

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e64f39306bd71c20dfcf6eeb5c862ca81fbb7488
---

 src/libvlc.c |   36 ------------------------------------
 1 file changed, 36 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 3a321c7..0aac070 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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
  *****************************************************************************



More information about the vlc-commits mailing list