==================
Languages are not equally supported in all packages. The following
-matrix shows the current state of internationalization, as of May 2001.
-The matrix shows, in regard of each package, for which languages PO
-files have been submitted to translation coordination, with a
+matrix shows the current state of internationalization, as of September
+2001. The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
translation percentage of at least 50%.
- Ready PO files bg cs da de el en eo es et fi fr gl he hr id it
- +-------------------------------------------------+
- a2ps | [] [] |
- bash | [] [] [] [] |
- bfd | |
- binutils | |
- bison | [] [] [] [] |
- clisp | [] [] [] [] |
- cpio | [] [] [] [] |
- diffutils | [] [] [] [] [] [] [] |
- enscript | [] [] |
- error | [] [] |
- fetchmail | |
- fileutils | [] [] [] [] [] [] [] |
- findutils | [] [] [] [] [] [] [] [] |
- flex | [] [] [] |
- gas | |
- gawk | [] |
- gcal | |
- gcc | [] |
- gettext | [] [] [] [] [] [] [] [] [] |
- gnupg | [] [] [] [] [] |
- gprof | |
- grep | [] [] [] [] [] [] [] |
- hello | [] [] [] [] [] [] [] [] [] [] |
- id-utils | [] [] [] |
- indent | [] [] [] [] [] |
- jpilot | |
- kbd | |
- ld | |
- libc | [] [] [] [] [] [] [] [] |
- lilypond | |
- lynx | [] [] [] |
- m4 | [] [] [] [] [] [] [] |
- make | [] [] [] [] [] |
- nano | [] |
- opcodes | |
- parted | [] [] |
- ptx | [] [] [] [] [] [] [] |
- python | |
- recode | [] [] [] [] [] [] [] [] [] |
- sed | [] [] [] [] [] [] [] [] [] [] |
- sh-utils | [] [] [] [] [] [] [] [] [] |
- sharutils | [] [] [] [] [] [] [] |
- soundtracker | |
- sp | |
- tar | [] [] [] [] [] [] [] [] |
- texinfo | [] [] [] [] [] |
- textutils | [] [] [] [] [] [] [] |
- util-linux | [] [] |
- wdiff | [] [] |
- wget | [] [] [] [] [] [] [] [] [] |
- +-------------------------------------------------+
- bg cs da de el en eo es et fi fr gl he hr id it
- 0 13 24 30 11 1 8 21 13 1 28 18 3 0 8 10
+ Ready PO files bg cs da de el en eo es et fi fr gl he hr id it ja
+ +----------------------------------------------------+
+ a2ps | [] [] [] |
+ bash | [] [] [] [] |
+ bfd | |
+ binutils | [] |
+ bison | [] [] [] [] [] |
+ clisp | [] [] [] [] |
+ cpio | [] [] [] [] [] |
+ diffutils | [] [] [] [] [] [] [] |
+ enscript | [] [] |
+ error | [] [] |
+ fetchmail | |
+ fileutils | [] [] [] [] [] [] [] [] |
+ findutils | [] [] [] [] [] [] [] [] |
+ flex | [] [] [] |
+ freetype | |
+ gas | |
+ gawk | [] [] |
+ gcal | |
+ gcc | |
+ gettext | [] [] [] [] [] [] [] [] [] [] |
+ gnupg | [] [] [] [] [] [] [] |
+ gprof | |
+ grep | [] [] [] [] [] [] [] [] |
+ hello | [] [] [] [] [] [] [] [] [] [] [] |
+ id-utils | [] [] [] |
+ indent | [] [] [] [] [] |
+ jpilot | [] |
+ kbd | |
+ ld | [] |
+ libc | [] [] [] [] [] [] [] [] |
+ lilypond | [] |
+ lynx | [] [] [] [] |
+ m4 | [] [] [] [] [] [] [] [] |
+ make | [] [] [] [] [] [] |
+ mysecretdiary | [] |
+ nano | [] [] [] |
+ opcodes | |
+ parted | [] [] [] |
+ ptx | [] [] [] [] [] [] [] |
+ python | |
+ recode | [] [] [] [] [] [] [] [] [] |
+ sed | [] [] [] [] [] [] [] [] [] [] [] [] |
+ sh-utils | [] [] [] [] [] [] [] [] [] [] |
+ sharutils | [] [] [] [] [] [] [] [] |
+ sketch | |
+ soundtracker | [] [] [] |
+ sp | |
+ tar | [] [] [] [] [] [] [] [] |
+ texinfo | [] [] [] [] [] [] |
+ textutils | [] [] [] [] [] [] [] [] |
+ util-linux | [] [] |
+ wdiff | [] [] [] |
+ wget | [] [] [] [] [] [] [] [] [] [] |
+ +----------------------------------------------------+
+ bg cs da de el en eo es et fi fr gl he hr id it ja
+ 0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18
- ja ko lv nl no pl pt pt_BR ru sk sl sv tr uk zh
- +-------------------------------------------------+
- a2ps | [] [] [] | 5
- bash | | 4
- bfd | | 0
- binutils | | 0
- bison | [] [] [] | 7
- clisp | [] | 5
- cpio | [] [] [] [] [] | 9
- diffutils | [] [] [] | 10
- enscript | [] [] [] | 5
- error | [] | 3
- fetchmail | | 0
- fileutils | [] [] [] [] [] [] [] [] [] [] | 17
- findutils | [] [] [] [] [] [] [] [] | 16
- flex | [] [] [] | 6
- gas | | 0
- gawk | | 1
- gcal | | 0
- gcc | [] | 2
- gettext | [] [] [] [] [] [] [] [] [] | 18
- gnupg | [] [] [] [] | 9
- gprof | | 0
- grep | [] [] [] | 10
- hello | [] [] [] [] [] [] [] [] [] [] [] | 21
- id-utils | [] [] [] | 6
- indent | [] [] [] [] [] [] [] | 12
- jpilot | | 0
- kbd | [] | 1
- ld | | 0
- libc | [] [] [] [] [] [] [] [] [] | 17
- lilypond | [] | 1
- lynx | [] [] [] [] [] | 8
- m4 | [] [] [] [] [] | 12
- make | [] [] [] [] [] [] [] | 12
- nano | | 1
- opcodes | | 0
- parted | [] [] [] | 5
- ptx | [] [] [] [] [] [] [] | 14
- python | | 0
- recode | [] [] [] [] | 13
- sed | [] [] [] [] [] [] [] [] | 18
- sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 20
- sharutils | [] [] [] [] | 11
- soundtracker | | 0
- sp | | 0
- tar | [] [] [] [] [] [] [] [] [] | 17
- texinfo | [] [] | 7
- textutils | [] [] [] [] [] [] [] [] | 15
- util-linux | [] [] | 4
- wdiff | [] [] | 4
- wget | [] [] [] [] [] [] | 15
- +-------------------------------------------------+
- 31 teams ja ko lv nl no pl pt pt_BR ru sk sl sv tr uk zh
- 50 domains 17 9 1 23 6 17 1 13 26 9 11 19 17 1 2 361
+ ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
+ +----------------------------------------------------+
+ a2ps | [] [] [] | 6
+ bash | | 4
+ bfd | | 0
+ binutils | | 1
+ bison | [] | 6
+ clisp | [] | 5
+ cpio | [] [] [] [] [] | 10
+ diffutils | [] [] [] [] | 11
+ enscript | [] [] [] | 5
+ error | [] [] | 4
+ fetchmail | | 0
+ fileutils | [] [] [] [] [] [] [] [] [] | 17
+ findutils | [] [] [] [] [] [] [] [] | 16
+ flex | [] [] [] | 6
+ freetype | | 0
+ gas | | 0
+ gawk | [] | 3
+ gcal | | 0
+ gcc | | 0
+ gettext | [] [] [] [] [] [] [] [] | 18
+ gnupg | [] [] [] | 10
+ gprof | | 0
+ grep | [] [] [] [] | 12
+ hello | [] [] [] [] [] [] [] [] [] [] [] | 22
+ id-utils | [] [] [] | 6
+ indent | [] [] [] [] [] [] [] | 12
+ jpilot | | 1
+ kbd | [] | 1
+ ld | | 1
+ libc | [] [] [] [] [] [] [] [] | 16
+ lilypond | [] [] | 3
+ lynx | [] [] [] [] | 8
+ m4 | [] [] [] [] | 12
+ make | [] [] [] [] [] [] | 12
+ mysecretdiary | | 1
+ nano | [] | 4
+ opcodes | [] | 1
+ parted | [] [] | 5
+ ptx | [] [] [] [] [] [] [] [] | 15
+ python | | 0
+ recode | [] [] [] [] | 13
+ sed | [] [] [] [] [] [] [] | 19
+ sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 21
+ sharutils | [] [] [] | 11
+ sketch | | 0
+ soundtracker | | 3
+ sp | | 0
+ tar | [] [] [] [] [] [] [] | 15
+ texinfo | [] | 7
+ textutils | [] [] [] [] [] [] [] [] | 16
+ util-linux | [] [] | 4
+ wdiff | [] [] [] [] | 7
+ wget | [] [] [] [] [] [] [] | 17
+ +----------------------------------------------------+
+ 33 teams ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh
+ 53 domains 9 1 6 20 0 6 17 1 13 25 10 11 23 21 2 2 387
Some counters in the preceding matrix are higher than the number of
visible blocks let us expect. This is because a few extra PO files are
lag between the mere existence a PO file and its wide availability in a
distribution.
- If May 2001 seems to be old, you may fetch a more recent copy of
-this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
-matrix with full percentage details can be found at
+ If September 2001 seems to be old, you may fetch a more recent copy
+of this `ABOUT-NLS' file on most GNU archive sites. The most
+up-to-date matrix with full percentage details can be found at
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
Using `gettext' in new packages
If you are writing a freely available program and want to
internationalize it you are welcome to use GNU `gettext' in your
-package. Of course the GNU General Public License applies to your
-sources from then on if you include `gettext' directly in your
-distribution but since you are writing free software anyway this is no
-restriction.
-
- Once the sources are change appropriately and the setup can handle to
-use of `gettext' the only thing missing are the translations. The Free
-Translation Project is also available for packages which are not
+package. Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library. This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+ Once the sources are changed appropriately and the setup can handle
+to use of `gettext' the only thing missing are the translations. The
+Free Translation Project is also available for packages which are not
developed inside the GNU project. Therefore the information given above
applies also for every other Free Software Project. Contact
`translation@iro.umontreal.ca' to make the `.pot' files available to
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
stdlib.h string.h unistd.h sys/param.h])
- AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
-getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strcasecmp strdup \
-strtoul tsearch __argz_count __argz_stringify __argz_next])
+ AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
AM_ICONV
AM_LANGINFO_CODESET
INTLOBJS="\$(GETTOBJS)"
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
- INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
+ INTLLIBS="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
/* Define if you have the fgets_unlocked function. */
#undef HAVE_FGETS_UNLOCKED
+/* Define if you have the getc_unlocked function. */
+#undef HAVE_GETC_UNLOCKED
+
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the posix_spawn function. */
#undef HAVE_POSIX_SPAWN
+/* Define if you have the putc_unlocked function. */
+#undef HAVE_PUTC_UNLOCKED
+
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
fi
-for ac_func in getcwd mblen memcpy posix_spawn raise select strerror uname \
-utime utimes
+for ac_func in getcwd mblen memcpy posix_spawn putc_unlocked raise select \
+strerror uname utime utimes
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:6575: checking for $ac_func" >&5
fi
done
- for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \
-getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strcasecmp strdup \
-strtoul tsearch __argz_count __argz_stringify __argz_next
+ for ac_func in feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
+geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
+strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:9060: checking for $ac_func" >&5
INTLOBJS="\$(GETTOBJS)"
BUILD_INCLUDED_LIBINTL=yes
USE_INCLUDED_LIBINTL=yes
- INTLLIBS="\$(top_builddir)/intl/libintl.la $LIBICONV"
+ INTLLIBS="\${top_builddir}/intl/libintl.la $LIBICONV"
LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
fi
echo "$ac_t""no" 1>&6
fi
-# Extract the first word of "texi2html", so it can be a program name with args.
-set dummy texi2html; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9944: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_TEXI2HTML'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- case "$TEXI2HTML" in
- /*)
- ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a path.
- ;;
- ?:/*)
- ac_cv_path_TEXI2HTML="$TEXI2HTML" # Let the user override the test with a dos path.
- ;;
- *)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_TEXI2HTML="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_TEXI2HTML" && ac_cv_path_TEXI2HTML="$ac_aux_dir_abs/missing texi2html"
- ;;
-esac
-fi
-TEXI2HTML="$ac_cv_path_TEXI2HTML"
-if test -n "$TEXI2HTML"; then
- echo "$ac_t""$TEXI2HTML" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-
-CROSS_COMPILING=$cross_compiling
-
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:9983: checking for $ac_word" >&5
+echo "configure:9944: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
+CROSS_COMPILING=$cross_compiling
+
+
test -d intl || mkdir intl
echo "GNU gettext library from $PACKAGE-$VERSION" > intl/VERSION
cat > intl/ChangeLog.inst <<EOF
s%@aclocaldir@%$aclocaldir%g
s%@DVIPS@%$DVIPS%g
s%@TEXI2PDF@%$TEXI2PDF%g
-s%@TEXI2HTML@%$TEXI2HTML%g
-s%@CROSS_COMPILING@%$CROSS_COMPILING%g
s%@PERL@%$PERL%g
+s%@CROSS_COMPILING@%$CROSS_COMPILING%g
CEOF
EOF
DVIPS = @DVIPS@ -D600
-# Documentation in HTML format.
-TEXI2HTML = @TEXI2HTML@
-
-
# Documentation in Portable Document Format.
TEXI2PDF = @TEXI2PDF@
MAKEINFO = env LANG= LANGUAGE= @MAKEINFO@
info_TEXINFOS = gettext.texi
-gettext_TEXINFOS = iso-639.texi iso-3166.texi
+# List of texinfo sources @included by gettext.texi, excluding version.texi.
+gettext_TEXINFOS = \
+ xgettext.texi msginit.texi msgmerge.texi msgcat.texi msgconv.texi \
+ msggrep.texi msgexec.texi msguniq.texi msgcomm.texi msgcmp.texi \
+ msgattrib.texi msgen.texi msgfmt.texi msgunfmt.texi \
+ iso-639.texi iso-3166.texi
+
EXTRA_DIST = iso-639.sed iso-3166.sed ISO_639 ISO_3166 nls.texi matrix.texi $(EXTRA_DIST_html)
# gettext.dvi and gettext.ps are already known to automake.
MAINTAINERCLEANFILES = gettext_*.html
SUFFIXES = .pdf
+
+
+# Documentation in HTML format.
+TEXI2HTML = @PERL@ $(srcdir)/texi2html
subdir = doc
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
$(TEXI2HTML) -expandinfo -number -monolithic `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi`
gettext_toc.html: gettext.texi version.texi $(gettext_TEXINFOS)
- case "$(TEXI2HTML)" in \
- *"/missing texi2html") \
+ case "@PERL@" in \
+ *"/missing perl") \
$(TEXI2HTML) -expandinfo -number -split_chapter `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi` || exit 0 ;; \
*) $(RM) gettext_*.html ; \
$(TEXI2HTML) -expandinfo -number -split_chapter `if test -f gettext.texi; then echo gettext.texi; else echo $(srcdir)/gettext.texi; fi` ;; \
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
install-data-local: install-java-@BUILDJAVA@
install-java-no:
+ $(mkinstalldirs) $(DESTDIR)$(jardir)
install-java-yes: all-java-yes
+ $(mkinstalldirs) $(DESTDIR)$(jardir)
$(INSTALL_DATA) libintl.jar $(DESTDIR)$(jardir)/libintl.jar
installdirs-local:
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
/* The bison generated parser uses alloca. AIX 3 forces us to put this
declaration at the beginning of the file. The declaration in bison's
#endif
#include <stdlib.h>
-#include "gettextP.h"
-
-/* Names for the libintl functions are a problem. They must not clash
- with existing names and they should follow ANSI C. But this source
- code is also used in GNU C Library where the names have a __
- prefix. So we have to make a difference here. */
-#ifdef _LIBC
-# define FREE_EXPRESSION __gettext_free_exp
-#else
-# define FREE_EXPRESSION gettext_free_exp__
-# define __gettextparse gettextparse__
+#include "plural-exp.h"
+
+/* The main function generated by the parser is called __gettextparse,
+ but we want it to be called PLURAL_PARSE. */
+#ifndef _LIBC
+# define __gettextparse PLURAL_PARSE
#endif
#define YYLEX_PARAM &((struct parse_args *) arg)->cp
#define YYPARSE_PARAM arg
-#line 52 "plural.y"
+#line 48 "plural.y"
typedef union {
unsigned long int num;
enum operator op;
struct expression *exp;
} YYSTYPE;
-#line 58 "plural.y"
+#line 54 "plural.y"
/* Prototypes for local functions. */
static struct expression *new_exp PARAMS ((int nargs, enum operator op,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 177, 185, 189, 193, 197, 201, 205, 209, 213, 217,
- 221, 226
+ 173, 181, 185, 189, 193, 197, 201, 205, 209, 213,
+ 217, 222
};
#endif
switch (yyn) {
case 1:
-#line 178 "plural.y"
+#line 174 "plural.y"
{
if (yyvsp[0].exp == NULL)
YYABORT;
;
break;}
case 2:
-#line 186 "plural.y"
+#line 182 "plural.y"
{
yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 3:
-#line 190 "plural.y"
+#line 186 "plural.y"
{
yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 4:
-#line 194 "plural.y"
+#line 190 "plural.y"
{
yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 5:
-#line 198 "plural.y"
+#line 194 "plural.y"
{
yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 6:
-#line 202 "plural.y"
+#line 198 "plural.y"
{
yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 7:
-#line 206 "plural.y"
+#line 202 "plural.y"
{
yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 8:
-#line 210 "plural.y"
+#line 206 "plural.y"
{
yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
;
break;}
case 9:
-#line 214 "plural.y"
+#line 210 "plural.y"
{
yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
;
break;}
case 10:
-#line 218 "plural.y"
+#line 214 "plural.y"
{
yyval.exp = new_exp_0 (var);
;
break;}
case 11:
-#line 222 "plural.y"
+#line 218 "plural.y"
{
if ((yyval.exp = new_exp_0 (num)) != NULL)
yyval.exp->val.num = yyvsp[0].num;
;
break;}
case 12:
-#line 227 "plural.y"
+#line 223 "plural.y"
{
yyval.exp = yyvsp[-1].exp;
;
}
return 1;
}
-#line 232 "plural.y"
+#line 228 "plural.y"
void
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
# include "config.h"
#endif
+/* Specification. */
+#include "po-gram.h"
+
#include <stdio.h>
+#include <stdlib.h>
#include "str-list.h"
#include "po-lex.h"
-#include "po-gram.h"
#include "error.h"
-#include "system.h"
+#include "xmalloc.h"
#include "libgettext.h"
#include "po.h"
po_gram_error_at_line (&(value2).pos, _("inconsistent use of #~"));
-#line 103 "po-gram-gen.y"
+#line 106 "po-gram-gen.y"
typedef union
{
struct { char *string; lex_pos_ty pos; bool obsolete; } string;
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 123, 124, 125, 126, 127, 131, 138, 156, 174, 182,
- 190, 199, 210, 214, 229, 251, 258, 269
+ 126, 127, 128, 129, 130, 134, 141, 159, 177, 185,
+ 193, 202, 213, 217, 232, 254, 261, 272
};
#endif
switch (yyn) {
case 6:
-#line 132 "po-gram-gen.y"
+#line 135 "po-gram-gen.y"
{
po_callback_domain (yyvsp[0].string.string);
;
break;}
case 7:
-#line 139 "po-gram-gen.y"
+#line 142 "po-gram-gen.y"
{
char *string2 = string_list_concat_destroy (&yyvsp[-2].stringlist.stringlist);
char *string4 = string_list_concat_destroy (&yyvsp[0].stringlist.stringlist);
;
break;}
case 8:
-#line 157 "po-gram-gen.y"
+#line 160 "po-gram-gen.y"
{
char *string2 = string_list_concat_destroy (&yyvsp[-2].stringlist.stringlist);
;
break;}
case 9:
-#line 175 "po-gram-gen.y"
+#line 178 "po-gram-gen.y"
{
check_obsolete (yyvsp[-2].pos, yyvsp[-1].stringlist);
check_obsolete (yyvsp[-2].pos, yyvsp[0].string);
;
break;}
case 10:
-#line 183 "po-gram-gen.y"
+#line 186 "po-gram-gen.y"
{
check_obsolete (yyvsp[-2].pos, yyvsp[-1].stringlist);
check_obsolete (yyvsp[-2].pos, yyvsp[0].rhs);
;
break;}
case 11:
-#line 191 "po-gram-gen.y"
+#line 194 "po-gram-gen.y"
{
check_obsolete (yyvsp[-1].pos, yyvsp[0].stringlist);
po_gram_error_at_line (&yyvsp[-1].pos.pos, _("missing `msgstr' section"));
;
break;}
case 12:
-#line 200 "po-gram-gen.y"
+#line 203 "po-gram-gen.y"
{
check_obsolete (yyvsp[-1].pos, yyvsp[0].stringlist);
plural_counter = 0;
;
break;}
case 13:
-#line 211 "po-gram-gen.y"
+#line 214 "po-gram-gen.y"
{
yyval.rhs = yyvsp[0].rhs;
;
break;}
case 14:
-#line 215 "po-gram-gen.y"
+#line 218 "po-gram-gen.y"
{
check_obsolete (yyvsp[-1].rhs, yyvsp[0].rhs);
yyval.rhs.rhs.msgstr = (char *) xmalloc (yyvsp[-1].rhs.rhs.msgstr_len + yyvsp[0].rhs.rhs.msgstr_len);
;
break;}
case 15:
-#line 230 "po-gram-gen.y"
+#line 233 "po-gram-gen.y"
{
check_obsolete (yyvsp[-4].pos, yyvsp[-3].pos);
check_obsolete (yyvsp[-4].pos, yyvsp[-2].number);
;
break;}
case 16:
-#line 252 "po-gram-gen.y"
+#line 255 "po-gram-gen.y"
{
string_list_init (&yyval.stringlist.stringlist);
string_list_append (&yyval.stringlist.stringlist, yyvsp[0].string.string);
;
break;}
case 17:
-#line 259 "po-gram-gen.y"
+#line 262 "po-gram-gen.y"
{
check_obsolete (yyvsp[-1].stringlist, yyvsp[0].string);
yyval.stringlist.stringlist = yyvsp[-1].stringlist.stringlist;
;
break;}
case 18:
-#line 270 "po-gram-gen.y"
+#line 273 "po-gram-gen.y"
{
po_callback_comment (yyvsp[0].string.string);
;
}
return 1;
}
-#line 274 "po-gram-gen.y"
+#line 277 "po-gram-gen.y"
# include "config.h"
#endif
+/* Specification. */
+#include "po-hash.h"
+
#include <stdio.h>
+#include <stdlib.h>
-#include <system.h>
-#include "po-hash.h"
+#include "xmalloc.h"
#include "po.h"
/* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
#define yycheck po_hash_yycheck
-#line 89 "po-hash-gen.y"
+#line 92 "po-hash-gen.y"
typedef union
{
char *string;
- int number;
+ size_t number;
} YYSTYPE;
-#line 98 "po-hash-gen.y"
+#line 101 "po-hash-gen.y"
static const char *cur;
#if YYDEBUG != 0
static const short yyprhs[] = { 0,
- 0, 1, 4, 8, 16, 25
+ 0, 1, 4, 8, 10, 18, 27
};
static const short yyrhs[] = { -1,
- 10, 11, 0, 3, 5, 4, 0, 7, 5, 3,
- 6, 8, 5, 4, 0, 7, 5, 3, 6, 8,
- 9, 5, 4, 0, 7, 5, 4, 0
+ 10, 11, 0, 3, 5, 4, 0, 3, 0, 7,
+ 5, 3, 6, 8, 5, 4, 0, 7, 5, 3,
+ 6, 8, 9, 5, 4, 0, 7, 5, 4, 0
};
#endif
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 129, 130, 134, 140, 146, 152
+ 132, 133, 137, 143, 149, 155, 161
};
#endif
#endif
static const short yyr1[] = { 0,
- 10, 10, 11, 11, 11, 11
+ 10, 10, 11, 11, 11, 11, 11
};
static const short yyr2[] = { 0,
- 0, 2, 3, 7, 8, 3
+ 0, 2, 3, 1, 7, 8, 3
};
static const short yydefact[] = { 1,
- 0, 0, 0, 2, 0, 0, 3, 0, 6, 0,
- 0, 0, 0, 4, 0, 5, 0, 0
+ 0, 4, 0, 2, 0, 0, 3, 0, 7, 0,
+ 0, 0, 0, 5, 0, 6, 0, 0
};
static const short yydefgoto[] = { 1,
switch (yyn) {
case 3:
-#line 135 "po-hash-gen.y"
+#line 138 "po-hash-gen.y"
{
/* GNU style */
po_callback_comment_filepos (yyvsp[-2].string, yyvsp[0].number);
;
break;}
case 4:
-#line 141 "po-hash-gen.y"
+#line 144 "po-hash-gen.y"
+{
+ /* GNU style, without line number (e.g. from Pascal .rst) */
+ po_callback_comment_filepos (yyvsp[0].string, (size_t)(-1));
+ free (yyvsp[0].string);
+ ;
+ break;}
+case 5:
+#line 150 "po-hash-gen.y"
{
/* SunOS style */
po_callback_comment_filepos (yyvsp[-4].string, yyvsp[0].number);
free (yyvsp[-4].string);
;
break;}
-case 5:
-#line 147 "po-hash-gen.y"
+case 6:
+#line 156 "po-hash-gen.y"
{
/* Solaris style */
po_callback_comment_filepos (yyvsp[-5].string, yyvsp[0].number);
free (yyvsp[-5].string);
;
break;}
-case 6:
-#line 153 "po-hash-gen.y"
+case 7:
+#line 162 "po-hash-gen.y"
{
/* GNU style, but STRING is `file'. Esoteric, but it
happened. */
}
return 1;
}
-#line 160 "po-hash-gen.y"
+#line 169 "po-hash-gen.y"
static char *buf;
static size_t bufmax;
size_t bufpos;
- int n;
+ size_t n;
int c;
for (;;)
typedef union
{
char *string;
- int number;
+ size_t number;
} YYSTYPE;
#define STRING 257
#define NUMBER 258
# include <config.h>
#endif
+#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include "message.h"
#include "x-java.h"
#include "xgettext.h"
-#include "system.h"
+#include "xmalloc.h"
+#include "strstr.h"
typedef enum
{
} char_buf;
+typedef struct _object_list
+{
+ int num_obj;
+ int max_num_obj;
+ void **objects;
+} object_list;
+
+#define INITIAL_OBJECT_LIST_SIZE 10
+#define OBJECT_LIST_GROWTH 10
+
+typedef struct _java_keyword
+{
+ char *keyword;
+ int msgid_arg;
+ int msgid_plural_arg;
+} java_keyword;
+
+
/* Prototypes for local functions. Needed to ensure compiler checking of
function argument counts despite of K&R C function definition syntax. */
static char_buf *create_char_buf PARAMS ((void));
static inline bool isdot PARAMS ((char *s));
static char *translate_esc PARAMS ((char *s));
static bool do_compare PARAMS ((const char *s1, const char *s2));
-static bool is_keyword PARAMS ((const char *s));
+static java_keyword *is_keyword PARAMS ((const char *s));
static void free_global PARAMS ((void));
parser_global->line_no++;
}
-#line 550 "x-java.c-tmp"
+static void
+strip_ending_spaces (str)
+ char *str;
+{
+ int len = strlen (str);
+
+ while (isspace (str[len--]))
+ ;
+ str[len] = '\0';
+}
+#line 581 "x-java.c-tmp"
/* Macros after this point can all be overridden by user definitions in
* section 1.
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 146 "./x-java.l"
+#line 177 "./x-java.l"
-#line 704 "x-java.c-tmp"
+#line 735 "x-java.c-tmp"
if ( yy_init )
{
case 1:
YY_RULE_SETUP
-#line 148 "./x-java.l"
+#line 179 "./x-java.l"
{
int c;
int last;
}
str = get_string (charbuf);
destroy_charbuf (charbuf);
+ strip_ending_spaces (str);
parser_global->comment = str;
return JAVA_COMMENT;
}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 170 "./x-java.l"
+#line 202 "./x-java.l"
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 171 "./x-java.l"
+#line 203 "./x-java.l"
{
int c;
char *str;
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 186 "./x-java.l"
+#line 218 "./x-java.l"
{
parser_global->word = yytext;
return JAVA_WORD;
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 191 "./x-java.l"
+#line 223 "./x-java.l"
{
parser_global->flow = yytext;
return JAVA_FLOW;
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 196 "./x-java.l"
+#line 228 "./x-java.l"
{
parser_global->operator = yytext;
return JAVA_OPERATOR;
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 201 "./x-java.l"
+#line 233 "./x-java.l"
/* ignore whitespace */
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 203 "./x-java.l"
+#line 235 "./x-java.l"
{
parser_global->comment = xstrdup (yytext + 2);
return JAVA_COMMENT;
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 207 "./x-java.l"
+#line 239 "./x-java.l"
parser_global->line_no++;
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 208 "./x-java.l"
+#line 240 "./x-java.l"
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 209 "./x-java.l"
+#line 241 "./x-java.l"
YY_BREAK
case YY_STATE_EOF(INITIAL):
-#line 210 "./x-java.l"
+#line 242 "./x-java.l"
return -1;
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 211 "./x-java.l"
+#line 243 "./x-java.l"
ECHO;
YY_BREAK
-#line 896 "x-java.c-tmp"
+#line 928 "x-java.c-tmp"
case YY_END_OF_BUFFER:
{
return 0;
}
#endif
-#line 211 "./x-java.l"
+#line 243 "./x-java.l"
static char *
return n;
}
+static object_list *
+object_list_alloc ()
+{
+ object_list *list = xmalloc (sizeof (object_list));
+ list->max_num_obj = INITIAL_OBJECT_LIST_SIZE;
+ list->num_obj = 0;
+ list->objects = xmalloc (sizeof (void *) * INITIAL_OBJECT_LIST_SIZE);
+ return list;
+}
+
+static void
+object_list_destroy (list)
+ object_list *list;
+{
+ free (list->objects);
+ free (list);
+}
+
+static int
+get_num_objects (list)
+ const object_list *list;
+{
+ return list->num_obj;
+}
+
+static void *
+get_object (list, i)
+ const object_list *list;
+ int i;
+{
+ return list->objects[i];
+}
+
+static void
+add_object (list, object)
+ object_list *list;
+ void *object;
+{
+ if (list->num_obj + 1 >= list->max_num_obj)
+ {
+ // resize
+ list->max_num_obj += OBJECT_LIST_GROWTH;
+ list->objects =
+ xrealloc (list->objects, list->max_num_obj * sizeof (void *));
+ }
+ list->objects[list->num_obj ++] = object;
+}
+
/* options */
static bool extract_all_strings = false;
void
-x_java_extract_all ()
+x_java_extract_all ()
{
extract_all_strings = true;
}
-static string_list_ty *java_keywords = NULL;
+
+static java_keyword *
+alloc_keyword (keyword, arg1, arg2)
+ const char *keyword;
+ int arg1;
+ int arg2;
+{
+ java_keyword *jk = xmalloc (sizeof (java_keyword));
+ jk->keyword = xstrdup (keyword);
+ jk->msgid_arg = arg1;
+ jk->msgid_plural_arg = arg2;
+ return jk;
+}
+
+static object_list *java_keywords = NULL;
+
+
+/**
+ * Extract the keyword from a keyword indata string.
+ */
+static char *
+extract_keyword (key)
+ const char *key;
+{
+ char *s = strchr (key, ':');
+ char *new_string;
+
+ new_string = xstrdup (key);
+ if (s != NULL)
+ new_string[s - key] = '\0';
+ return new_string;
+}
+
+/**
+ * Extract the msgid arg number from a keyword indata string.
+ */
+static int
+extract_msgid_arg (key)
+ const char *key;
+{
+ char *s = strchr (key, ':');
+ int arg;
+
+ if (s != NULL)
+ {
+ s ++;
+ arg = strtol (s, &s, 10);
+ }
+ else
+ {
+ arg = 1;
+ }
+ return arg;
+}
+
+/**
+ * Extract the msgid plural arg number from a keyword indata string,
+ * if any.
+ */
+static int
+extract_msgid_plural_arg (key)
+ const char *key;
+{
+ char *s = strchr (key, ',');
+ int arg;
+ if (s != NULL)
+ {
+ s ++;
+ arg = strtol (s, &s, 10);
+ }
+ else
+ {
+ arg = 0;
+ }
+ return arg;
+}
+
/**
* Try to match a string against the keyword. If substring_match is
/**
* Check if a string is a keyword or not.
*/
-static bool
+static java_keyword *
is_keyword (s)
const char *s;
{
int i;
+ int num_keywords = get_num_objects (java_keywords);
+ java_keyword *kw;
- for (i = 0; i < java_keywords->nitems; i++)
- if (do_compare (s, java_keywords->item[i]))
- return true;
- return false;
+ for (i = 0; i < num_keywords; i++)
+ {
+ kw = (java_keyword *) get_object (java_keywords, i);
+
+ if (do_compare (s, kw->keyword))
+ return kw;
+ }
+ return NULL;
}
/**
x_java_keyword (keyword)
const char *keyword;
{
- if (keyword == NULL) {
- if (java_keywords != NULL) {
- string_list_destroy (java_keywords);
- java_keywords = NULL;
+ int arg1;
+ int arg2;
+ char *kw;
+
+ if (keyword == NULL)
+ {
+ if (java_keywords != NULL)
+ {
+ object_list_destroy (java_keywords);
+ java_keywords = NULL;
+ }
+ return;
}
- return;
- }
if (java_keywords == NULL)
- java_keywords = string_list_alloc ();
+ {
+ java_keywords = object_list_alloc ();
+ }
- string_list_append (java_keywords, keyword);
+ kw = extract_keyword (keyword);
+ arg1 = extract_msgid_arg (keyword);
+ arg2 = extract_msgid_plural_arg (keyword);
+ add_object (java_keywords, alloc_keyword (kw, arg1, arg2));
}
PARSER_STATE last_state = STATE_NONE;
char *str;
char *key;
+ message_ty *plural;
message_list_ty *mlp = mdlp->item[0]->messages;
+ java_keyword *current_keyword = NULL;
+ java_keyword *keyword;
+ int argument_counter = 0;
if (java_keywords == NULL)
{
/* ops, no standard keywords */
x_java_keyword ("gettext"); /* GettextResource.gettext */
- x_java_keyword ("ngettext"); /* GettextResource.ngettext */
+ x_java_keyword ("ngettext:1,2"); /* GettextResource.ngettext */
x_java_keyword ("getString"); /* ResourceBundle.getString */
}
{
case JAVA_WORD:
+ if (state == STATE_KEYWORD)
+ {
+ last_state = STATE_KEYWORD;
+ argument_counter ++;
+ }
if (state == STATE_INVOCATION)
{
char *k2;
}
/* For java we try to match both things like object.methodCall()
and methodCall(). */
- if (is_keyword (key) || is_keyword (parser_global->word))
+ if ((keyword = is_keyword (key)) != NULL
+ || (keyword = is_keyword (parser_global->word)) != NULL)
{
+ current_keyword = keyword;
free (key);
state = STATE_KEYWORD;
+ argument_counter = 1;
}
break;
lex_pos_ty pos;
pos.file_name = logical_file_name;
pos.line_number = parser_global->line_no;
- state = STATE_NONE;
- last_state = STATE_NONE;
+ if (extract_all_strings)
+ {
+ remember_a_message (mlp, str, &pos);
+ }
+ else if (!extract_all_strings
+ && argument_counter == current_keyword->msgid_arg)
+ {
+ plural = remember_a_message (mlp, str, &pos);
+ if (current_keyword->msgid_plural_arg == 0)
+ {
+ /**
+ * we don't expect any plural arg, reset state
+ */
+ state = STATE_NONE;
+ last_state = STATE_NONE;
+ argument_counter = 0;
+ }
+ else
+ {
+ argument_counter ++;
+ }
- remember_a_message (mlp, str, &pos);
+ }
+ else if (!extract_all_strings &&
+ argument_counter == current_keyword->msgid_plural_arg)
+ {
+ remember_a_message_plural (plural, str, &pos);
+ state = STATE_NONE;
+ last_state = STATE_NONE;
+ argument_counter = 0;
+ }
+ }
+
+ if (extract_all_strings)
+ {
+ state = STATE_NONE;
+ last_state = STATE_NONE;
}
if (state == STATE_WORD && isdot (parser_global->flow))
case JAVA_COMMENT:
state = STATE_NONE;
+ last_state = STATE_NONE;
xgettext_comment_add (parser_global->comment);
break;
STDBOOL_H = @STDBOOL_H@
STRIP = @STRIP@
TESTJAVA = @TESTJAVA@
-TEXI2HTML = @TEXI2HTML@
TEXI2PDF = @TEXI2PDF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@