ALT Linux repos
S: | 1.5-alt1.38416.2 |
D: | 1.0-alt35.27330.1 |
5.0: | 1.0-alt35.27654.3 |
4.1: | 1.0-alt35.26470.1 |
4.0: | 1.0-alt35.23722.M40.1 |
Group :: Video
RPM: mplayer
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: mplayer-svn-r24081-nls.patch
Download
Download
diff -urN mplayer-svn-r24081.orig/configure mplayer-svn-r24081/configure
--- mplayer-svn-r24081.orig/configure 2007-08-16 22:30:27 +0300
+++ mplayer-svn-r24081/configure 2007-08-17 01:34:46 +0300
@@ -232,6 +232,7 @@
--enable-linux-devfs set default devices to devfs [disable]
--enable-termcap use termcap database for key codes [autodetect]
--enable-termios use termios database for key codes [autodetect]
+ --enable-nls use Native Language Support [disable]
--disable-iconv disable iconv for encoding conversion [autodetect]
--disable-langinfo do not use langinfo [autodetect]
--enable-lirc enable LIRC (remote control) support [autodetect]
@@ -546,6 +547,7 @@
_dxr3=auto
_ivtv=auto
_v4l2=auto
+_nls=no
_iconv=auto
_langinfo=auto
_rtc=auto
@@ -863,6 +865,8 @@
--disable-ivtv) _ivtv=no ;;
--enable-v4l2) _v4l2=yes ;;
--disable-v4l2) _v4l2=no ;;
+ --enable-nls) _nls=yes ;;
+ --disable-nls) _nls=no ;;
--enable-iconv) _iconv=yes ;;
--disable-iconv) _iconv=no ;;
--enable-langinfo) _langinfo=yes ;;
@@ -3089,6 +3093,14 @@
fi
echores "$_rpath"
+echocheck "NLS"
+if test "$_nls" = yes ; then
+ _def_nls='#define ENABLE_NLS 1'
+else
+ _def_nls='#undef ENABLE_NLS'
+fi
+echores "$_nls"
+
echocheck "iconv"
if test "$_iconv" = auto ; then
cat > $TMPC << EOF
@@ -7865,6 +7877,10 @@
try to recompile MPlayer with this option disabled! */
$_def_select
+$_def_nls
+#define PACKAGE "mplayer"
+#define LOCALEDIR "$_prefix/share/locale"
+
/* define this to use iconv(3) function to codepage conversions */
$_def_iconv
diff -urN mplayer-svn-r24081.orig/mp_msg.c mplayer-svn-r24081/mp_msg.c
--- mplayer-svn-r24081.orig/mp_msg.c 2007-06-05 23:28:31 +0300
+++ mplayer-svn-r24081/mp_msg.c 2007-08-17 01:33:41 +0300
@@ -8,6 +8,13 @@
#include "config.h"
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#define _(x) gettext(x)
+#else
+#define _(x) (x)
+#endif
+
#ifdef USE_ICONV
#include <iconv.h>
#include <errno.h>
@@ -25,7 +32,7 @@
#include "mp_msg.h"
/* maximum message length of mp_msg */
-#define MSGSIZE_MAX 3072
+#define MSGSIZE_MAX 4096
int mp_msg_levels[MSGT_MAX]; // verbose level of this module. inited to -2
int mp_msg_level_all = MSGL_STATUS;
@@ -64,6 +71,11 @@
}
*precoded = '\0';
return recoded_filename;
+#ifdef ENABLE_NLS
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
#endif
}
@@ -77,7 +89,14 @@
#ifdef USE_ICONV
mp_msg_charset = getenv("MPLAYER_CHARSET");
if (!mp_msg_charset)
+ //setlocale(LC_CTYPE, "");
mp_msg_charset = get_term_charset();
+ //setlocale(LC_CTYPE, "C");
+#ifdef ENABLE_NLS
+ setlocale(LC_ALL, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+#endif
#endif
}
@@ -92,14 +111,14 @@
if (!mp_msg_test(mod, lev)) return; // do not display
va_start(va, format);
- vsnprintf(tmp, MSGSIZE_MAX, format, va);
+ vsnprintf(tmp, MSGSIZE_MAX, _(format), va);
va_end(va);
tmp[MSGSIZE_MAX-2] = '\n';
tmp[MSGSIZE_MAX-1] = 0;
#ifdef HAVE_NEW_GUI
if(use_gui)
- guiMessageBox(lev, tmp);
+ guiMessageBox(lev, _(tmp));
#endif
#if defined(USE_ICONV) && defined(MSG_CHARSET)