changeset 12964:9818bc37b807

language handling simplification
author diego
date Thu, 05 Aug 2004 00:14:16 +0000
parents 89c88649a785
children 520c8675f033
files Makefile configure
diffstat 2 files changed, 18 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Aug 05 00:12:15 2004 +0000
+++ b/Makefile	Thu Aug 05 00:14:16 2004 +0000
@@ -253,7 +253,7 @@
 	-ln -sf $(PRG) $(BINDIR)/gmplayer
 endif
 	if test ! -d $(MANDIR)/man1 ; then mkdir -p $(MANDIR)/man1; fi
-	for i in $(LANGUAGES); do \
+	for i in $(MAN_LANG); do \
 		if test "$$i" = en ; then \
 			$(INSTALL) -c -m 644 DOCS/man/en/mplayer.1 $(MANDIR)/man1/mplayer.1 ; \
 		else \
@@ -263,7 +263,7 @@
 	done
 ifeq ($(MENCODER),yes)
 	$(INSTALL) -m 755 $(INSTALLSTRIP) $(PRG_MENCODER) $(BINDIR)/$(PRG_MENCODER)
-	for i in $(LANGUAGES); do \
+	for i in $(MAN_LANG); do \
 		if test "$$i" = en ; then \
 			ln -sf mplayer.1 $(MANDIR)/man1/mencoder.1 ; \
 		else \
--- a/configure	Thu Aug 05 00:12:15 2004 +0000
+++ b/configure	Thu Aug 05 00:14:16 2004 +0000
@@ -125,7 +125,7 @@
   *)	_echo_n='-n '	_echo_c=	;;	# BSD echo
 esac
 
-LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s/help\/help_mp-\(..\).h/\1/g" |sed "s/help\/help_mp-\(.....\).h/\1/g"`
+LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
 
 for parm in "$@" ; do
   if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
@@ -2095,29 +2095,28 @@
 test -z "$_language" && _language=$LINGUAS
 _language=`echo $_language | sed 's/,/ /g'`
 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
-for i in $_language ; do
-  test "$i" = all && i=en
-  if test -f "help/help_mp-${i}.h" ; then
-    _language=$i
+for lang in $_language ; do
+  test "$lang" = all && lang=en
+  if test -f "help/help_mp-${lang}.h" ; then
+    _language=$lang
     break
   else
-    echo -n "$i not found, "
-    _language=`echo $_language | sed "s/$i *//"`
+    echo -n "$lang not found, "
+    _language=`echo $_language | sed "s/$lang *//"`
   fi
 done
 test -z "$_language" && _language=en
-for i in $LANGUAGES ; do
-  if test -f "DOCS/man/$i/mplayer.1" ; then
-    LANGUAGES=`echo $LANGUAGES | sed "s/$i *//2" | sed 's/ *$//'`
-  else
-    LANGUAGES=`echo $LANGUAGES | sed "s/$i *//" | sed 's/ *$//'`
+_mp_help="help/help_mp-${_language}.h"
+test -f $_mp_help || die "$_mp_help not found"
+for lang in $LANGUAGES ; do
+  if test -f "DOCS/man/$lang/mplayer.1" ; then
+    MAN_LANG="$MAN_LANG $lang"
   fi
 done
-echores "using $_language (man pages: $LANGUAGES)"
-_mp_help="help/help_mp-${_language}.h"
-test -f $_mp_help || die "$_mp_help not found"
 _doc_lang=$_language
 test -d DOCS/xml/$_doc_lang || _doc_lang=en
+echores "using $_language (man pages: $MAN_LANG)"
+
 
 echocheck "enable sighandler"
 if test "$_sighandler" = yes ; then
@@ -6067,7 +6066,7 @@
 # -------- Generated by configure -----------
 
 LANG = C
-LANGUAGES = $LANGUAGES
+MAN_LANG = $MAN_LANG
 TARGET_OS = $system_name
 DESTDIR =
 prefix = \$(DESTDIR)$_prefix
@@ -6882,7 +6881,7 @@
     Messages/GUI: $_language
 EOF
 
-echo -n "    Manual pages: $LANGUAGES"
+echo -n "    Manual pages: $MAN_LANG"
 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
 echo