diff options
author | Bruno Haible <bruno@clisp.org> | 2003-11-16 15:17:16 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:11:15 +0200 |
commit | f31d09ff2a6745a3f8501b3396bfcf81c0ba0982 (patch) | |
tree | 81361dea18dc86d3a3d52d581daf1b5322bd5c5d | |
parent | d73a2fcfa69f9291c9ac6fa6d7f92dbad26a88fc (diff) | |
download | external_gettext-f31d09ff2a6745a3f8501b3396bfcf81c0ba0982.zip external_gettext-f31d09ff2a6745a3f8501b3396bfcf81c0ba0982.tar.gz external_gettext-f31d09ff2a6745a3f8501b3396bfcf81c0ba0982.tar.bz2 |
Example package demonstrating the use of gettext.
286 files changed, 15029 insertions, 0 deletions
diff --git a/gettext-tools/examples/ChangeLog b/gettext-tools/examples/ChangeLog new file mode 100644 index 0000000..df2a6b3 --- /dev/null +++ b/gettext-tools/examples/ChangeLog @@ -0,0 +1,30 @@ +2003-11-15 Bruno Haible <bruno@clisp.org> + + * Makefile.am: New file. + * README: New file. + * installpaths.in: New file. + * hello-c: New subdirectory. + * hello-c-gnome: New subdirectory. + * hello-c++: New subdirectory. + * hello-c++-qt: New subdirectory. + * hello-c++-kde: New subdirectory. + * hello-c++-gnome: New subdirectory. + * hello-objc: New subdirectory. + * hello-objc-gnustep: New subdirectory. + * hello-objc-gnome: New subdirectory. + * hello-sh: New subdirectory. + * hello-python: New subdirectory. + * hello-clisp: New subdirectory. + * hello-librep: New subdirectory. + * hello-smalltalk: New subdirectory. + * hello-java: New subdirectory. + * hello-java-awt: New subdirectory. + * hello-java-swing: New subdirectory. + * hello-gawk: New subdirectory. + * hello-pascal: New subdirectory. + * hello-ycp: New subdirectory. + * hello-tcl: New subdirectory. + * hello-tcl-tk: New subdirectory. + * hello-perl: New subdirectory. + * hello-php: New subdirectory. + diff --git a/gettext-tools/examples/Makefile.am b/gettext-tools/examples/Makefile.am new file mode 100644 index 0000000..396c1ec --- /dev/null +++ b/gettext-tools/examples/Makefile.am @@ -0,0 +1,366 @@ +## Makefile for the gettext-tools/examples subdirectory of GNU gettext +## Copyright (C) 2001-2003 Free Software Foundation, Inc. +## +## 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) +## 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. +## +## 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. + +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = 1.2 gnits +SUBDIRS = po +EXTRA_DIST = + +docdir = @docdir@ +examplesdir = $(docdir)/examples + +examples_DATA = installpaths + +EXAMPLESFILES = \ + \ + hello-c/INSTALL \ + hello-c/autogen.sh \ + hello-c/autoclean.sh \ + hello-c/hello.c \ + hello-c/Makefile.am \ + hello-c/configure.ac \ + hello-c/m4/Makefile.am \ + hello-c/po/Makevars \ + hello-c/po/POTFILES.in \ + hello-c/po/LINGUAS \ + hello-c/po/de.po \ + \ + hello-c-gnome/INSTALL \ + hello-c-gnome/autogen.sh \ + hello-c-gnome/autoclean.sh \ + hello-c-gnome/hello.c \ + hello-c-gnome/Makefile.am \ + hello-c-gnome/configure.ac \ + hello-c-gnome/m4/Makefile.am \ + hello-c-gnome/m4/gnome.m4 \ + hello-c-gnome/m4/gnome-gnorba-check.m4 \ + hello-c-gnome/m4/gnome-orbit-check.m4 \ + hello-c-gnome/po/Makevars \ + hello-c-gnome/po/POTFILES.in \ + hello-c-gnome/po/LINGUAS \ + hello-c-gnome/po/de.po \ + \ + hello-c++/INSTALL \ + hello-c++/autogen.sh \ + hello-c++/autoclean.sh \ + hello-c++/hello.cc \ + hello-c++/Makefile.am \ + hello-c++/configure.ac \ + hello-c++/m4/Makefile.am \ + hello-c++/po/Makevars \ + hello-c++/po/POTFILES.in \ + hello-c++/po/LINGUAS \ + hello-c++/po/de.po \ + \ + hello-c++-qt/INSTALL \ + hello-c++-qt/autogen.sh \ + hello-c++-qt/autoclean.sh \ + hello-c++-qt/hello.cc \ + hello-c++-qt/Makefile.am \ + hello-c++-qt/configure.ac \ + hello-c++-qt/m4/Makefile.am \ + hello-c++-qt/m4/qt.m4 \ + hello-c++-qt/po/Makefile.am \ + hello-c++-qt/po/LINGUAS \ + hello-c++-qt/po/de.po \ + \ + hello-c++-kde/INSTALL \ + hello-c++-kde/autogen.sh \ + hello-c++-kde/autoclean.sh \ + hello-c++-kde/hello.cc \ + hello-c++-kde/hellowindow.h \ + hello-c++-kde/hellowindow.cc \ + hello-c++-kde/Makefile.am \ + hello-c++-kde/configure.in.in \ + hello-c++-kde/m4/Makefile.am \ + hello-c++-kde/po/Makevars \ + hello-c++-kde/po/POTFILES.in \ + hello-c++-kde/po/LINGUAS \ + hello-c++-kde/po/de.po \ + \ + hello-c++-gnome/INSTALL \ + hello-c++-gnome/autogen.sh \ + hello-c++-gnome/autoclean.sh \ + hello-c++-gnome/hello.cc \ + hello-c++-gnome/Makefile.am \ + hello-c++-gnome/configure.ac \ + hello-c++-gnome/m4/Makefile.am \ + hello-c++-gnome/m4/gnome.m4 \ + hello-c++-gnome/m4/gnome-gnorba-check.m4 \ + hello-c++-gnome/m4/gnome-orbit-check.m4 \ + hello-c++-gnome/m4/gtk.m4 \ + hello-c++-gnome/m4/gtk--.m4 \ + hello-c++-gnome/po/Makevars \ + hello-c++-gnome/po/POTFILES.in \ + hello-c++-gnome/po/LINGUAS \ + hello-c++-gnome/po/de.po \ + \ + hello-objc/INSTALL \ + hello-objc/autogen.sh \ + hello-objc/autoclean.sh \ + hello-objc/hello.m \ + hello-objc/Makefile.am \ + hello-objc/configure.ac \ + hello-objc/m4/Makefile.am \ + hello-objc/po/Makevars \ + hello-objc/po/POTFILES.in \ + hello-objc/po/LINGUAS \ + hello-objc/po/de.po \ + \ + hello-objc-gnustep/INSTALL \ + hello-objc-gnustep/autogen.sh \ + hello-objc-gnustep/autoclean.sh \ + hello-objc-gnustep/main.m \ + hello-objc-gnustep/AppController.h \ + hello-objc-gnustep/AppController.m \ + hello-objc-gnustep/Hello.h \ + hello-objc-gnustep/Hello.m \ + hello-objc-gnustep/GNUmakefile \ + hello-objc-gnustep/po/GNUmakefile \ + hello-objc-gnustep/po/LocaleAliases \ + hello-objc-gnustep/po/LINGUAS \ + hello-objc-gnustep/po/de.po \ + \ + hello-objc-gnome/INSTALL \ + hello-objc-gnome/autogen.sh \ + hello-objc-gnome/autoclean.sh \ + hello-objc-gnome/hello.m \ + hello-objc-gnome/Makefile.am \ + hello-objc-gnome/configure.ac \ + hello-objc-gnome/m4/Makefile.am \ + hello-objc-gnome/m4/gnome.m4 \ + hello-objc-gnome/m4/gnome-gnorba-check.m4 \ + hello-objc-gnome/m4/gnome-orbit-check.m4 \ + hello-objc-gnome/po/Makevars \ + hello-objc-gnome/po/POTFILES.in \ + hello-objc-gnome/po/LINGUAS \ + hello-objc-gnome/po/de.po \ + \ + hello-sh/INSTALL \ + hello-sh/autogen.sh \ + hello-sh/autoclean.sh \ + hello-sh/hello.sh \ + hello-sh/Makefile.am \ + hello-sh/configure.ac \ + hello-sh/m4/Makefile.am \ + hello-sh/po/Makefile.am \ + hello-sh/po/LINGUAS \ + hello-sh/po/de.po \ + \ + hello-python/INSTALL \ + hello-python/autogen.sh \ + hello-python/autoclean.sh \ + hello-python/hello.py.in \ + hello-python/Makefile.am \ + hello-python/configure.ac \ + hello-python/m4/Makefile.am \ + hello-python/po/Makefile.am \ + hello-python/po/LINGUAS \ + hello-python/po/de.po \ + \ + hello-clisp/INSTALL \ + hello-clisp/autogen.sh \ + hello-clisp/autoclean.sh \ + hello-clisp/hello.lisp.in \ + hello-clisp/Makefile.am \ + hello-clisp/configure.ac \ + hello-clisp/m4/Makefile.am \ + hello-clisp/po/Makefile.am \ + hello-clisp/po/LINGUAS \ + hello-clisp/po/de.po \ + \ + hello-librep/INSTALL \ + hello-librep/autogen.sh \ + hello-librep/autoclean.sh \ + hello-librep/hello.jl.in \ + hello-librep/Makefile.am \ + hello-librep/configure.ac \ + hello-librep/m4/Makefile.am \ + hello-librep/po/Makefile.am \ + hello-librep/po/LINGUAS \ + hello-librep/po/de.po \ + \ + hello-smalltalk/INSTALL \ + hello-smalltalk/autogen.sh \ + hello-smalltalk/autoclean.sh \ + hello-smalltalk/hello.st.in \ + hello-smalltalk/Makefile.am \ + hello-smalltalk/configure.ac \ + hello-smalltalk/m4/Makefile.am \ + hello-smalltalk/po/Makefile.am \ + hello-smalltalk/po/LINGUAS \ + hello-smalltalk/po/de.po \ + \ + hello-java/INSTALL \ + hello-java/autogen.sh \ + hello-java/autoclean.sh \ + hello-java/Hello.java \ + hello-java/Makefile.am \ + hello-java/configure.ac \ + hello-java/m4/Makefile.am \ + hello-java/po/Makefile.am \ + hello-java/po/LINGUAS \ + hello-java/po/de.po \ + \ + hello-java-awt/INSTALL \ + hello-java-awt/autogen.sh \ + hello-java-awt/autoclean.sh \ + hello-java-awt/Hello.java \ + hello-java-awt/Makefile.am \ + hello-java-awt/configure.ac \ + hello-java-awt/m4/Makefile.am \ + hello-java-awt/m4/TestAWT.java \ + hello-java-awt/m4/TestAWT.class \ + hello-java-awt/po/Makefile.am \ + hello-java-awt/po/LINGUAS \ + hello-java-awt/po/de.po \ + \ + hello-java-swing/INSTALL \ + hello-java-swing/autogen.sh \ + hello-java-swing/autoclean.sh \ + hello-java-swing/Hello.java \ + hello-java-swing/Makefile.am \ + hello-java-swing/configure.ac \ + hello-java-swing/m4/Makefile.am \ + hello-java-swing/m4/TestAWT.java \ + hello-java-swing/m4/TestAWT.class \ + hello-java-swing/po/Makefile.am \ + hello-java-swing/po/LINGUAS \ + hello-java-swing/po/de.po \ + \ + hello-gawk/INSTALL \ + hello-gawk/autogen.sh \ + hello-gawk/autoclean.sh \ + hello-gawk/hello.awk \ + hello-gawk/Makefile.am \ + hello-gawk/configure.ac \ + hello-gawk/m4/Makefile.am \ + hello-gawk/po/Makefile.am \ + hello-gawk/po/LINGUAS \ + hello-gawk/po/de.po \ + \ + hello-pascal/INSTALL \ + hello-pascal/autogen.sh \ + hello-pascal/autoclean.sh \ + hello-pascal/hello.pas \ + hello-pascal/Makefile.am \ + hello-pascal/configure.ac \ + hello-pascal/m4/Makefile.am \ + hello-pascal/po/Makefile.am \ + hello-pascal/po/LINGUAS \ + hello-pascal/po/de.po \ + \ + hello-ycp/INSTALL \ + hello-ycp/autogen.sh \ + hello-ycp/autoclean.sh \ + hello-ycp/hello.ycp \ + hello-ycp/Makefile.am \ + hello-ycp/configure.ac \ + hello-ycp/m4/Makefile.am \ + hello-ycp/po/Makefile.am \ + hello-ycp/po/LINGUAS \ + hello-ycp/po/de.po \ + \ + hello-tcl/INSTALL \ + hello-tcl/autogen.sh \ + hello-tcl/autoclean.sh \ + hello-tcl/hello.tcl \ + hello-tcl/Makefile.am \ + hello-tcl/configure.ac \ + hello-tcl/m4/Makefile.am \ + hello-tcl/po/Makefile.am \ + hello-tcl/po/LINGUAS \ + hello-tcl/po/de.po \ + \ + hello-tcl-tk/INSTALL \ + hello-tcl-tk/autogen.sh \ + hello-tcl-tk/autoclean.sh \ + hello-tcl-tk/hello.tcl \ + hello-tcl-tk/Makefile.am \ + hello-tcl-tk/configure.ac \ + hello-tcl-tk/m4/Makefile.am \ + hello-tcl-tk/po/Makefile.am \ + hello-tcl-tk/po/LINGUAS \ + hello-tcl-tk/po/de.po \ + \ + hello-perl/INSTALL \ + hello-perl/autogen.sh \ + hello-perl/autoclean.sh \ + hello-perl/hello.pl \ + hello-perl/Makefile.am \ + hello-perl/configure.ac \ + hello-perl/m4/Makefile.am \ + hello-perl/po/Makefile.am \ + hello-perl/po/LINGUAS \ + hello-perl/po/de.po \ + \ + hello-php/INSTALL \ + hello-php/README \ + hello-php/autogen.sh \ + hello-php/autoclean.sh \ + hello-php/hello.php \ + hello-php/Makefile.am \ + hello-php/configure.ac \ + hello-php/m4/Makefile.am \ + hello-php/po/Makefile.am \ + hello-php/po/LINGUAS \ + hello-php/po/de.po \ + \ + README + +install-data-local: $(EXAMPLESFILES) + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + for f in $(EXAMPLESFILES); do \ + d=`echo /$$f | sed -e 's,/[^/]*$$,,'`; \ + test -z "$$d" || $(mkinstalldirs) $(DESTDIR)$(examplesdir)$$d || exit 1; \ + b=`echo $$f | sed -e 's,^.*/,,'`; \ + if test $$b = autogen.sh || test $$b = autoclean.sh; then \ + echo "$(INSTALL_SCRIPT) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f"; \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f; \ + fi; \ + done + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + for f in $(EXAMPLESFILES); do \ + d=`echo /$$f | sed -e 's,/[^/]*$$,,'`; \ + test -z "$$d" || $(mkinstalldirs) $(DESTDIR)$(examplesdir)$$d || exit 1; \ + done + +uninstall-local: + for f in $(EXAMPLESFILES); do \ + rm -f $(DESTDIR)$(examplesdir)/$$f; \ + done + +EXTRA_DIST += $(EXAMPLESFILES) + +# Temporary directories created by po/Makefile. +CLEANFILES = tmp-hello-* + + +# VMS support. + +EXTRA_DIST += Makefile.vms + + +# Woe32 support. + +EXTRA_DIST += Makefile.msvc diff --git a/gettext-tools/examples/Makefile.in b/gettext-tools/examples/Makefile.in new file mode 100644 index 0000000..1e43301 --- /dev/null +++ b/gettext-tools/examples/Makefile.in @@ -0,0 +1,878 @@ +# Makefile.in generated by automake 1.7.8 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDJAVA = @BUILDJAVA@ +BUILDJAVAEXE = @BUILDJAVAEXE@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLASSPATH = @CLASSPATH@ +CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING = @CROSS_COMPILING@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DVIPS = @DVIPS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMACS = @EMACS@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FNMATCH_H = @FNMATCH_H@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GENCAT = @GENCAT@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_GCJ = @HAVE_GCJ@ +HAVE_GCJ_C = @HAVE_GCJ_C@ +HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ +HAVE_GIJ = @HAVE_GIJ@ +HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ +HAVE_JAVA = @HAVE_JAVA@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ +HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ +HAVE_JIKES = @HAVE_JIKES@ +HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ +HAVE_JRE = @HAVE_JRE@ +HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ +HAVE_JVIEW = @HAVE_JVIEW@ +HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ +HAVE_LIBEXPAT = @HAVE_LIBEXPAT@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +JAR = @JAR@ +JAVA = @JAVA@ +JAVAC = @JAVAC@ +LDFLAGS = @LDFLAGS@ +LIBEXPAT = @LIBEXPAT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LOCALE_FR = @LOCALE_FR@ +LTALLOCA = @LTALLOCA@ +LTLIBEXPAT = @LTLIBEXPAT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +MSGMERGE = @MSGMERGE@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +RELOCATABLE = @RELOCATABLE@ +RELOCATABLE_VIA_LD_FALSE = @RELOCATABLE_VIA_LD_FALSE@ +RELOCATABLE_VIA_LD_TRUE = @RELOCATABLE_VIA_LD_TRUE@ +SET_MAKE = @SET_MAKE@ +SET_RELOCATABLE = @SET_RELOCATABLE@ +SHELL = @SHELL@ +STDBOOL_H = @STDBOOL_H@ +STRIP = @STRIP@ +TESTJAVA = @TESTJAVA@ +TEXI2PDF = @TEXI2PDF@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +aclocaldir = @aclocaldir@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ + +docdir = @docdir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +AUTOMAKE_OPTIONS = 1.2 gnits +SUBDIRS = po + + +# VMS support. + +# Woe32 support. +EXTRA_DIST = $(EXAMPLESFILES) Makefile.vms Makefile.msvc +examplesdir = $(docdir)/examples + +examples_DATA = installpaths + +EXAMPLESFILES = \ + \ + hello-c/INSTALL \ + hello-c/autogen.sh \ + hello-c/autoclean.sh \ + hello-c/hello.c \ + hello-c/Makefile.am \ + hello-c/configure.ac \ + hello-c/m4/Makefile.am \ + hello-c/po/Makevars \ + hello-c/po/POTFILES.in \ + hello-c/po/LINGUAS \ + hello-c/po/de.po \ + \ + hello-c-gnome/INSTALL \ + hello-c-gnome/autogen.sh \ + hello-c-gnome/autoclean.sh \ + hello-c-gnome/hello.c \ + hello-c-gnome/Makefile.am \ + hello-c-gnome/configure.ac \ + hello-c-gnome/m4/Makefile.am \ + hello-c-gnome/m4/gnome.m4 \ + hello-c-gnome/m4/gnome-gnorba-check.m4 \ + hello-c-gnome/m4/gnome-orbit-check.m4 \ + hello-c-gnome/po/Makevars \ + hello-c-gnome/po/POTFILES.in \ + hello-c-gnome/po/LINGUAS \ + hello-c-gnome/po/de.po \ + \ + hello-c++/INSTALL \ + hello-c++/autogen.sh \ + hello-c++/autoclean.sh \ + hello-c++/hello.cc \ + hello-c++/Makefile.am \ + hello-c++/configure.ac \ + hello-c++/m4/Makefile.am \ + hello-c++/po/Makevars \ + hello-c++/po/POTFILES.in \ + hello-c++/po/LINGUAS \ + hello-c++/po/de.po \ + \ + hello-c++-qt/INSTALL \ + hello-c++-qt/autogen.sh \ + hello-c++-qt/autoclean.sh \ + hello-c++-qt/hello.cc \ + hello-c++-qt/Makefile.am \ + hello-c++-qt/configure.ac \ + hello-c++-qt/m4/Makefile.am \ + hello-c++-qt/m4/qt.m4 \ + hello-c++-qt/po/Makefile.am \ + hello-c++-qt/po/LINGUAS \ + hello-c++-qt/po/de.po \ + \ + hello-c++-kde/INSTALL \ + hello-c++-kde/autogen.sh \ + hello-c++-kde/autoclean.sh \ + hello-c++-kde/hello.cc \ + hello-c++-kde/hellowindow.h \ + hello-c++-kde/hellowindow.cc \ + hello-c++-kde/Makefile.am \ + hello-c++-kde/configure.in.in \ + hello-c++-kde/m4/Makefile.am \ + hello-c++-kde/po/Makevars \ + hello-c++-kde/po/POTFILES.in \ + hello-c++-kde/po/LINGUAS \ + hello-c++-kde/po/de.po \ + \ + hello-c++-gnome/INSTALL \ + hello-c++-gnome/autogen.sh \ + hello-c++-gnome/autoclean.sh \ + hello-c++-gnome/hello.cc \ + hello-c++-gnome/Makefile.am \ + hello-c++-gnome/configure.ac \ + hello-c++-gnome/m4/Makefile.am \ + hello-c++-gnome/m4/gnome.m4 \ + hello-c++-gnome/m4/gnome-gnorba-check.m4 \ + hello-c++-gnome/m4/gnome-orbit-check.m4 \ + hello-c++-gnome/m4/gtk.m4 \ + hello-c++-gnome/m4/gtk--.m4 \ + hello-c++-gnome/po/Makevars \ + hello-c++-gnome/po/POTFILES.in \ + hello-c++-gnome/po/LINGUAS \ + hello-c++-gnome/po/de.po \ + \ + hello-objc/INSTALL \ + hello-objc/autogen.sh \ + hello-objc/autoclean.sh \ + hello-objc/hello.m \ + hello-objc/Makefile.am \ + hello-objc/configure.ac \ + hello-objc/m4/Makefile.am \ + hello-objc/po/Makevars \ + hello-objc/po/POTFILES.in \ + hello-objc/po/LINGUAS \ + hello-objc/po/de.po \ + \ + hello-objc-gnustep/INSTALL \ + hello-objc-gnustep/autogen.sh \ + hello-objc-gnustep/autoclean.sh \ + hello-objc-gnustep/main.m \ + hello-objc-gnustep/AppController.h \ + hello-objc-gnustep/AppController.m \ + hello-objc-gnustep/Hello.h \ + hello-objc-gnustep/Hello.m \ + hello-objc-gnustep/GNUmakefile \ + hello-objc-gnustep/po/GNUmakefile \ + hello-objc-gnustep/po/LocaleAliases \ + hello-objc-gnustep/po/LINGUAS \ + hello-objc-gnustep/po/de.po \ + \ + hello-objc-gnome/INSTALL \ + hello-objc-gnome/autogen.sh \ + hello-objc-gnome/autoclean.sh \ + hello-objc-gnome/hello.m \ + hello-objc-gnome/Makefile.am \ + hello-objc-gnome/configure.ac \ + hello-objc-gnome/m4/Makefile.am \ + hello-objc-gnome/m4/gnome.m4 \ + hello-objc-gnome/m4/gnome-gnorba-check.m4 \ + hello-objc-gnome/m4/gnome-orbit-check.m4 \ + hello-objc-gnome/po/Makevars \ + hello-objc-gnome/po/POTFILES.in \ + hello-objc-gnome/po/LINGUAS \ + hello-objc-gnome/po/de.po \ + \ + hello-sh/INSTALL \ + hello-sh/autogen.sh \ + hello-sh/autoclean.sh \ + hello-sh/hello.sh \ + hello-sh/Makefile.am \ + hello-sh/configure.ac \ + hello-sh/m4/Makefile.am \ + hello-sh/po/Makefile.am \ + hello-sh/po/LINGUAS \ + hello-sh/po/de.po \ + \ + hello-python/INSTALL \ + hello-python/autogen.sh \ + hello-python/autoclean.sh \ + hello-python/hello.py.in \ + hello-python/Makefile.am \ + hello-python/configure.ac \ + hello-python/m4/Makefile.am \ + hello-python/po/Makefile.am \ + hello-python/po/LINGUAS \ + hello-python/po/de.po \ + \ + hello-clisp/INSTALL \ + hello-clisp/autogen.sh \ + hello-clisp/autoclean.sh \ + hello-clisp/hello.lisp.in \ + hello-clisp/Makefile.am \ + hello-clisp/configure.ac \ + hello-clisp/m4/Makefile.am \ + hello-clisp/po/Makefile.am \ + hello-clisp/po/LINGUAS \ + hello-clisp/po/de.po \ + \ + hello-librep/INSTALL \ + hello-librep/autogen.sh \ + hello-librep/autoclean.sh \ + hello-librep/hello.jl.in \ + hello-librep/Makefile.am \ + hello-librep/configure.ac \ + hello-librep/m4/Makefile.am \ + hello-librep/po/Makefile.am \ + hello-librep/po/LINGUAS \ + hello-librep/po/de.po \ + \ + hello-smalltalk/INSTALL \ + hello-smalltalk/autogen.sh \ + hello-smalltalk/autoclean.sh \ + hello-smalltalk/hello.st.in \ + hello-smalltalk/Makefile.am \ + hello-smalltalk/configure.ac \ + hello-smalltalk/m4/Makefile.am \ + hello-smalltalk/po/Makefile.am \ + hello-smalltalk/po/LINGUAS \ + hello-smalltalk/po/de.po \ + \ + hello-java/INSTALL \ + hello-java/autogen.sh \ + hello-java/autoclean.sh \ + hello-java/Hello.java \ + hello-java/Makefile.am \ + hello-java/configure.ac \ + hello-java/m4/Makefile.am \ + hello-java/po/Makefile.am \ + hello-java/po/LINGUAS \ + hello-java/po/de.po \ + \ + hello-java-awt/INSTALL \ + hello-java-awt/autogen.sh \ + hello-java-awt/autoclean.sh \ + hello-java-awt/Hello.java \ + hello-java-awt/Makefile.am \ + hello-java-awt/configure.ac \ + hello-java-awt/m4/Makefile.am \ + hello-java-awt/m4/TestAWT.java \ + hello-java-awt/m4/TestAWT.class \ + hello-java-awt/po/Makefile.am \ + hello-java-awt/po/LINGUAS \ + hello-java-awt/po/de.po \ + \ + hello-java-swing/INSTALL \ + hello-java-swing/autogen.sh \ + hello-java-swing/autoclean.sh \ + hello-java-swing/Hello.java \ + hello-java-swing/Makefile.am \ + hello-java-swing/configure.ac \ + hello-java-swing/m4/Makefile.am \ + hello-java-swing/m4/TestAWT.java \ + hello-java-swing/m4/TestAWT.class \ + hello-java-swing/po/Makefile.am \ + hello-java-swing/po/LINGUAS \ + hello-java-swing/po/de.po \ + \ + hello-gawk/INSTALL \ + hello-gawk/autogen.sh \ + hello-gawk/autoclean.sh \ + hello-gawk/hello.awk \ + hello-gawk/Makefile.am \ + hello-gawk/configure.ac \ + hello-gawk/m4/Makefile.am \ + hello-gawk/po/Makefile.am \ + hello-gawk/po/LINGUAS \ + hello-gawk/po/de.po \ + \ + hello-pascal/INSTALL \ + hello-pascal/autogen.sh \ + hello-pascal/autoclean.sh \ + hello-pascal/hello.pas \ + hello-pascal/Makefile.am \ + hello-pascal/configure.ac \ + hello-pascal/m4/Makefile.am \ + hello-pascal/po/Makefile.am \ + hello-pascal/po/LINGUAS \ + hello-pascal/po/de.po \ + \ + hello-ycp/INSTALL \ + hello-ycp/autogen.sh \ + hello-ycp/autoclean.sh \ + hello-ycp/hello.ycp \ + hello-ycp/Makefile.am \ + hello-ycp/configure.ac \ + hello-ycp/m4/Makefile.am \ + hello-ycp/po/Makefile.am \ + hello-ycp/po/LINGUAS \ + hello-ycp/po/de.po \ + \ + hello-tcl/INSTALL \ + hello-tcl/autogen.sh \ + hello-tcl/autoclean.sh \ + hello-tcl/hello.tcl \ + hello-tcl/Makefile.am \ + hello-tcl/configure.ac \ + hello-tcl/m4/Makefile.am \ + hello-tcl/po/Makefile.am \ + hello-tcl/po/LINGUAS \ + hello-tcl/po/de.po \ + \ + hello-tcl-tk/INSTALL \ + hello-tcl-tk/autogen.sh \ + hello-tcl-tk/autoclean.sh \ + hello-tcl-tk/hello.tcl \ + hello-tcl-tk/Makefile.am \ + hello-tcl-tk/configure.ac \ + hello-tcl-tk/m4/Makefile.am \ + hello-tcl-tk/po/Makefile.am \ + hello-tcl-tk/po/LINGUAS \ + hello-tcl-tk/po/de.po \ + \ + hello-perl/INSTALL \ + hello-perl/autogen.sh \ + hello-perl/autoclean.sh \ + hello-perl/hello.pl \ + hello-perl/Makefile.am \ + hello-perl/configure.ac \ + hello-perl/m4/Makefile.am \ + hello-perl/po/Makefile.am \ + hello-perl/po/LINGUAS \ + hello-perl/po/de.po \ + \ + hello-php/INSTALL \ + hello-php/README \ + hello-php/autogen.sh \ + hello-php/autoclean.sh \ + hello-php/hello.php \ + hello-php/Makefile.am \ + hello-php/configure.ac \ + hello-php/m4/Makefile.am \ + hello-php/po/Makefile.am \ + hello-php/po/LINGUAS \ + hello-php/po/de.po \ + \ + README + + +# Temporary directories created by po/Makefile. +CLEANFILES = tmp-hello-* +subdir = examples +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = installpaths +DIST_SOURCES = +DATA = $(examples_DATA) + + +RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ + ps-recursive install-info-recursive uninstall-info-recursive \ + all-recursive install-data-recursive install-exec-recursive \ + installdirs-recursive install-recursive uninstall-recursive \ + check-recursive installcheck-recursive +DIST_COMMON = README $(srcdir)/Makefile.in ChangeLog Makefile.am \ + installpaths.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits examples/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +installpaths: $(top_builddir)/config.status installpaths.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +examplesDATA_INSTALL = $(INSTALL_DATA) +install-examplesDATA: $(examples_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + @list='$(examples_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(examplesDATA_INSTALL) $$d$$p $(DESTDIR)$(examplesdir)/$$f"; \ + $(examplesDATA_INSTALL) $$d$$p $(DESTDIR)$(examplesdir)/$$f; \ + done + +uninstall-examplesDATA: + @$(NORMAL_UNINSTALL) + @list='$(examples_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(examplesdir)/$$f"; \ + rm -f $(DESTDIR)$(examplesdir)/$$f; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $$MAKEFLAGS; amf=$$2; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if (etags --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + else \ + include_option=--include; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + $(mkinstalldirs) $(distdir)/hello-c $(distdir)/hello-c++ $(distdir)/hello-c++-gnome $(distdir)/hello-c++-gnome/m4 $(distdir)/hello-c++-gnome/po $(distdir)/hello-c++-kde $(distdir)/hello-c++-kde/m4 $(distdir)/hello-c++-kde/po $(distdir)/hello-c++-qt $(distdir)/hello-c++-qt/m4 $(distdir)/hello-c++-qt/po $(distdir)/hello-c++/m4 $(distdir)/hello-c++/po $(distdir)/hello-c-gnome $(distdir)/hello-c-gnome/m4 $(distdir)/hello-c-gnome/po $(distdir)/hello-c/m4 $(distdir)/hello-c/po $(distdir)/hello-clisp $(distdir)/hello-clisp/m4 $(distdir)/hello-clisp/po $(distdir)/hello-gawk $(distdir)/hello-gawk/m4 $(distdir)/hello-gawk/po $(distdir)/hello-java $(distdir)/hello-java-awt $(distdir)/hello-java-awt/m4 $(distdir)/hello-java-awt/po $(distdir)/hello-java-swing $(distdir)/hello-java-swing/m4 $(distdir)/hello-java-swing/po $(distdir)/hello-java/m4 $(distdir)/hello-java/po $(distdir)/hello-librep $(distdir)/hello-librep/m4 $(distdir)/hello-librep/po $(distdir)/hello-objc $(distdir)/hello-objc-gnome $(distdir)/hello-objc-gnome/m4 $(distdir)/hello-objc-gnome/po $(distdir)/hello-objc-gnustep $(distdir)/hello-objc-gnustep/po $(distdir)/hello-objc/m4 $(distdir)/hello-objc/po $(distdir)/hello-pascal $(distdir)/hello-pascal/m4 $(distdir)/hello-pascal/po $(distdir)/hello-perl $(distdir)/hello-perl/m4 $(distdir)/hello-perl/po $(distdir)/hello-php $(distdir)/hello-php/m4 $(distdir)/hello-php/po $(distdir)/hello-python $(distdir)/hello-python/m4 $(distdir)/hello-python/po $(distdir)/hello-sh $(distdir)/hello-sh/m4 $(distdir)/hello-sh/po $(distdir)/hello-smalltalk $(distdir)/hello-smalltalk/m4 $(distdir)/hello-smalltalk/po $(distdir)/hello-tcl $(distdir)/hello-tcl-tk $(distdir)/hello-tcl-tk/m4 $(distdir)/hello-tcl-tk/po $(distdir)/hello-tcl/m4 $(distdir)/hello-tcl/po $(distdir)/hello-ycp $(distdir)/hello-ycp/m4 $(distdir)/hello-ycp/po + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: installdirs-local + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local install-examplesDATA + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-examplesDATA uninstall-info-am uninstall-local + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive ctags \ + ctags-recursive distclean distclean-generic distclean-libtool \ + distclean-recursive distclean-tags distdir dvi dvi-am \ + dvi-recursive info info-am info-recursive install install-am \ + install-data install-data-am install-data-local \ + install-data-recursive install-examplesDATA install-exec \ + install-exec-am install-exec-recursive install-info \ + install-info-am install-info-recursive install-man \ + install-recursive install-strip installcheck installcheck-am \ + installdirs installdirs-am installdirs-recursive \ + maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am \ + pdf-recursive ps ps-am ps-recursive tags tags-recursive \ + uninstall uninstall-am uninstall-examplesDATA uninstall-info-am \ + uninstall-info-recursive uninstall-local uninstall-recursive + + +install-data-local: $(EXAMPLESFILES) + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + for f in $(EXAMPLESFILES); do \ + d=`echo /$$f | sed -e 's,/[^/]*$$,,'`; \ + test -z "$$d" || $(mkinstalldirs) $(DESTDIR)$(examplesdir)$$d || exit 1; \ + b=`echo $$f | sed -e 's,^.*/,,'`; \ + if test $$b = autogen.sh || test $$b = autoclean.sh; then \ + echo "$(INSTALL_SCRIPT) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f"; \ + $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(examplesdir)/$$f; \ + fi; \ + done + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(examplesdir) + for f in $(EXAMPLESFILES); do \ + d=`echo /$$f | sed -e 's,/[^/]*$$,,'`; \ + test -z "$$d" || $(mkinstalldirs) $(DESTDIR)$(examplesdir)$$d || exit 1; \ + done + +uninstall-local: + for f in $(EXAMPLESFILES); do \ + rm -f $(DESTDIR)$(examplesdir)/$$f; \ + done +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gettext-tools/examples/Makefile.msvc b/gettext-tools/examples/Makefile.msvc new file mode 100644 index 0000000..e75f44a --- /dev/null +++ b/gettext-tools/examples/Makefile.msvc @@ -0,0 +1,27 @@ +# -*- Makefile -*- for gettext-tools/projects + +#### Start of system configuration section. #### + +#### End of system configuration section. #### + +SHELL = /bin/sh + +all : + +install : all + +installdirs : + +uninstall : + +check : + +mostlyclean : clean + +clean : force + +distclean : clean + +maintainer-clean : distclean + +force : diff --git a/gettext-tools/examples/Makefile.vms b/gettext-tools/examples/Makefile.vms new file mode 100644 index 0000000..a7d4c0d --- /dev/null +++ b/gettext-tools/examples/Makefile.vms @@ -0,0 +1,32 @@ +# -*- Makefile -*- for gettext-tools/projects on VMS using the MMS utility + +#### Start of system configuration section. #### + +#### End of system configuration section. #### + +all : + write sys$output "Nothing to be done for 'all'." + +install : all + write sys$output "Nothing else to be done for 'install'." + +installdirs : + write sys$output "Nothing to be done for 'installdirs'." + +uninstall : + write sys$output "Nothing to be done for 'uninstall'." + +check : + write sys$output "Nothing to be done for 'check'." + +mostlyclean : clean + write sys$output "Nothing else to be done for 'mostlyclean'." + +clean : + write sys$output "Nothing to be done for 'clean'." + +distclean : clean + write sys$output "Nothing else to be done for 'distclean'." + +maintainer-clean : distclean + write sys$output "Nothing else to be done for 'maintainer-clean'." diff --git a/gettext-tools/examples/README b/gettext-tools/examples/README new file mode 100644 index 0000000..87833da --- /dev/null +++ b/gettext-tools/examples/README @@ -0,0 +1,44 @@ +This directory contains simple examples of the use of GNU gettext. +Each example is a simple "hello world" program with a very small message +catalog, written in a particular programming language for a particular +environment. + + Example Language GUI Environment + + hello-c C + hello-c-gnome C GNOME + hello-c++ C++ + hello-c++-qt C++ Qt + hello-c++-kde C++ KDE + hello-c++-gnome C++ GNOME + hello-objc ObjectiveC + hello-objc-gnustep ObjectiveC GNUstep + hello-objc-gnome ObjectiveC GNOME + hello-sh Shell + hello-python Python + hello-clisp Lisp + hello-librep librep + hello-smalltalk Smalltalk + hello-java Java + hello-java-awt Java AWT + hello-java-swing Java Swing + hello-gawk awk + hello-pascal Pascal + hello-ycp YCP libyui + hello-tcl Tcl + hello-tcl-tk Tcl Tk + hello-perl Perl + hello-php PHP + +Before building an example, you need to + 1. Build and install the GNU gettext package, as described in the INSTALL + file. + 2. cd to the example and do + ./autogen.sh + 3. Then you can build the example as usual: + ./configure --prefix=/some/prefix + make + make install + and see it work by executing + /some/prefix/bin/hello + diff --git a/gettext-tools/examples/hello-c++-gnome/INSTALL b/gettext-tools/examples/hello-c++-gnome/INSTALL new file mode 100644 index 0000000..8b53e62 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/INSTALL @@ -0,0 +1,10 @@ +This example relies on: + - the GNOME libraries (libgnomeui, libgnome, libgnomesupport, libart_lgpl) + and their dependencies: imlib (libgdk_imlib), audiofile (libaudiofile), + esound (libesd), zlib (libz). + - the GTK libraries (libgtk, libgdk) + - the glib libraries (libglib, libgmodule) + - the X11 libraries + - the GTK / C++ bindings (libgtkmm, libgdkmm) + - the C++ signal/slot library (libsigc++) + - the C++ runtime libraries (libstdc++) diff --git a/gettext-tools/examples/hello-c++-gnome/Makefile.am b/gettext-tools/examples/hello-c++-gnome/Makefile.am new file mode 100644 index 0000000..9145c50 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.cc + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gnome.h include file is found. +INCLUDES = $(GTKMM_CFLAGS) $(GNOME_INCLUDEDIR) + +# Link time dependencies. +LDADD = $(GTKMM_LIBS) $(GNOME_LIBDIR) $(GNOMEUI_LIBS) @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c++-gnome/autoclean.sh b/gettext-tools/examples/hello-c++-gnome/autoclean.sh new file mode 100755 index 0000000..980bf44 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/autoclean.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-c++-gnome/autogen.sh b/gettext-tools/examples/hello-c++-gnome/autogen.sh new file mode 100755 index 0000000..755010a --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-c++-gnome/configure.ac b/gettext-tools/examples/hello-c++-gnome/configure.ac new file mode 100644 index 0000000..9be237c --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/configure.ac @@ -0,0 +1,26 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.cc) +AM_INIT_AUTOMAKE(hello-c++-gnome, 0) + +AC_PROG_CXX + +GNOME_INIT +GTKMM_CFLAGS=`gtkmm-config --cflags` +AC_SUBST([GTKMM_CFLAGS]) +GTKMM_LIBS=`gtkmm-config --libs` +AC_SUBST([GTKMM_LIBS]) + +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-c++-gnome/hello.cc b/gettext-tools/examples/hello-c++-gnome/hello.cc new file mode 100644 index 0000000..15ae0a9 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/hello.cc @@ -0,0 +1,88 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the C++ program. */ + + +/* Get GNOME declarations. */ +#include <gnome.h> +#include <gtk--.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +static Gtk::Main *application; + +static gint +quit_callback (GdkEventAny*) +{ + application->quit (); +} + +int +main (int argc, char *argv[]) +{ + Gtk::Window *window; + Gtk::VBox *panel; + Gtk::Label *label1; + Gtk::Alignment *label1aligned; + Gtk::Label *label2; + Gtk::Alignment *label2aligned; + Gtk::Button *button; + Gtk::HButtonBox *buttonbar; + + /* Initializations. */ + + setlocale (LC_ALL, ""); + application = new Gtk::Main (argc, argv); + textdomain ("hello-c++-gnome"); + bindtextdomain ("hello-c++-gnome", LOCALEDIR); + + /* Create the GUI elements. */ + + window = new Gtk::Window (GTK_WINDOW_TOPLEVEL); + window->set_title ("Hello example"); + window->realize (); + window->delete_event.connect (SigC::slot (quit_callback)); + + label1 = new Gtk::Label (_("Hello, world!")); + + label1aligned = new Gtk::Alignment (0.0, 0.5, 0, 0); + label1aligned->add (*label1); + + label2 = new Gtk::Label (g_strdup_printf (_("This program is running as process number %d."), getpid ())); + + label2aligned = new Gtk::Alignment (0.0, 0.5, 0, 0); + label2aligned->add (*label2); + + button = new Gtk::Button ("OK"); + button->clicked.connect (Gtk::Main::quit.slot()); //slot (quit_callback)); + + buttonbar = new Gtk::HButtonBox (GTK_BUTTONBOX_END); + buttonbar->pack_start (*button); + + panel = new Gtk::VBox (false, GNOME_PAD_SMALL); + panel->pack_start (*label1aligned); + panel->pack_start (*label2aligned); + panel->pack_start (*buttonbar); + + window->add (*panel); + + /* Make the GUI elements visible. */ + + label1->show (); + label1aligned->show (); + label2->show (); + label2aligned->show (); + button->show (); + buttonbar->show (); + panel->show (); + window->show (); + + /* Start the event loop. */ + + application->run (); +} diff --git a/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am b/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am new file mode 100644 index 0000000..174dd86 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/Makefile.am @@ -0,0 +1,7 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 \ + gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4 \ + gtk.m4 gtk--.m4 diff --git a/gettext-tools/examples/hello-c++-gnome/m4/gnome-gnorba-check.m4 b/gettext-tools/examples/hello-c++-gnome/m4/gnome-gnorba-check.m4 new file mode 100644 index 0000000..dbac0a6 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/gnome-gnorba-check.m4 @@ -0,0 +1,35 @@ +dnl +dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag) +dnl +dnl if failflag is "failure" it aborts if gnorba is not found. +dnl + +AC_DEFUN([GNOME_GNORBA_HOOK],[ + GNOME_ORBIT_HOOK([],$2) + AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ + gnome_cv_gnorba_found=no + if test x$gnome_cv_orbit_found = xyes; then + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + if test -n "$GNORBA_LIBS"; then + gnome_cv_gnorba_found=yes + fi + fi + ]) + AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + AC_SUBST(GNORBA_CFLAGS) + AC_SUBST(GNORBA_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(gnorba library not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_GNORBA_CHECK], [ + GNOME_GNORBA_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-c++-gnome/m4/gnome-orbit-check.m4 b/gettext-tools/examples/hello-c++-gnome/m4/gnome-orbit-check.m4 new file mode 100644 index 0000000..54bf33a --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/gnome-orbit-check.m4 @@ -0,0 +1,33 @@ +dnl +dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag) +dnl +dnl if failflag is "failure" it aborts if orbit is not found. +dnl + +AC_DEFUN([GNOME_ORBIT_HOOK],[ + AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) + AC_PATH_PROG(ORBIT_IDL,orbit-idl,no) + AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ + if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then + gnome_cv_orbit_found=no + else + gnome_cv_orbit_found=yes + fi + ]) + AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + ORBIT_CFLAGS=`orbit-config --cflags client server` + ORBIT_LIBS=`orbit-config --use-service=name --libs client server` + AC_SUBST(ORBIT_CFLAGS) + AC_SUBST(ORBIT_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(ORBit not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_ORBIT_CHECK], [ + GNOME_ORBIT_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-c++-gnome/m4/gnome.m4 b/gettext-tools/examples/hello-c++-gnome/m4/gnome.m4 new file mode 100644 index 0000000..659c22c --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/gnome.m4 @@ -0,0 +1,128 @@ +dnl +dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits]) +dnl +dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh +dnl is not found. +dnl + +AC_DEFUN([GNOME_INIT_HOOK],[ + AC_SUBST(GNOME_LIBS) + AC_SUBST(GNOMEUI_LIBS) + AC_SUBST(GNOMEGNORBA_LIBS) + AC_SUBST(GTKXMHTML_LIBS) + AC_SUBST(ZVT_LIBS) + AC_SUBST(GNOME_LIBDIR) + AC_SUBST(GNOME_INCLUDEDIR) + + AC_ARG_WITH(gnome-includes, + [ --with-gnome-includes Specify location of GNOME headers],[ + CFLAGS="$CFLAGS -I$withval" + ]) + + AC_ARG_WITH(gnome-libs, + [ --with-gnome-libs Specify location of GNOME libs],[ + LDFLAGS="$LDFLAGS -L$withval" + gnome_prefix=$withval + ]) + + AC_ARG_WITH(gnome, + [ --with-gnome Specify prefix for GNOME files], + if test x$withval = xyes; then + want_gnome=yes + dnl Note that an empty true branch is not + dnl valid sh syntax. + ifelse([$1], [], :, [$1]) + else + if test "x$withval" = xno; then + want_gnome=no + else + want_gnome=yes + LDFLAGS="$LDFLAGS -L$withval/lib" + CFLAGS="$CFLAGS -I$withval/include" + gnome_prefix=$withval/lib + fi + fi, + want_gnome=yes) + + if test "x$want_gnome" = xyes; then + + AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) + if test "$GNOME_CONFIG" = "no"; then + no_gnome_config="yes" + else + AC_MSG_CHECKING(if $GNOME_CONFIG works) + if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + GNOME_GNORBA_HOOK([],$2) + GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" + GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" + GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" + GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" + ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" + GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" + GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" + $1 + else + AC_MSG_RESULT(no) + no_gnome_config="yes" + fi + fi + + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + gnome_prefix=$ac_default_prefix/lib + else + gnome_prefix=$prefix/lib + fi + else + gnome_prefix=`eval echo \`echo $libdir\`` + fi + + if test "$no_gnome_config" = "yes"; then + AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) + if test -f $gnome_prefix/gnomeConf.sh; then + AC_MSG_RESULT(found) + echo "loading gnome configuration from" \ + "$gnome_prefix/gnomeConf.sh" + . $gnome_prefix/gnomeConf.sh + $1 + else + AC_MSG_RESULT(not found) + if test x$2 = xfail; then + AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install) + fi + fi + fi + fi + + if test -n "$3"; then + n="$3" + for i in $n; do + AC_MSG_CHECKING(extra library \"$i\") + case $i in + applets) + AC_SUBST(GNOME_APPLETS_LIBS) + GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` + AC_MSG_RESULT($GNOME_APPLETS_LIBS);; + docklets) + AC_SUBST(GNOME_DOCKLETS_LIBS) + GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets` + AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);; + capplet) + AC_SUBST(GNOME_CAPPLET_LIBS) + GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` + AC_MSG_RESULT($GNOME_CAPPLET_LIBS);; + *) + AC_MSG_RESULT(unknown library) + esac + done + fi +]) + +dnl +dnl GNOME_INIT ([additional-inits]) +dnl + +AC_DEFUN([GNOME_INIT],[ + GNOME_INIT_HOOK([],fail,$1) +]) diff --git a/gettext-tools/examples/hello-c++-gnome/m4/gtk--.m4 b/gettext-tools/examples/hello-c++-gnome/m4/gtk--.m4 new file mode 100644 index 0000000..aad0540 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/gtk--.m4 @@ -0,0 +1,195 @@ +# Configure paths for GTK-- +# Erik Andersen 30 May 1998 +# Modified by Tero Pulkkinen (added the compiler checks... I hope they work..) +# Modified by Thomas Langen 16 Jan 2000 (corrected CXXFLAGS) + +dnl Test for GTKMM, and define GTKMM_CFLAGS and GTKMM_LIBS +dnl to be used as follows: +dnl AM_PATH_GTKMM([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl +AC_DEFUN(AM_PATH_GTKMM, +[dnl +dnl Get the cflags and libraries from the gtkmm-config script +dnl +AC_ARG_WITH(gtkmm-prefix,[ --with-gtkmm-prefix=PREFIX + Prefix where GTK-- is installed (optional)], + gtkmm_config_prefix="$withval", gtkmm_config_prefix="") +AC_ARG_WITH(gtkmm-exec-prefix,[ --with-gtkmm-exec-prefix=PREFIX + Exec prefix where GTK-- is installed (optional)], + gtkmm_config_exec_prefix="$withval", gtkmm_config_exec_prefix="") +AC_ARG_ENABLE(gtkmmtest, [ --disable-gtkmmtest Do not try to compile and run a test GTK-- program], + , enable_gtkmmtest=yes) + + if test x$gtkmm_config_exec_prefix != x ; then + gtkmm_config_args="$gtkmm_config_args --exec-prefix=$gtkmm_config_exec_prefix" + if test x${GTKMM_CONFIG+set} != xset ; then + GTKMM_CONFIG=$gtkmm_config_exec_prefix/bin/gtkmm-config + fi + fi + if test x$gtkmm_config_prefix != x ; then + gtkmm_config_args="$gtkmm_config_args --prefix=$gtkmm_config_prefix" + if test x${GTKMM_CONFIG+set} != xset ; then + GTKMM_CONFIG=$gtkmm_config_prefix/bin/gtkmm-config + fi + fi + + AC_PATH_PROG(GTKMM_CONFIG, gtkmm-config, no) + min_gtkmm_version=ifelse([$1], ,0.10.0,$1) + + AC_MSG_CHECKING(for GTK-- - version >= $min_gtkmm_version) + AC_LANG_SAVE + no_gtkmm="" + if test "$GTKMM_CONFIG" = "no" ; then + no_gtkmm=yes + else + AC_LANG_CPLUSPLUS + + GTKMM_CFLAGS=`$GTKMM_CONFIG $gtkmm_config_args --cflags` + GTKMM_LIBS=`$GTKMM_CONFIG $gtkmm_config_args --libs` + gtkmm_config_major_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtkmm_config_minor_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtkmm_config_micro_version=`$GTKMM_CONFIG $gtkmm_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtkmmtest" = "xyes" ; then + ac_save_CXXFLAGS="$CXXFLAGS" + ac_save_LIBS="$LIBS" + CXXFLAGS="$CXXFLAGS $GTKMM_CFLAGS" + LIBS="$LIBS $GTKMM_LIBS" +dnl +dnl Now check if the installed GTK-- is sufficiently new. (Also sanity +dnl checks the results of gtkmm-config to some extent +dnl + rm -f conf.gtkmmtest + AC_TRY_RUN([ +#include <gtk--.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtkmmtest"); + + /* HP/UX 0 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtkmm_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtkmm_version"); + exit(1); + } + + if ((gtkmm_major_version != $gtkmm_config_major_version) || + (gtkmm_minor_version != $gtkmm_config_minor_version) || + (gtkmm_micro_version != $gtkmm_config_micro_version)) + { + printf("\n*** 'gtkmm-config --version' returned %d.%d.%d, but GTK-- (%d.%d.%d)\n", + $gtkmm_config_major_version, $gtkmm_config_minor_version, $gtkmm_config_micro_version, + gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version); + printf ("*** was found! If gtkmm-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK--. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtkmm-config was wrong, set the environment variable GTKMM_CONFIG\n"); + printf("*** to point to the correct copy of gtkmm-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +/* GTK-- does not have the GTKMM_*_VERSION constants */ +/* + else if ((gtkmm_major_version != GTKMM_MAJOR_VERSION) || + (gtkmm_minor_version != GTKMM_MINOR_VERSION) || + (gtkmm_micro_version != GTKMM_MICRO_VERSION)) + { + printf("*** GTK-- header files (version %d.%d.%d) do not match\n", + GTKMM_MAJOR_VERSION, GTKMM_MINOR_VERSION, GTKMM_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version); + } +*/ + else + { + if ((gtkmm_major_version > major) || + ((gtkmm_major_version == major) && (gtkmm_minor_version > minor)) || + ((gtkmm_major_version == major) && (gtkmm_minor_version == minor) && (gtkmm_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK-- (%d.%d.%d) was found.\n", + gtkmm_major_version, gtkmm_minor_version, gtkmm_micro_version); + printf("*** You need a version of GTK-- newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK-- is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtkmm-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK--, but you can also set the GTKMM_CONFIG environment to point to the\n"); + printf("*** correct copy of gtkmm-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtkmm=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtkmm" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTKMM_CONFIG" = "no" ; then + echo "*** The gtkmm-config script installed by GTK-- could not be found" + echo "*** If GTK-- was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTKMM_CONFIG environment variable to the" + echo "*** full path to gtkmm-config." + echo "*** The gtkmm-config script was not available in GTK-- versions" + echo "*** prior to 0.9.12. Perhaps you need to update your installed" + echo "*** version to 0.9.12 or later" + else + if test -f conf.gtkmmtest ; then + : + else + echo "*** Could not run GTK-- test program, checking why..." + CXXFLAGS="$CXXFLAGS $GTKMM_CFLAGS" + LIBS="$LIBS $GTKMM_LIBS" + AC_TRY_LINK([ +#include <gtk--.h> +#include <stdio.h> +], [ return ((gtkmm_major_version) || (gtkmm_minor_version) || (gtkmm_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK-- or finding the wrong" + echo "*** version of GTK--. If it is not finding GTK--, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK-- was incorrectly installed" + echo "*** or that you have moved GTK-- since it was installed. In the latter case, you" + echo "*** may want to edit the gtkmm-config script: $GTKMM_CONFIG" ]) + CXXFLAGS="$ac_save_CXXFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTKMM_CFLAGS="" + GTKMM_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_LANG_RESTORE + AC_SUBST(GTKMM_CFLAGS) + AC_SUBST(GTKMM_LIBS) + rm -f conf.gtkmmtest +]) + diff --git a/gettext-tools/examples/hello-c++-gnome/m4/gtk.m4 b/gettext-tools/examples/hello-c++-gnome/m4/gtk.m4 new file mode 100644 index 0000000..b8cf402 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/m4/gtk.m4 @@ -0,0 +1,194 @@ +# Configure paths for GTK+ +# Owen Taylor 97-11-3 + +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK, +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) diff --git a/gettext-tools/examples/hello-c++-gnome/po/LINGUAS b/gettext-tools/examples/hello-c++-gnome/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c++-gnome/po/Makevars b/gettext-tools/examples/hello-c++-gnome/po/Makevars new file mode 100644 index 0000000..e20fc8c --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/po/Makevars @@ -0,0 +1,55 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format \ + --flag=g_log:3:c-format --flag=g_logv:3:c-format \ + --flag=g_error:1:c-format --flag=g_message:1:c-format \ + --flag=g_critical:1:c-format --flag=g_warning:1:c-format \ + --flag=g_print:1:c-format \ + --flag=g_printerr:1:c-format \ + --flag=g_strdup_printf:1:c-format --flag=g_strdup_vprintf:1:c-format \ + --flag=g_printf_string_upper_bound:1:c-format \ + --flag=g_snprintf:3:c-format --flag=g_vsnprintf:3:c-format \ + --flag=g_string_sprintf:2:c-format \ + --flag=g_string_sprintfa:2:c-format \ + --flag=g_scanner_error:2:c-format \ + --flag=g_scanner_warn:2:c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-c++-gnome/po/POTFILES.in b/gettext-tools/examples/hello-c++-gnome/po/POTFILES.in new file mode 100644 index 0000000..853261e --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.cc diff --git a/gettext-tools/examples/hello-c++-gnome/po/de.po b/gettext-tools/examples/hello-c++-gnome/po/de.po new file mode 100644 index 0000000..7785c43 --- /dev/null +++ b/gettext-tools/examples/hello-c++-gnome/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-c++-gnome package +# German messages for hello-c++-gnome. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c++-gnome package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c++-gnome\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:01+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.cc:51 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.cc:56 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-c++-kde/INSTALL b/gettext-tools/examples/hello-c++-kde/INSTALL new file mode 100644 index 0000000..1541e90 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/INSTALL @@ -0,0 +1,4 @@ +This example relies on: + - KDE (libkdeui, libkdecore) and its dependencies + - Qt (libqt) and its dependencies: OpenGL (libGL), libpng, zlib (libz) + - the C++ runtime libraries (libstdc++) diff --git a/gettext-tools/examples/hello-c++-kde/Makefile.am b/gettext-tools/examples/hello-c++-kde/Makefile.am new file mode 100644 index 0000000..c893ed0 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/Makefile.am @@ -0,0 +1,58 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.cc hellowindow.cc + +# Use 'moc' for QObject subclasses. +METASOURCES = AUTO + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DPREFIX=\"$(prefix)\" @DEFS@ + +# Make sure the KDE, Qt, X include file is found. +INCLUDES = $(KDE_INCLUDES) $(QT_INCLUDES) $(X_INCLUDES) + +# CXXFLAGS += $(QT_CXXFLAGS) $(PTHREAD_CFLAGS) + +# Link time dependencies. +LDADD = $(KDE_LDFLAGS) $(QT_LDFLAGS) +LIBS += $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) + +# Generic KDE build mechanism. + +$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ; + +$(top_srcdir)/subdirs: + cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs + +$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in + @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4 + +MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files + +package-messages: + $(MAKE) -f admin/Makefile.common package-messages + $(MAKE) -C po merge + +dist-hook: + cd $(top_distdir) && perl admin/am_edit -padmin + cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs + +# Additional files to be distributed. +EXTRA_DIST = admin/config.rpath autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c++-kde/autoclean.sh b/gettext-tools/examples/hello-c++-kde/autoclean.sh new file mode 100755 index 0000000..f9807c5 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/autoclean.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Brought in by explicit copy. +rm -rf admin + +# Generated through admin/cvs.sh. + rm -f acinclude.m4 + rm -f subdirs configure.files + rm -f configure.in + # Generated by aclocal. + rm -f aclocal.m4 + # Generated by autoconf. + rm -f configure + rm -f config.h.in stamp-h.in + rm -f Makefile.in m4/Makefile.in + +# Generated. +rm -f po/Makefile.in +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-c++-kde/autogen.sh b/gettext-tools/examples/hello-c++-kde/autogen.sh new file mode 100755 index 0000000..d83c0f5 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/autogen.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +kdedir= +for d in /usr/lib/kde /usr/local/kde /usr/local /usr/kde /usr /opt/kde3 /opt/kde $KDEDIR; do + if test -f $d/share/apps/kdelibs/admin/cvs.sh; then + kdedir=$d + break + fi +done +if test -z "$kdedir"; then + echo "*** KDE directory not found. Try setting KDEDIR." 1>&2 + exit 1 +fi + +cp -a $kdedir/share/apps/kdelibs/admin . +sed -e s/AC_FOREACH/INCOMPATIBLE_FOREACH/g < $kdedir/share/apps/kdelibs/admin/acinclude.m4.in > admin/acinclude.m4.in + +autopoint -f # was: gettextize -f -c +mv config.rpath admin/config.rpath +rm -f mkinstalldirs +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +sh admin/cvs.sh cvs + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-c++-kde/configure.in.in b/gettext-tools/examples/hello-c++-kde/configure.in.in new file mode 100644 index 0000000..94e034e --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/configure.in.in @@ -0,0 +1,6 @@ +#MIN_CONFIG +AC_CHECK_HEADERS([unistd.h]) + +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) +AC_CONFIG_FILES([po/Makefile.in]) diff --git a/gettext-tools/examples/hello-c++-kde/hello.cc b/gettext-tools/examples/hello-c++-kde/hello.cc new file mode 100644 index 0000000..5e09128 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/hello.cc @@ -0,0 +1,73 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is published under the GNU General Public License. + +// Source code of the C++ program. + +#if HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdlib.h> +/* Declare KCmdLineArgs, KCmdLineOptions. */ +#include <kcmdlineargs.h> +/* Declare KApplication. */ +#include <kapplication.h> +/* Declare KAboutData. */ +#include <kaboutdata.h> +/* Declare main window widget. */ +#include "hellowindow.h" + +// Comment line options. + +static KCmdLineOptions options[] = +{ + { 0, 0, 0 } // End of options. +}; + +int +main (int argc, char *argv[]) +{ + // Initializations. + + { + // Add our installation directory to KDE's search list for message + // catalogs. By default it looks only in $KDEHOME/share/locale and + // $KDEDIR/share/locale. + QString kdedirs = getenv ("KDEDIRS"); + if (kdedirs.isEmpty ()) + kdedirs = PREFIX; + else + kdedirs = kdedirs + ":" + PREFIX; + setenv ("KDEDIRS", (const char *) kdedirs.local8Bit(), true); + } + + KAboutData aboutData ("hello-c++-kde", + I18N_NOOP ("Hello example"), + VERSION, + I18N_NOOP ("Hello world example"), + KAboutData::License_GPL, + "(C) 2003 Free Software Foundation", + NULL, + NULL, + "bug-gnu-gettext@gnu.org"); + KCmdLineArgs::init (argc, argv, &aboutData); + KCmdLineArgs::addCmdLineOptions (options); + KApplication application; + + // Create the GUI elements. + + HelloMainWindow *window = new HelloMainWindow (); + QObject::connect (window->button, SIGNAL (clicked ()), + &application, SLOT (quit ())); + + application.setMainWidget (window); + + // Make the GUI elements visible. + + window->show (); + + // Start the event loop. + + return application.exec (); +} diff --git a/gettext-tools/examples/hello-c++-kde/hellowindow.cc b/gettext-tools/examples/hello-c++-kde/hellowindow.cc new file mode 100644 index 0000000..67aa2b4 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/hellowindow.cc @@ -0,0 +1,63 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is published under the GNU General Public License. + +#if HAVE_CONFIG_H +# include <config.h> +#endif + +/* Specification. */ +#include "hellowindow.h" + +/* Declare i18n. */ +#include <klocale.h> +/* Declare KMainWindow. */ +#include <kmainwindow.h> +/* Declare QLabel. */ +#include <qlabel.h> +/* Declare QPushButton. */ +#include <qpushbutton.h> +/* Declare QString. */ +#include <qstring.h> +/* Declare QVBox. */ +#include <qvbox.h> +/* Declare QHBox. */ +#include <qhbox.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +// The main window widget. + +HelloMainWindow::HelloMainWindow (QWidget * parent, const char * name) + : KMainWindow (parent, name) +{ + setCaption ("Hello example"); + + QVBox *panel = new QVBox (this); + panel->setSpacing (2); + + QLabel *label1 = new QLabel (i18n ("Hello, world!"), panel); + + QString label2text; + // NOT using QString::sprintf because it doesn't support reordering of + // arguments. + //label2text.sprintf (i18n ("This program is running as process number %d"), + // getpid ()); + label2text = i18n ("This program is running as process number %1.").arg(getpid ()); + QLabel *label2 = new QLabel (label2text, panel); + + QHBox *buttonbar = new QHBox (panel); + QWidget *filler = new QWidget (buttonbar); // makes the button right-aligned + button = new QPushButton ("OK", buttonbar); + button->setMaximumWidth (button->sizeHint().width() + 20); + + panel->resize (panel->sizeHint ()); + resize (panel->frameSize ()); +} + +HelloMainWindow::~HelloMainWindow () +{ +} diff --git a/gettext-tools/examples/hello-c++-kde/hellowindow.h b/gettext-tools/examples/hello-c++-kde/hellowindow.h new file mode 100644 index 0000000..6457a48 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/hellowindow.h @@ -0,0 +1,20 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is published under the GNU General Public License. + +/* Declare KMainWindow. */ +#include <kmainwindow.h> +/* Declare QPushButton. */ +#include <qpushbutton.h> + +// The main window widget. + +class HelloMainWindow : public KMainWindow +{ + Q_OBJECT +public: + HelloMainWindow (QWidget * parent = NULL, const char * name = NULL); + ~HelloMainWindow (); +public: + QPushButton *button; +}; diff --git a/gettext-tools/examples/hello-c++-kde/m4/Makefile.am b/gettext-tools/examples/hello-c++-kde/m4/Makefile.am new file mode 100644 index 0000000..d6431f0 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/m4/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 diff --git a/gettext-tools/examples/hello-c++-kde/po/LINGUAS b/gettext-tools/examples/hello-c++-kde/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c++-kde/po/Makevars b/gettext-tools/examples/hello-c++-kde/po/Makevars new file mode 100644 index 0000000..adcf4e7 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/po/Makevars @@ -0,0 +1,51 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --qt \ + --keyword=i18n --flag=i18n:1:pass-c-format --flag=i18n:1:pass-qt-format \ + --keyword=tr2i18n --flag=tr2i18n:1:pass-c-format --flag=tr2i18n:1:pass-qt-format \ + --keyword=I18N_NOOP --flag=I18N_NOOP:1:pass-c-format --flag=I18N_NOOP:1:pass-qt-format \ + --keyword=tr --flag=tr:1:pass-c-format --flag=tr:1:pass-qt-format \ + --keyword=translate:2 --flag=translate:2:pass-c-format --flag=translate:2:pass-qt-format \ + --keyword=QT_TR_NOOP --flag=QT_TR_NOOP:1:pass-c-format --flag=QT_TR_NOOP:1:pass-qt-format \ + --keyword=QT_TRANSLATE_NOOP:2 --flag=QT_TRANSLATE_NOOP:2:pass-c-format --flag=QT_TRANSLATE_NOOP:2:pass-qt-format \ + --keyword=_ --flag=_:1:pass-c-format --flag=_:1:pass-qt-format \ + --keyword=N_ --flag=N_:1:pass-c-format --flag=N_:1:pass-qt-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-c++-kde/po/POTFILES.in b/gettext-tools/examples/hello-c++-kde/po/POTFILES.in new file mode 100644 index 0000000..94bee00 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/po/POTFILES.in @@ -0,0 +1,7 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.cc +hellowindow.cc diff --git a/gettext-tools/examples/hello-c++-kde/po/de.po b/gettext-tools/examples/hello-c++-kde/po/de.po new file mode 100644 index 0000000..b076680 --- /dev/null +++ b/gettext-tools/examples/hello-c++-kde/po/de.po @@ -0,0 +1,35 @@ +# German translations for hello-c++-kde package +# German messages for hello-c++-kde. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c++-kde package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c++-kde\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:01+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.cc:46 +msgid "Hello example" +msgstr "Beispiel Hallo" + +#: hello.cc:48 +msgid "Hello world example" +msgstr "Beispiel Hallo-Welt" + +#: hellowindow.cc:42 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hellowindow.cc:49 +#, qt-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/gettext-tools/examples/hello-c++-qt/INSTALL b/gettext-tools/examples/hello-c++-qt/INSTALL new file mode 100644 index 0000000..a42100d --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/INSTALL @@ -0,0 +1,3 @@ +This example relies on: + - Qt (libqt) and its dependencies: OpenGL (libGL), libpng, zlib (libz) + - the C++ runtime libraries (libstdc++) diff --git a/gettext-tools/examples/hello-c++-qt/Makefile.am b/gettext-tools/examples/hello-c++-qt/Makefile.am new file mode 100644 index 0000000..5cdeceb --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/Makefile.am @@ -0,0 +1,33 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.cc + +# Define C macros LOCALEDIR and PKGLOCALEDIR indicating where catalogs will be +# installed. +localedir = $(datadir)/locale +pkglocaledir = $(pkgdatadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" -DPKGLOCALEDIR=\"$(pkglocaledir)\" @DEFS@ + +CXXFLAGS += $(QT_CXXFLAGS) $(PTHREAD_CFLAGS) + +# Link time dependencies. +LDADD = $(QT_LDFLAGS) +LIBS += $(QT_LIBS) + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c++-qt/autoclean.sh b/gettext-tools/examples/hello-c++-qt/autoclean.sh new file mode 100755 index 0000000..9a2895b --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/autoclean.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.qm diff --git a/gettext-tools/examples/hello-c++-qt/autogen.sh b/gettext-tools/examples/hello-c++-qt/autogen.sh new file mode 100755 index 0000000..1853bf4 --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c --qt -o $lang.qm $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-c++-qt/configure.ac b/gettext-tools/examples/hello-c++-qt/configure.ac new file mode 100644 index 0000000..941b4ee --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/configure.ac @@ -0,0 +1,25 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.cc) +AM_INIT_AUTOMAKE(hello-c++-qt, 0) + +AC_PROG_CXX +FUN_TYPE_BOOL +AC_CHECK_HEADERS([unistd.h]) +FUN_HEADER_STDCXX +FUN_CHECK_PTHREAD +FUN_CHECK_QT(220) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-c++-qt/hello.cc b/gettext-tools/examples/hello-c++-qt/hello.cc new file mode 100644 index 0000000..0932314 --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/hello.cc @@ -0,0 +1,74 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. + +// Source code of the C++ program. + +#include <qapplication.h> +#include <qmainwindow.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <qstring.h> +#include <qvbox.h> +#include <qhbox.h> +#include <qtextcodec.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +int +main (int argc, char *argv[]) +{ + // Initializations. + + QApplication application (argc, argv); +#if 0 + GettextTranslator *translator = + new GettextTranslator (&application, "hello-c++-qt", LOCALEDIR); +#else + QTranslator *translator = new QTranslator (NULL); + translator->load (QString ("hello-c++-qt") + "_" + QTextCodec::locale(), + PKGLOCALEDIR); +#endif + application.installTranslator (translator); +#define _(string) application.translate ("", string) + + // Create the GUI elements. + + QMainWindow *window = new QMainWindow (); + window->setCaption ("Hello example"); + + QVBox *panel = new QVBox (window); + panel->setSpacing (2); + + QLabel *label1 = new QLabel (_("Hello, world!"), panel); + + QString label2text; + // NOT using QString::sprintf because it doesn't support reordering of + // arguments. + //label2text.sprintf (_("This program is running as process number %d"), + // getpid ()); + label2text = _("This program is running as process number %1.").arg(getpid ()); + QLabel *label2 = new QLabel (label2text, panel); + + QHBox *buttonbar = new QHBox (panel); + QWidget *filler = new QWidget (buttonbar); // makes the button right-aligned + QPushButton *button = new QPushButton ("OK", buttonbar); + button->setMaximumWidth (button->sizeHint().width() + 20); + QObject::connect (button, SIGNAL (clicked ()), &application, SLOT (quit ())); + + panel->resize (panel->sizeHint ()); + window->resize (panel->frameSize ()); + + application.setMainWidget (window); + + // Make the GUI elements visible. + + window->show (); + + // Start the event loop. + + return application.exec (); +} diff --git a/gettext-tools/examples/hello-c++-qt/m4/Makefile.am b/gettext-tools/examples/hello-c++-qt/m4/Makefile.am new file mode 100644 index 0000000..b15ec45 --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/m4/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ + nls.m4 po.m4 \ + qt.m4 diff --git a/gettext-tools/examples/hello-c++-qt/m4/qt.m4 b/gettext-tools/examples/hello-c++-qt/m4/qt.m4 new file mode 100644 index 0000000..d2ba0b9 --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/m4/qt.m4 @@ -0,0 +1,466 @@ +# Copyright (C) 2001 David Johnson +# This file is free software; the author gives unlimited permission to copy +# and/or distribute it, with or without modifications, as long as this notice +# is preserved. + +# FUN_TYPE BOOL +# check for a built-in bool type +# HAVE_BOOL will be defined in the config header + +AC_DEFUN(FUN_TYPE_BOOL, +[ + AC_REQUIRE([AC_PROG_CXX]) + + AC_LANG_PUSH(C++) + AC_CHECK_TYPE(bool, ac_check_bool=yes, ac_check_bool=no) + AC_LANG_POP(C++) + if test "x$ac_check_bool" = "xyes" ; then + AC_DEFINE(HAVE_BOOL,,[define if bool is a built-in type]) + fi + + AH_BOTTOM([#ifndef HAVE_BOOL]) + AH_BOTTOM([enum booltyp { false, true }; typedef enum booltyp bool;]) + AH_BOTTOM([#endif]) +])# FUN_TYPE_BOOL + +# FUN_HEADER_STDCXX +# check for standard ISO C++ headers + +AC_DEFUN(FUN_HEADER_STDCXX, +[ + AC_REQUIRE([AC_PROG_CXX]) + + AC_LANG_PUSH(C++) + + ac_check_headers=no + AC_CHECK_HEADER(cstdlib, + ac_check_headers=yes, + ac_check_headers=no) + AC_CHECK_HEADER(cstring, + ac_check_headers=$ac_check_headers, + ac_check_headers=no) + AC_CHECK_HEADER(iostream, + ac_check_headers=$ac_check_headers, + ac_check_headers=no) + + AC_LANG_POP(C++) + + if test "x$ac_check_headers" = "xno" ; then + AC_MSG_ERROR(standard ISO C++ headers not found!) + fi +])#FUN_HEADER_STDCXX + +# FUN_CHECK_PTHREAD +# check for posix pthreads +# sets PTHREAD_LIBS and PTHREAD_CFLAGS +# sets HAVE_PTHREADS in the configuration header + +AC_DEFUN(FUN_CHECK_PTHREAD, +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_PROG_CC]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + + AC_ARG_ENABLE(threads, AC_HELP_STRING([--enable-threads], + [enable the use of the threads [[default=no]]]), + ac_use_threads=$enableval, ac_use_threads=no) + + if test "x$ac_use_threads" = "xyes" ; then + + AC_CHECK_HEADER(pthread.h, ac_posix_threads=yes, ac_posix_threads=no) + + if test "x$ac_posix_threads" = "xyes" ; then + + AC_MSG_CHECKING([whether ${CC} accepts -pthread]) + ac_cflags_save="$CFLAGS" + CFLAGS="$CFLAGS -pthread" + AC_TRY_COMPILE([#include <pthread.h>], [pthread_attr_init(0)], + ac_cc_pthread=yes, ac_cc_pthread=no) + CFLAGS="$ac_cflags_save" + + if test "x$ac_cc_pthread" = "xyes" ; then + AC_MSG_RESULT([yes]) + PTHREAD_CFLAGS="-pthread" + else + AC_MSG_RESULT([no]) + ac_thread_library=none + + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(c_r, pthread_self, ac_thread_library=c_r) + fi + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(pthread, pthread_self, ac_thread_library=pthread) + fi + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(pthreads, pthread_self, ac_thread_library=pthreads) + fi + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(thread, pthread_self, ac_thread_library=thread) + fi + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(gthreads, pthread_self, ac_thread_library=gthreads) + fi + if test "x$ac_thread_library" = "xnone" ; then + AC_CHECK_LIB(c, pthread_self, ac_thread_library=c) + fi + if test "x$ac_thread_library" = "xnone" ; then + ac_use_threads=no + else + PTHREAD_LIBS="-l$ac_thread_library" + fi + fi + else + ac_use_threads=no + fi + fi + + if test "x$ac_use_threads" = "xyes" ; then + AC_DEFINE(HAVE_PTHREAD, 1, [Define if you have POSIX threads]) + case $host_os in + aix* | freebsd*) + PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" + ;; + linux* | solaris*) + PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT" + ;; + *) + ;; + esac + fi +])#FUN_CHECK_PTHREAD + +# FUN_CHECK_QT([qt_min_version],[qt_max_version]) +# check for qt headers, libs, progs and compilation +# substs QT_CXXFLAGS, QT_LDFLAGS, and QT_LIBS +# substs QTVERSION, MOC and UIC +# LIBQT, MOC and UIC 'precious' variables + +AC_DEFUN(FUN_CHECK_QT, +[ + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_PATH_X]) + AC_REQUIRE([AC_PATH_XTRA]) + AC_REQUIRE([FUN_CHECK_PTHREAD]) + + # some 'precious' variables for configure --help + AC_ARG_VAR(QTMIN, minimum version of Qt to search for e.g. 220) + AC_ARG_VAR(QTMAX, maximum version of Qt to search for e.g. 399) + AC_ARG_VAR(LIBQT, library flag for the Qt libary e.g. -lqt) + AC_ARG_VAR(MOC, QT meta object compiler command) + AC_ARG_VAR(UIC, Qt UI compiler command) + + AC_CACHE_SAVE + + AC_MSG_NOTICE([checking for Qt]) + + # process our args + if test -z "$1" ; then + qt_min_version=0 + else + qt_min_version=$1 + fi + if test -z "$2" ; then + qt_max_version=9999 + else + qt_max_version=$2 + fi + # adjust for user preferences + if test "x$QTMIN" != "x" ; then + if expr $QTMIN '>' $qt_min_version > /dev/null ; then + qt_min_version=$QTMIN; + fi + fi + if test "x$QTMAX" != "x" ; then + if expr $QTMAX '<' $qt_max_version > /dev/null ; then + qt_max_version=$QTMAX; + fi + fi + + # set up our configuration options + qt_dir="" + qt_includes="" + qt_libraries="" + qt_programs="" + AC_ARG_WITH([qt_dir], AC_HELP_STRING([--with-qt-dir=DIR], + [where the Qt package is installed]), + [ qt_dir="$withval" + qt_includes="$withval"/include + qt_libraries="$withval"/lib + qt_programs="$withval"/bin + ]) + AC_ARG_WITH([qt_includes], AC_HELP_STRING([--with-qt-includes=DIR], + [where the Qt includes are installed]), + [qt_includes="$withval"]) + AC_ARG_WITH([qt_libraries], AC_HELP_STRING([--with-qt-libraries=DIR], + [where the Qt libraries are installed]), + [qt_libraries="$withval"]) + AC_ARG_WITH([qt_programs], AC_HELP_STRING([--with-qt-programs=DIR], + [where the Qt programs are installed]), + [qt_programs="$withval"]) + + QTVERSION="000" + + FUN_QT_HEADERS + + # check for a traditional qt installation tree + if ls $qt_includes/../lib/libqt* > /dev/null 2> /dev/null; then + qt_dir="`echo $qt_includes | sed s,'/include',,`" + qt_libraries="$qt_dir/lib" + qt_programs="$qt_dir/bin" + fi + + FUN_QT_LIBRARIES + FUN_QT_PROGRAMS + FUN_QT_COMPILE + + AC_MSG_NOTICE([Found Qt version $QTVERSION]) + + AC_SUBST(QTVERSION) + AC_SUBST(MOC) + AC_SUBST(UIC) + QT_CXXFLAGS="-I$qt_includes" + AC_SUBST(QT_CXXFLAGS) + QT_LDFLAGS="-L$qt_libraries" + AC_SUBST(QT_LDFLAGS) + QT_LIBS="$LIBQT" + AC_SUBST(QT_LIBS) +])#FUN_CHECK_QT + +# FUN_QT_HEADERS +# helper function for FUN_CHECK_QT +# check for qt headers in standard locations + +AC_DEFUN(FUN_QT_HEADERS, +[ + AC_MSG_CHECKING([for Qt headers]) + + if test "x$qt_includes" = "x" ; then + # look in standard locations + qt_found_dirs="" + qt_include_dirs=" + $QTDIR + /usr/include + /usr/local/include + /usr/X11R6/include + `ls -dr /usr/include/qt* 2>/dev/null` + `ls -dr /usr/local/include/qt* 2>/dev/null` + `ls -dr /usr/X11R6/include/qt* 2>/dev/null` + `ls -dr /usr/lib/qt*/include 2>/dev/null` + `ls -dr /usr/local/lib/qt*/include 2>/dev/null` + `ls -dr /usr/X11R6/lib/qt*/include 2>/dev/null` + `ls -dr /usr/local/qt*/include 2>/dev/null` + `ls -dr /opt/qt*/include 2>/dev/null` " + for n in $qt_include_dirs ; do + if test -r "$n/qglobal.h"; then + qt_found_dirs="$qt_found_dirs $n" + fi + done + + # find the latest version between min_version and max_version + qt_prev_version=$qt_min_version + qt_found_version="" + for n in $qt_found_dirs ; do + qt_current_version=`grep -w '#define QT_VERSION' $n/qglobal.h | + sed s/'#define QT_VERSION'//` + if expr $qt_current_version '>=' $qt_prev_version > /dev/null ; then + if expr $qt_current_version '<=' $qt_max_version > /dev/null ; then + qt_includes=$n + qt_prev_version=$qt_current_version + fi + fi + done + fi + + if test "x$qt_includes" = "x" ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find correct Qt headers!]) + else + dnl TODO need to strip out white space + QTVERSION=$qt_prev_version; + AC_MSG_RESULT([$qt_includes]) + fi +])#FUN_QT_HEADERS + +# FUN_QT_LIBRARIES +# helper function for FUN_CHECK_QT +# check for qt libs in standard locations + +AC_DEFUN(FUN_QT_LIBRARIES, +[ + AC_REQUIRE([FUN_QT_HEADERS]) + + AC_MSG_CHECKING([for Qt libraries]) + + # check which library to look for + if test -z "$LIBQT" ; then + if test "x$ac_use_threads" = "xyes" ; then + LIBQT="-lqt-mt" + else + LIBQT="-lqt" + fi + fi + + lib_qt=`echo $LIBQT | sed s/'-l'//` + + if test "x$qt_libraries" = "x" ; then + # see if it is relative to the includes + qt_tree="$qt_includes" + while test "x$qt_tree" != "x" ; do + # first go around will fail... + if ls $qt_tree/lib/libqt* > /dev/null 2> /dev/null ; then + qt_libraries=$qt_tree/lib + break + else + # lop off tail of path + dnl not as portable as it should be... + qt_tree="`dirname $qt_tree`" + fi + done + fi + + if test "x$qt_libraries" = "x" ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find Qt libraries!]) + else + # check that we're looking at the right library + if ls $qt_libraries/lib$lib_qt.* > /dev/null 2> /dev/null ; then + AC_MSG_RESULT([$qt_libraries]) + else + AC_MSG_RESULT([no]) + if test "x$ac_use_threads" = "xyes" ; then + AC_MSG_ERROR([cannot find the threaded Qt library in $qt_libraries!]) + else + AC_MSG_ERROR([cannot find the non-threaded Qt library in $qt_libraries!]) + fi + fi + fi +])#FUN_QT_LIBRARIES + +# FUN_QT_PROGRAMS +# helper function for FUN_CHECK_QT +# searches for moc and uic + +AC_DEFUN(FUN_QT_PROGRAMS, +[ + AC_REQUIRE([FUN_QT_LIBRARIES]) + + AC_MSG_CHECKING([for Qt utilities]) + + if test "x$q_programs" = "x" ; then + # see if it is relative to the libraries + qt_tree="$qt_libraries" + while test "x$qt_tree" != "x" ; do + # first go around will fail + if ls $qt_tree/bin/moc* > /dev/null 2> /dev/null ; then + qt_programs=$qt_tree/bin + break + else + # lop off tail of path + dnl not as portable as it should be... + qt_tree="`dirname $qt_tree`" + fi + done + # if we haven't found the progs, there's not much more we can do + fi + + if test "x$qt_programs" = "x" ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find Qt utilities!]) + else + AC_MSG_RESULT([$qt_programs]) + # find the right moc + if test -z "$MOC" ; then + AC_CHECK_PROG(MOC, moc, moc) + if test "x$MOC" = "x" ; then + # could be renamed to avoid clashes + if ls $qt_programs/moc > /dev/null 2> /dev/null ; then + MOC="$qt_programs/moc" + else + if expr "$QTVERSION" '>=' "200" > /dev/null ; then + if ls $qt_programs/moc2 > /dev/null 2> /dev/null ; then + MOC="$qt_programs/moc2" + fi + else + if expr "$QTVERSION" '>=' "300" > /dev/null ; then + if $qt_programs/moc3 > /dev/null 2> /dev/null ; then + MOC="$qt_programs/moc3" + fi + fi + fi + fi + fi + if test "x$MOC" = "x" ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot find Qt meta object compiler!]) + fi + fi + + # find the right uic + if expr "$QTVERSION" '>=' "220" > /dev/null ; then + if test -z "$UIC" ; then + AC_CHECK_PROG(UIC, uic, uic) + if test "x$UIC" = "x" ; then + # could be renamed to avoid clashes + if ls $qt_programs/uic > /dev/null 2> /dev/null ; then + UIC="$qt_programs/uic" + else + if expr "$QTVERSION" '>=' "300" > /dev/null ; then + if ls $qt_programs/uic3 > /dev/null 2> /dev/null ; then + UIC="$qt_programs/uic3" + fi + fi + fi + fi + fi + else + # if uic is important to the build, change this + UIC="" + fi + fi +])#FUN_QT_PROGRAMS + +# FUN_QT_COMPILE +# helper function for FUN_CHECK_QT +# compile a simple qt program + +AC_DEFUN(FUN_QT_COMPILE, +[ + AC_REQUIRE([FUN_QT_HEADERS]) + AC_REQUIRE([FUN_QT_LIBRARIES]) + AC_REQUIRE([FUN_QT_PROGRAMS]) + + AC_MSG_CHECKING([whether a simple Qt program compiles]) + + AC_LANG_PUSH(C++) + + ac_cxxflags_save="$CXXFLAGS" + ac_ldflags_save="$LDFLAGS" + ac_libs_save="$LIBS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS -I$qt_includes $X_CFLAGS $all_includes" + LDFLAGS="$LDFLAGS -L$qt_libraries $X_LIBS " + LIBS="$LIBS $PTHREAD_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lXext -lX11 $LIBQT" + + AC_TRY_LINK([ + #include <qglobal.h> + #include <qmessagebox.h> + #include <qstring.h>], + [QString s = "hello world"; + QMessageBox::information(0, s, "no he is not"); + return 0;], + qt_compile=yes, qt_compile=no) + + CXXFLAGS="$ac_cxxflags_save" + LDFLAGS="$ac_ldflags_save" + LIBS="$ac_libs_save" + + AC_LANG_POP(C++) + + if test "x$qt_compile" = "xyes" ; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([cannot compile a Qt program!]) + fi +])#FUN_QT_COMPILE diff --git a/gettext-tools/examples/hello-c++-qt/po/LINGUAS b/gettext-tools/examples/hello-c++-qt/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c++-qt/po/Makefile.am b/gettext-tools/examples/hello-c++-qt/po/Makefile.am new file mode 100644 index 0000000..ac109e2 --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/po/Makefile.am @@ -0,0 +1,224 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.cc + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --qt \ + --keyword=tr --flag=tr:1:pass-c-format --flag=tr:1:pass-qt-format \ + --keyword=translate:2 --flag=translate:2:pass-c-format --flag=translate:2:pass-qt-format \ + --keyword=QT_TR_NOOP --flag=QT_TR_NOOP:1:pass-c-format --flag=QT_TR_NOOP:1:pass-qt-format \ + --keyword=QT_TRANSLATE_NOOP:2 --flag=QT_TRANSLATE_NOOP:2:pass-c-format --flag=QT_TRANSLATE_NOOP:2:pass-qt-format \ + --keyword=_ --flag=_:1:pass-c-format --flag=_:1:pass-qt-format \ + --keyword=N_ --flag=N_:1:pass-c-format --flag=N_:1:pass-qt-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).qm) +QMFILES = @QMFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).qm) +CATALOGS = @QTCATALOGS@ + +SUFFIXES = .po .qm .sed .sin .nop .po-update + +.po.qm: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.qm && $(GMSGFMT) -c --qt --statistics -o $${lang}.qm $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.qm && $(GMSGFMT) -c --qt --statistics -o t-$${lang}.qm $${lang}.po && mv t-$${lang}.qm $${lang}.qm + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(QMFILES)" || $(MAKE) $(QMFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/locale + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$(pkgdatadir)/locale/$(DOMAIN)_$$cat; \ + echo "installing $$realcat as $(DESTDIR)$(pkgdatadir)/locale/$(DOMAIN)_$$cat"; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/locale + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + rm -f $(DESTDIR)$(pkgdatadir)/locale/$(DOMAIN)_$$cat; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = stamp-po $(QMFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(QMFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(QMFILES) + @: diff --git a/gettext-tools/examples/hello-c++-qt/po/de.po b/gettext-tools/examples/hello-c++-qt/po/de.po new file mode 100644 index 0000000..4d326fe --- /dev/null +++ b/gettext-tools/examples/hello-c++-qt/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-c++-qt package +# German messages for hello-c++-qt. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c++-qt package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c++-qt\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:00+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.cc:46 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.cc:53 +#, qt-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/gettext-tools/examples/hello-c++/INSTALL b/gettext-tools/examples/hello-c++/INSTALL new file mode 100644 index 0000000..ca6d74e --- /dev/null +++ b/gettext-tools/examples/hello-c++/INSTALL @@ -0,0 +1 @@ +This example relies on libstdc++, gettext-runtime. diff --git a/gettext-tools/examples/hello-c++/Makefile.am b/gettext-tools/examples/hello-c++/Makefile.am new file mode 100644 index 0000000..3897715 --- /dev/null +++ b/gettext-tools/examples/hello-c++/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.cc gettext.h + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gettext.h include file is found. +INCLUDES = -I. -I$(srcdir) + +# Link time dependencies. +LDADD = @LIBASPRINTF@ @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c++/autoclean.sh b/gettext-tools/examples/hello-c++/autoclean.sh new file mode 100755 index 0000000..d6b42cd --- /dev/null +++ b/gettext-tools/examples/hello-c++/autoclean.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f gettext.h + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-c++/autogen.sh b/gettext-tools/examples/hello-c++/autogen.sh new file mode 100755 index 0000000..65739de --- /dev/null +++ b/gettext-tools/examples/hello-c++/autogen.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${GETTEXTSRCDIR-../../../gettext-tools/lib}/gettext.h gettext.h + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po +done +cd .. diff --git a/gettext-tools/examples/hello-c++/configure.ac b/gettext-tools/examples/hello-c++/configure.ac new file mode 100644 index 0000000..0b0c950 --- /dev/null +++ b/gettext-tools/examples/hello-c++/configure.ac @@ -0,0 +1,20 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.cc) +AM_INIT_AUTOMAKE(hello-c++, 0) + +AC_PROG_CXX +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) +AC_LIB_LINKFLAGS([asprintf]) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-c++/hello.cc b/gettext-tools/examples/hello-c++/hello.cc new file mode 100644 index 0000000..18ba81e --- /dev/null +++ b/gettext-tools/examples/hello-c++/hello.cc @@ -0,0 +1,44 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. + +// Source code of the C++ program. + + +// Avoid deprecation warnings from g++ 3.1 or newer. +#if defined __GNUG__ && defined __DEPRECATED +# include <iostream> +using namespace std; +#else +# include <iostream.h> +#endif + +// Get setlocale() declaration. +#include <locale.h> + +// Get getpid() declaration. +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +// Get gettext(), textdomain(), bindtextdomain() declaration. +#include "gettext.h" +// Define shortcut for gettext(). +#define _(string) gettext (string) + +// Get autosprintf class declaration. +#include "autosprintf.h" +using gnu::autosprintf; + +int +main () +{ + setlocale (LC_ALL, ""); + textdomain ("hello-c++"); + bindtextdomain ("hello-c++", LOCALEDIR); + + cout << _("Hello, world!") << endl; + cout << autosprintf (_("This program is running as process number %d."), + getpid ()) + << endl; +} diff --git a/gettext-tools/examples/hello-c++/m4/Makefile.am b/gettext-tools/examples/hello-c++/m4/Makefile.am new file mode 100644 index 0000000..d6431f0 --- /dev/null +++ b/gettext-tools/examples/hello-c++/m4/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 diff --git a/gettext-tools/examples/hello-c++/po/LINGUAS b/gettext-tools/examples/hello-c++/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c++/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c++/po/Makevars b/gettext-tools/examples/hello-c++/po/Makevars new file mode 100644 index 0000000..7c3b897 --- /dev/null +++ b/gettext-tools/examples/hello-c++/po/Makevars @@ -0,0 +1,44 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format \ + --flag=autosprintf:1:c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-c++/po/POTFILES.in b/gettext-tools/examples/hello-c++/po/POTFILES.in new file mode 100644 index 0000000..853261e --- /dev/null +++ b/gettext-tools/examples/hello-c++/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.cc diff --git a/gettext-tools/examples/hello-c++/po/de.po b/gettext-tools/examples/hello-c++/po/de.po new file mode 100644 index 0000000..6d5d128 --- /dev/null +++ b/gettext-tools/examples/hello-c++/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-c++ package +# German messages for hello-c++. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c++ package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c++\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:59+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.cc:40 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.cc:41 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-c-gnome/INSTALL b/gettext-tools/examples/hello-c-gnome/INSTALL new file mode 100644 index 0000000..84387c0 --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/INSTALL @@ -0,0 +1,7 @@ +This example relies on: + - the GNOME libraries (libgnomeui, libgnome, libgnomesupport, libart_lgpl) + and their dependencies: imlib (libgdk_imlib), audiofile (libaudiofile), + esound (libesd), zlib (libz). + - the GTK libraries (libgtk, libgdk) + - the glib libraries (libglib, libgmodule) + - the X11 libraries diff --git a/gettext-tools/examples/hello-c-gnome/Makefile.am b/gettext-tools/examples/hello-c-gnome/Makefile.am new file mode 100644 index 0000000..82213fc --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.c + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gnome.h include file is found. +INCLUDES = $(GNOME_INCLUDEDIR) + +# Link time dependencies. +LDADD = $(GNOME_LIBDIR) $(GNOMEUI_LIBS) @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c-gnome/autoclean.sh b/gettext-tools/examples/hello-c-gnome/autoclean.sh new file mode 100755 index 0000000..980bf44 --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/autoclean.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-c-gnome/autogen.sh b/gettext-tools/examples/hello-c-gnome/autogen.sh new file mode 100755 index 0000000..755010a --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-c-gnome/configure.ac b/gettext-tools/examples/hello-c-gnome/configure.ac new file mode 100644 index 0000000..da3e33f --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/configure.ac @@ -0,0 +1,20 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.c) +AM_INIT_AUTOMAKE(hello-c-gnome, 0) + +AC_PROG_CC +GNOME_INIT +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-c-gnome/hello.c b/gettext-tools/examples/hello-c-gnome/hello.c new file mode 100644 index 0000000..2937b02 --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/hello.c @@ -0,0 +1,88 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the C program. */ + + +/* Get GNOME declarations. */ +#include <gnome.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +static void +quit_callback (GtkWidget *widget, void *data) +{ + gtk_main_quit (); +} + +int +main (int argc, char *argv[]) +{ + GtkWidget *window; + GtkWidget *panel; + GtkWidget *label1; + GtkWidget *label1aligned; + GtkWidget *label2; + GtkWidget *label2aligned; + GtkWidget *button; + GtkWidget *buttonbar; + + /* Initializations. */ + + gnome_init (PACKAGE, VERSION, argc, argv); + textdomain ("hello-c-gnome"); + bindtextdomain ("hello-c-gnome", LOCALEDIR); + + /* Create the GUI elements. */ + + window = gnome_app_new ("hello-c-gnome", "Hello example"); + gtk_widget_realize (window); + gtk_signal_connect (GTK_OBJECT (window), "delete_event", + GTK_SIGNAL_FUNC (quit_callback), NULL); + + label1 = gtk_label_new (_("Hello, world!")); + + label1aligned = gtk_alignment_new (0.0, 0.5, 0, 0); + gtk_container_add (GTK_CONTAINER (label1aligned), label1); + + label2 = gtk_label_new (g_strdup_printf (_("This program is running as process number %d."), getpid ())); + + label2aligned = gtk_alignment_new (0.0, 0.5, 0, 0); + gtk_container_add (GTK_CONTAINER (label2aligned), label2); + + button = gtk_button_new_with_label ("OK"); + gtk_signal_connect (GTK_OBJECT (button), "clicked", + GTK_SIGNAL_FUNC (quit_callback), NULL); + + buttonbar = gtk_hbutton_box_new (); + gtk_button_box_set_layout (GTK_BUTTON_BOX (buttonbar), GTK_BUTTONBOX_END); + gtk_box_pack_start_defaults (GTK_BOX (buttonbar), button); + + panel = gtk_vbox_new (FALSE, GNOME_PAD_SMALL); + gtk_box_pack_start_defaults (GTK_BOX (panel), label1aligned); + gtk_box_pack_start_defaults (GTK_BOX (panel), label2aligned); + gtk_box_pack_start_defaults (GTK_BOX (panel), buttonbar); + + gnome_app_set_contents (GNOME_APP (window), panel); + + /* Make the GUI elements visible. */ + + gtk_widget_show (label1); + gtk_widget_show (label1aligned); + gtk_widget_show (label2); + gtk_widget_show (label2aligned); + gtk_widget_show (button); + gtk_widget_show (buttonbar); + gtk_widget_show (panel); + gtk_widget_show (window); + + /* Start the event loop. */ + + gtk_main (); + + return 0; +} diff --git a/gettext-tools/examples/hello-c-gnome/m4/Makefile.am b/gettext-tools/examples/hello-c-gnome/m4/Makefile.am new file mode 100644 index 0000000..14dc5db --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/m4/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 \ + gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4 diff --git a/gettext-tools/examples/hello-c-gnome/m4/gnome-gnorba-check.m4 b/gettext-tools/examples/hello-c-gnome/m4/gnome-gnorba-check.m4 new file mode 100644 index 0000000..dbac0a6 --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/m4/gnome-gnorba-check.m4 @@ -0,0 +1,35 @@ +dnl +dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag) +dnl +dnl if failflag is "failure" it aborts if gnorba is not found. +dnl + +AC_DEFUN([GNOME_GNORBA_HOOK],[ + GNOME_ORBIT_HOOK([],$2) + AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ + gnome_cv_gnorba_found=no + if test x$gnome_cv_orbit_found = xyes; then + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + if test -n "$GNORBA_LIBS"; then + gnome_cv_gnorba_found=yes + fi + fi + ]) + AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + AC_SUBST(GNORBA_CFLAGS) + AC_SUBST(GNORBA_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(gnorba library not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_GNORBA_CHECK], [ + GNOME_GNORBA_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-c-gnome/m4/gnome-orbit-check.m4 b/gettext-tools/examples/hello-c-gnome/m4/gnome-orbit-check.m4 new file mode 100644 index 0000000..54bf33a --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/m4/gnome-orbit-check.m4 @@ -0,0 +1,33 @@ +dnl +dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag) +dnl +dnl if failflag is "failure" it aborts if orbit is not found. +dnl + +AC_DEFUN([GNOME_ORBIT_HOOK],[ + AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) + AC_PATH_PROG(ORBIT_IDL,orbit-idl,no) + AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ + if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then + gnome_cv_orbit_found=no + else + gnome_cv_orbit_found=yes + fi + ]) + AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + ORBIT_CFLAGS=`orbit-config --cflags client server` + ORBIT_LIBS=`orbit-config --use-service=name --libs client server` + AC_SUBST(ORBIT_CFLAGS) + AC_SUBST(ORBIT_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(ORBit not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_ORBIT_CHECK], [ + GNOME_ORBIT_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-c-gnome/m4/gnome.m4 b/gettext-tools/examples/hello-c-gnome/m4/gnome.m4 new file mode 100644 index 0000000..659c22c --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/m4/gnome.m4 @@ -0,0 +1,128 @@ +dnl +dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits]) +dnl +dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh +dnl is not found. +dnl + +AC_DEFUN([GNOME_INIT_HOOK],[ + AC_SUBST(GNOME_LIBS) + AC_SUBST(GNOMEUI_LIBS) + AC_SUBST(GNOMEGNORBA_LIBS) + AC_SUBST(GTKXMHTML_LIBS) + AC_SUBST(ZVT_LIBS) + AC_SUBST(GNOME_LIBDIR) + AC_SUBST(GNOME_INCLUDEDIR) + + AC_ARG_WITH(gnome-includes, + [ --with-gnome-includes Specify location of GNOME headers],[ + CFLAGS="$CFLAGS -I$withval" + ]) + + AC_ARG_WITH(gnome-libs, + [ --with-gnome-libs Specify location of GNOME libs],[ + LDFLAGS="$LDFLAGS -L$withval" + gnome_prefix=$withval + ]) + + AC_ARG_WITH(gnome, + [ --with-gnome Specify prefix for GNOME files], + if test x$withval = xyes; then + want_gnome=yes + dnl Note that an empty true branch is not + dnl valid sh syntax. + ifelse([$1], [], :, [$1]) + else + if test "x$withval" = xno; then + want_gnome=no + else + want_gnome=yes + LDFLAGS="$LDFLAGS -L$withval/lib" + CFLAGS="$CFLAGS -I$withval/include" + gnome_prefix=$withval/lib + fi + fi, + want_gnome=yes) + + if test "x$want_gnome" = xyes; then + + AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) + if test "$GNOME_CONFIG" = "no"; then + no_gnome_config="yes" + else + AC_MSG_CHECKING(if $GNOME_CONFIG works) + if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + GNOME_GNORBA_HOOK([],$2) + GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" + GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" + GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" + GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" + ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" + GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" + GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" + $1 + else + AC_MSG_RESULT(no) + no_gnome_config="yes" + fi + fi + + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + gnome_prefix=$ac_default_prefix/lib + else + gnome_prefix=$prefix/lib + fi + else + gnome_prefix=`eval echo \`echo $libdir\`` + fi + + if test "$no_gnome_config" = "yes"; then + AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) + if test -f $gnome_prefix/gnomeConf.sh; then + AC_MSG_RESULT(found) + echo "loading gnome configuration from" \ + "$gnome_prefix/gnomeConf.sh" + . $gnome_prefix/gnomeConf.sh + $1 + else + AC_MSG_RESULT(not found) + if test x$2 = xfail; then + AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install) + fi + fi + fi + fi + + if test -n "$3"; then + n="$3" + for i in $n; do + AC_MSG_CHECKING(extra library \"$i\") + case $i in + applets) + AC_SUBST(GNOME_APPLETS_LIBS) + GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` + AC_MSG_RESULT($GNOME_APPLETS_LIBS);; + docklets) + AC_SUBST(GNOME_DOCKLETS_LIBS) + GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets` + AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);; + capplet) + AC_SUBST(GNOME_CAPPLET_LIBS) + GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` + AC_MSG_RESULT($GNOME_CAPPLET_LIBS);; + *) + AC_MSG_RESULT(unknown library) + esac + done + fi +]) + +dnl +dnl GNOME_INIT ([additional-inits]) +dnl + +AC_DEFUN([GNOME_INIT],[ + GNOME_INIT_HOOK([],fail,$1) +]) diff --git a/gettext-tools/examples/hello-c-gnome/po/LINGUAS b/gettext-tools/examples/hello-c-gnome/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c-gnome/po/Makevars b/gettext-tools/examples/hello-c-gnome/po/Makevars new file mode 100644 index 0000000..e20fc8c --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/po/Makevars @@ -0,0 +1,55 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format \ + --flag=g_log:3:c-format --flag=g_logv:3:c-format \ + --flag=g_error:1:c-format --flag=g_message:1:c-format \ + --flag=g_critical:1:c-format --flag=g_warning:1:c-format \ + --flag=g_print:1:c-format \ + --flag=g_printerr:1:c-format \ + --flag=g_strdup_printf:1:c-format --flag=g_strdup_vprintf:1:c-format \ + --flag=g_printf_string_upper_bound:1:c-format \ + --flag=g_snprintf:3:c-format --flag=g_vsnprintf:3:c-format \ + --flag=g_string_sprintf:2:c-format \ + --flag=g_string_sprintfa:2:c-format \ + --flag=g_scanner_error:2:c-format \ + --flag=g_scanner_warn:2:c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-c-gnome/po/POTFILES.in b/gettext-tools/examples/hello-c-gnome/po/POTFILES.in new file mode 100644 index 0000000..afcce5f --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.c diff --git a/gettext-tools/examples/hello-c-gnome/po/de.po b/gettext-tools/examples/hello-c-gnome/po/de.po new file mode 100644 index 0000000..6d0f946 --- /dev/null +++ b/gettext-tools/examples/hello-c-gnome/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-c-gnome package +# German messages for hello-c-gnome. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c-gnome package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c-gnome\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:59+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.c:47 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.c:52 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-c/INSTALL b/gettext-tools/examples/hello-c/INSTALL new file mode 100644 index 0000000..84d9aef --- /dev/null +++ b/gettext-tools/examples/hello-c/INSTALL @@ -0,0 +1 @@ +This example relies just on gettext-runtime (and libc, of course). diff --git a/gettext-tools/examples/hello-c/Makefile.am b/gettext-tools/examples/hello-c/Makefile.am new file mode 100644 index 0000000..a0866af --- /dev/null +++ b/gettext-tools/examples/hello-c/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.c gettext.h + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gettext.h include file is found. +INCLUDES = -I. -I$(srcdir) + +# Link time dependencies. +LDADD = @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-c/autoclean.sh b/gettext-tools/examples/hello-c/autoclean.sh new file mode 100755 index 0000000..d6b42cd --- /dev/null +++ b/gettext-tools/examples/hello-c/autoclean.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f gettext.h + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-c/autogen.sh b/gettext-tools/examples/hello-c/autogen.sh new file mode 100755 index 0000000..c21af8c --- /dev/null +++ b/gettext-tools/examples/hello-c/autogen.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${GETTEXTSRCDIR-../../../gettext-tools/lib}/gettext.h gettext.h + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-c/configure.ac b/gettext-tools/examples/hello-c/configure.ac new file mode 100644 index 0000000..4fb4769 --- /dev/null +++ b/gettext-tools/examples/hello-c/configure.ac @@ -0,0 +1,19 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.c) +AM_INIT_AUTOMAKE(hello-c, 0) + +AC_PROG_CC +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-c/hello.c b/gettext-tools/examples/hello-c/hello.c new file mode 100644 index 0000000..5807cac --- /dev/null +++ b/gettext-tools/examples/hello-c/hello.c @@ -0,0 +1,36 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the C program. */ + + +/* Get setlocale() declaration. */ +#include <locale.h> + +/* Get printf() declaration. */ +#include <stdio.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +/* Get gettext(), textdomain(), bindtextdomain() declaration. */ +#include "gettext.h" +/* Define shortcut for gettext(). */ +#define _(string) gettext (string) + +int +main () +{ + setlocale (LC_ALL, ""); + textdomain ("hello-c"); + bindtextdomain ("hello-c", LOCALEDIR); + + printf ("%s\n", _("Hello, world!")); + printf (_("This program is running as process number %d."), getpid ()); + putchar ('\n'); + + return 0; +} diff --git a/gettext-tools/examples/hello-c/m4/Makefile.am b/gettext-tools/examples/hello-c/m4/Makefile.am new file mode 100644 index 0000000..d6431f0 --- /dev/null +++ b/gettext-tools/examples/hello-c/m4/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 diff --git a/gettext-tools/examples/hello-c/po/LINGUAS b/gettext-tools/examples/hello-c/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-c/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-c/po/Makevars b/gettext-tools/examples/hello-c/po/Makevars new file mode 100644 index 0000000..03bfa22 --- /dev/null +++ b/gettext-tools/examples/hello-c/po/Makevars @@ -0,0 +1,43 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-c/po/POTFILES.in b/gettext-tools/examples/hello-c/po/POTFILES.in new file mode 100644 index 0000000..afcce5f --- /dev/null +++ b/gettext-tools/examples/hello-c/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.c diff --git a/gettext-tools/examples/hello-c/po/de.po b/gettext-tools/examples/hello-c/po/de.po new file mode 100644 index 0000000..0917458 --- /dev/null +++ b/gettext-tools/examples/hello-c/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-c package +# German messages for hello-c. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-c package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-c\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:59+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.c:31 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.c:32 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-clisp/INSTALL b/gettext-tools/examples/hello-clisp/INSTALL new file mode 100644 index 0000000..caca023 --- /dev/null +++ b/gettext-tools/examples/hello-clisp/INSTALL @@ -0,0 +1 @@ +This example relies on clisp (GNU clisp). diff --git a/gettext-tools/examples/hello-clisp/Makefile.am b/gettext-tools/examples/hello-clisp/Makefile.am new file mode 100644 index 0000000..35f4ca2 --- /dev/null +++ b/gettext-tools/examples/hello-clisp/Makefile.am @@ -0,0 +1,30 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Compilation of Common Lisp programs. +SUFFIXES = .lisp .fas +.lisp.fas: + clisp -norc -q -c $< -o $@ +CLEANFILES = *.fas *.lib + +# Making a Common Lisp program executable. +hello: hello.fas + (echo '#!@CLISP@'; cat $<) > $@ + chmod a+x $@ +CLEANFILES += hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-clisp/autoclean.sh b/gettext-tools/examples/hello-clisp/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-clisp/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-clisp/autogen.sh b/gettext-tools/examples/hello-clisp/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-clisp/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-clisp/configure.ac b/gettext-tools/examples/hello-clisp/configure.ac new file mode 100644 index 0000000..2769441 --- /dev/null +++ b/gettext-tools/examples/hello-clisp/configure.ac @@ -0,0 +1,39 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.lisp.in) +AM_INIT_AUTOMAKE(hello-clisp, 0) + +dnl Check for availability of the Lisp system. +AC_PATH_PROG(CLISP, clisp) +if test -z "$CLISP"; then + echo "*** Essential program clisp not found" 1>&2 + exit 1 +fi +AC_SUBST(CLISP) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile hello.lisp]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-clisp/hello.lisp.in b/gettext-tools/examples/hello-clisp/hello.lisp.in new file mode 100644 index 0000000..530346b --- /dev/null +++ b/gettext-tools/examples/hello-clisp/hello.lisp.in @@ -0,0 +1,16 @@ +#| Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the GNU clisp program. +|# + +(setf (i18n:textdomain) "hello-clisp") +(setf (i18n:textdomaindir "hello-clisp") "@localedir@/") +(defmacro _ (string) `(i18n:gettext ,string)) + +(write-line (_ "Hello, world!")) + +(format t (_ "This program is running as process number ~D.") + (system::program-id)) +(terpri) diff --git a/gettext-tools/examples/hello-clisp/m4/Makefile.am b/gettext-tools/examples/hello-clisp/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-clisp/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-clisp/po/LINGUAS b/gettext-tools/examples/hello-clisp/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-clisp/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-clisp/po/Makefile.am b/gettext-tools/examples/hello-clisp/po/Makefile.am new file mode 100644 index 0000000..128c734 --- /dev/null +++ b/gettext-tools/examples/hello-clisp/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.lisp.in + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --flag=_:1:pass-lisp-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-clisp/po/de.po b/gettext-tools/examples/hello-clisp/po/de.po new file mode 100644 index 0000000..48eb90c --- /dev/null +++ b/gettext-tools/examples/hello-clisp/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-clisp package +# German messages for hello-clisp. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-clisp package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-clisp\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.lisp.in:12 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.lisp.in:14 +#, lisp-format +msgid "This program is running as process number ~D." +msgstr "Dieses Programm läuft mit der Prozess-Nummer ~D." diff --git a/gettext-tools/examples/hello-gawk/INSTALL b/gettext-tools/examples/hello-gawk/INSTALL new file mode 100644 index 0000000..215990a --- /dev/null +++ b/gettext-tools/examples/hello-gawk/INSTALL @@ -0,0 +1 @@ +This example relies on gawk (GNU awk). diff --git a/gettext-tools/examples/hello-gawk/Makefile.am b/gettext-tools/examples/hello-gawk/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-gawk/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-gawk/autoclean.sh b/gettext-tools/examples/hello-gawk/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-gawk/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-gawk/autogen.sh b/gettext-tools/examples/hello-gawk/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-gawk/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-gawk/configure.ac b/gettext-tools/examples/hello-gawk/configure.ac new file mode 100644 index 0000000..3103280 --- /dev/null +++ b/gettext-tools/examples/hello-gawk/configure.ac @@ -0,0 +1,40 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.awk) +AM_INIT_AUTOMAKE(hello-gawk, 0) + +dnl Check for availability of GNU awk. +AC_PATH_PROG(GAWK, gawk) +if test -z "$GAWK"; then + echo "*** Essential program gawk not found" 1>&2 + exit 1 +fi +AC_SUBST(GAWK) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.awk], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-gawk/hello.awk b/gettext-tools/examples/hello-gawk/hello.awk new file mode 100644 index 0000000..872d2af --- /dev/null +++ b/gettext-tools/examples/hello-gawk/hello.awk @@ -0,0 +1,15 @@ +#!@GAWK@ -f +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the GNU awk program. + +BEGIN { + TEXTDOMAIN = "hello-gawk" + bindtextdomain ("@localedir@") + + print _"Hello, world!" + printf _"This program is running as process number %d.", PROCINFO["pid"] + print +} diff --git a/gettext-tools/examples/hello-gawk/m4/Makefile.am b/gettext-tools/examples/hello-gawk/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-gawk/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-gawk/po/LINGUAS b/gettext-tools/examples/hello-gawk/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-gawk/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-gawk/po/Makefile.am b/gettext-tools/examples/hello-gawk/po/Makefile.am new file mode 100644 index 0000000..c902b8a --- /dev/null +++ b/gettext-tools/examples/hello-gawk/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.awk + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-gawk/po/de.po b/gettext-tools/examples/hello-gawk/po/de.po new file mode 100644 index 0000000..1eeb41e --- /dev/null +++ b/gettext-tools/examples/hello-gawk/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-gawk package +# German messages for hello-gawk. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-gawk package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-gawk\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:05+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.awk:12 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.awk:13 +#, awk-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-java-awt/Hello.java b/gettext-tools/examples/hello-java-awt/Hello.java new file mode 100644 index 0000000..9495f5e --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/Hello.java @@ -0,0 +1,67 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. +// +// Source code of the Java/AWT program. + +import java.util.*; +import java.io.*; +import java.text.*; +import java.awt.*; +import java.awt.event.*; +import gnu.gettext.*; + +public class Hello { + public static void main (String[] args) { + ResourceBundle catalog = ResourceBundle.getBundle("hello-java-awt"); + Frame frame = new Frame("Hello example"); + frame.addWindowListener( + new WindowAdapter() { + public void windowClosing (WindowEvent event) { + System.exit(0); + } + }); + Label label1 = new Label(GettextResource.gettext(catalog,"Hello, world!")); + Label label2 = + new Label( + MessageFormat.format( + GettextResource.gettext(catalog, + "This program is running as process number {0}."), + new Object[] { getPid() })); + Button button = new Button("OK"); + button.addActionListener( + new ActionListener() { + public void actionPerformed (ActionEvent event) { + System.exit(0); + } + }); + Container labels = new Container(); + labels.setLayout(new GridLayout(2, 1)); + labels.add(label1); + labels.add(label2); + Container buttons = new Container(); + buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); + buttons.add(button); + frame.setLayout(new BorderLayout()); + frame.add(labels, BorderLayout.CENTER); + frame.add(buttons, BorderLayout.SOUTH); + frame.pack(); + frame.setVisible(true); + } + + /* Return the process ID of the current process. */ + private static String getPid () { + try { + String[] args = new String[] { "/bin/sh", "-c", "echo $PPID" }; + Process p = Runtime.getRuntime().exec(args); + InputStream p_out = p.getInputStream(); + String s = (new BufferedReader(new InputStreamReader(p_out))).readLine(); + p.destroy(); + if (s != null) + return s; + } catch (IOException e) { + e.printStackTrace(); + } + return "???"; + } +} diff --git a/gettext-tools/examples/hello-java-awt/INSTALL b/gettext-tools/examples/hello-java-awt/INSTALL new file mode 100644 index 0000000..fd1e55c --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - a Java implementation with AWT diff --git a/gettext-tools/examples/hello-java-awt/Makefile.am b/gettext-tools/examples/hello-java-awt/Makefile.am new file mode 100644 index 0000000..e10346a --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/Makefile.am @@ -0,0 +1,166 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_JAVAPROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = Hello.java +hello_CLASSES = Hello.class + +# The entry point of the 'hello' program. +hello_MAINCLASS = Hello + +# The link dependencies of the 'hello' program. +hello_JAVALIBS = @LIBINTL_JAR@ + +# The resources of the 'hello' program, excluding message catalogs, but +# including the fallback message catalog. +hello_RESOURCES = hello-java-awt.properties + +# Resources that are generated from PO files. +MAINTAINERCLEANFILES = hello-java-awt*.properties + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh + + +# ----------------- General rules for compiling Java programs ----------------- + +jardir = $(datadir)/$(PACKAGE) +pkgdatadir = $(datadir)/$(PACKAGE) +pkglibdir = $(libdir)/$(PACKAGE) + +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +JAR = @JAR@ +JAVACOMP = $(SHELL) javacomp.sh +AR = ar +RANLIB = @RANLIB@ + +EXTRA_DIST += $(hello_SOURCES) +CLEANFILES = +DISTCLEANFILES = javacomp.sh javaexec.sh + + +if USEJEXE + + +# Rules for compiling Java programs as native code. + +all-local: $(hello_MAINCLASS)$(EXEEXT) hello-resources.jar hello.sh + +# Does not work yet with GCC 3.3. +#$(hello_MAINCLASS)$(EXEEXT): $(srcdir)/Hello.java +# CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) $(srcdir)/Hello.java $(hello_JAVALIBS) --main=$(hello_MAINCLASS) -o $@ + +$(hello_MAINCLASS)$(EXEEXT): Hello.$(OBJEXT) libintl.a + $(GCJ) $(GCJFLAGS) Hello.$(OBJEXT) libintl.a --main=$(hello_MAINCLASS) -o $@ + +Hello.$(OBJEXT): $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) -c $(srcdir)/Hello.java -o $@ + +libintl.a: + rm -rf tmpdir + mkdir tmpdir + cd tmpdir && $(JAR) xf @LIBINTL_JAR@ && \ + for f in `find . -name '*.class' -print`; do \ + $(GCJ) $(GCJFLAGS) -c $$f -o `echo $$f | sed -e 's,^\./,,' -e 's,\.class$$,,' -e 's,/,.,g'`.$(OBJEXT) || exit 1; \ + done && \ + rm -f ../libintl.a && \ + ar cru ../libintl.a `find . -name '*.$(OBJEXT)' -print` + rm -rf tmpdir + $(RANLIB) $@ + +hello-resources.jar: + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cf $@ $(hello_RESOURCES) $$catalogs + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello-resources.jar'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec '$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT)' \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(hello_MAINCLASS)$(EXEEXT) $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello-resources.jar $(DESTDIR)$(jardir)/hello-resources.jar + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $(DESTDIR)$(jardir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + rm -f $(DESTDIR)$(jardir)/hello-resources.jar + +CLEANFILES += $(hello_MAINCLASS)$(EXEEXT) *.$(OBJEXT) *.a tmpdir hello-resources.jar hello.sh + + +else + + +# Rules for compiling Java programs as jar libraries. +# This is the preferred mode during development, because you can easily test +# the program without installing it, simply by doing "java -jar hello.jar". + +all-local: hello.jar hello.sh + +hello.jar: $(hello_CLASSES) + { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs + rm -f Manifest.mf + +Hello.class: $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(jardir)/hello.jar + rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh + +CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh + + +endif diff --git a/gettext-tools/examples/hello-java-awt/autoclean.sh b/gettext-tools/examples/hello-java-awt/autoclean.sh new file mode 100755 index 0000000..bc98b97 --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/autoclean.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Brought in by explicit copy. +rm -f m4/gcj.m4 +rm -f m4/javacomp.m4 +rm -f m4/javaexec.m4 +rm -f javacomp.sh.in +rm -f javaexec.sh.in + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f hello-java-awt*.properties diff --git a/gettext-tools/examples/hello-java-awt/autogen.sh b/gettext-tools/examples/hello-java-awt/autogen.sh new file mode 100755 index 0000000..a8f05a9 --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/gcj.m4 m4/gcj.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javacomp.m4 m4/javacomp.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javaexec.m4 m4/javaexec.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javacomp.sh.in javacomp.sh.in +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javaexec.sh.in javaexec.sh.in + +aclocal -I m4 + +autoconf + +automake -a -c + +./configure +cd po +make update-po +cd .. +make distclean diff --git a/gettext-tools/examples/hello-java-awt/configure.ac b/gettext-tools/examples/hello-java-awt/configure.ac new file mode 100644 index 0000000..70c63ad --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/configure.ac @@ -0,0 +1,70 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(Hello.java) +AM_INIT_AUTOMAKE(hello-java-awt, 0) + +dnl Check whether we can build native executable. +AC_ARG_ENABLE(java-exe, + [ --enable-java-exe compile Java to native code, not to bytecode], + :, enable_java_exe=no) +gt_GCJ +if test "$enable_java_exe" != no && test -n "$HAVE_GCJ"; then + BUILDJAVAEXE=yes +else + BUILDJAVAEXE=no +fi +AC_SUBST(BUILDJAVAEXE) +AM_CONDITIONAL([USEJEXE], [test $BUILDJAVAEXE = yes]) +AC_PROG_RANLIB + +dnl Check whether we can build Java programs at all. +gt_JAVACOMP +AC_CHECK_PROG(JAR, jar, jar) +if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then + BUILDJAVA=yes +else + BUILDJAVA=no +fi +AC_SUBST(BUILDJAVA) + +dnl Check whether we can execute Java programs. +gt_JAVAEXEC([TestAWT], [$srcdir/m4]) +if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then + TESTJAVA=yes +else + TESTJAVA=no +fi +AC_SUBST(TESTJAVA) + +dnl Checks for compiler output filename suffixes. +AC_OBJEXT +AC_EXEEXT + +dnl Checks for needed libraries. +AM_PATH_PROG_WITH_TEST([GETTEXT_WITH_LIBINTL_JAR], [gettext], + [{ basedir=`echo "$ac_dir" | sed -e 's,/bin$,,'`; test -r "$basedir"/share/gettext/libintl.jar; }]) +if test -z "$GETTEXT_WITH_LIBINTL_JAR"; then + echo "Required library libintl.jar not found." 1>&2 + exit 1 +fi +changequote(,)dnl +basedir=`echo "$GETTEXT_WITH_LIBINTL_JAR" | sed -e 's,/[^/]*$,,' | sed -e 's,/bin$,,'` +changequote([, ])dnl +LIBINTL_JAR="$basedir"/share/gettext/libintl.jar +AC_SUBST([LIBINTL_JAR]) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([javacomp.sh]) +AC_CONFIG_FILES([javaexec.sh]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-java-awt/m4/Makefile.am b/gettext-tools/examples/hello-java-awt/m4/Makefile.am new file mode 100644 index 0000000..26f6298 --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/m4/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ + nls.m4 po.m4 \ + gcj.m4 javacomp.m4 javaexec.m4 TestAWT.java TestAWT.class diff --git a/gettext-tools/examples/hello-java-awt/m4/TestAWT.class b/gettext-tools/examples/hello-java-awt/m4/TestAWT.class Binary files differnew file mode 100644 index 0000000..1c993c5 --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/m4/TestAWT.class diff --git a/gettext-tools/examples/hello-java-awt/m4/TestAWT.java b/gettext-tools/examples/hello-java-awt/m4/TestAWT.java new file mode 100644 index 0000000..21515fc --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/m4/TestAWT.java @@ -0,0 +1,11 @@ +// Test for working AWT. +public class TestAWT { + public static void main (String[] args) { + try { + java.awt.Toolkit.getDefaultToolkit(); + } catch (Throwable e) { + System.exit(1); + } + System.exit(0); + } +} diff --git a/gettext-tools/examples/hello-java-awt/po/LINGUAS b/gettext-tools/examples/hello-java-awt/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-java-awt/po/Makefile.am b/gettext-tools/examples/hello-java-awt/po/Makefile.am new file mode 100644 index 0000000..b1189f9 --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/po/Makefile.am @@ -0,0 +1,204 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + Hello.java + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGCAT = msgcat +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES = @PROPERTIESFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES = @CLASSFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS = @JAVACATALOGS@ + +SUFFIXES = .po .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: stamp-po + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + $(MAKE) update-properties + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + +MAINTAINERCLEANFILES = stamp-po + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-properties + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-properties: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po || exit 1; \ + echo "$(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \ + $(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \ + mv $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(top_srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \ + done + +# Alternatively, we could create classes instead of properties files. +update-classes: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \ + done + +echo-catalogs: + @echo $(CATALOGS) diff --git a/gettext-tools/examples/hello-java-awt/po/de.po b/gettext-tools/examples/hello-java-awt/po/de.po new file mode 100644 index 0000000..2ead05e --- /dev/null +++ b/gettext-tools/examples/hello-java-awt/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-java-awt package +# German messages for hello-java-awt. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-java-awt package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-java-awt\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:03+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Hello.java:24 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: Hello.java:29 +#, java-format +msgid "This program is running as process number {0}." +msgstr "Dieses Programm läuft mit der Prozess-Nummer {0}." diff --git a/gettext-tools/examples/hello-java-swing/Hello.java b/gettext-tools/examples/hello-java-swing/Hello.java new file mode 100644 index 0000000..0fc1af7 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/Hello.java @@ -0,0 +1,64 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. +// +// Source code of the Java/Swing program. + +import java.util.*; +import java.io.*; +import java.text.*; +import java.awt.*; +import java.awt.event.*; +import javax.swing.*; +import gnu.gettext.*; + +public class Hello { + public static void main (String[] args) { + ResourceBundle catalog = ResourceBundle.getBundle("hello-java-swing"); + JFrame frame = new JFrame("Hello example"); + frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); + JLabel label1 = + new JLabel(GettextResource.gettext(catalog,"Hello, world!")); + JLabel label2 = + new JLabel( + MessageFormat.format( + GettextResource.gettext(catalog, + "This program is running as process number {0}."), + new Object[] { getPid() })); + JButton button = new JButton("OK"); + button.addActionListener( + new ActionListener() { + public void actionPerformed (ActionEvent event) { + System.exit(0); + } + }); + JPanel labels = new JPanel(); + labels.setLayout(new GridLayout(2, 1)); + labels.add(label1); + labels.add(label2); + JPanel buttons = new JPanel(); + buttons.setLayout(new FlowLayout(FlowLayout.RIGHT)); + buttons.add(button); + frame.getContentPane().setLayout(new BorderLayout()); + frame.getContentPane().add(labels, BorderLayout.CENTER); + frame.getContentPane().add(buttons, BorderLayout.SOUTH); + frame.pack(); + frame.setVisible(true); + } + + /* Return the process ID of the current process. */ + private static String getPid () { + try { + String[] args = new String[] { "/bin/sh", "-c", "echo $PPID" }; + Process p = Runtime.getRuntime().exec(args); + InputStream p_out = p.getInputStream(); + String s = (new BufferedReader(new InputStreamReader(p_out))).readLine(); + p.destroy(); + if (s != null) + return s; + } catch (IOException e) { + e.printStackTrace(); + } + return "???"; + } +} diff --git a/gettext-tools/examples/hello-java-swing/INSTALL b/gettext-tools/examples/hello-java-swing/INSTALL new file mode 100644 index 0000000..5e97a13 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/INSTALL @@ -0,0 +1,3 @@ +This example relies on: + - a Java implementation with AWT and Swing + (i.e. when using Sun's JDK: at least JDK 1.2) diff --git a/gettext-tools/examples/hello-java-swing/Makefile.am b/gettext-tools/examples/hello-java-swing/Makefile.am new file mode 100644 index 0000000..3482164 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/Makefile.am @@ -0,0 +1,166 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_JAVAPROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = Hello.java +hello_CLASSES = Hello.class + +# The entry point of the 'hello' program. +hello_MAINCLASS = Hello + +# The link dependencies of the 'hello' program. +hello_JAVALIBS = @LIBINTL_JAR@ + +# The resources of the 'hello' program, excluding message catalogs, but +# including the fallback message catalog. +hello_RESOURCES = hello-java-swing.properties + +# Resources that are generated from PO files. +MAINTAINERCLEANFILES = hello-java-swing*.properties + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh + + +# ----------------- General rules for compiling Java programs ----------------- + +jardir = $(datadir)/$(PACKAGE) +pkgdatadir = $(datadir)/$(PACKAGE) +pkglibdir = $(libdir)/$(PACKAGE) + +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +JAR = @JAR@ +JAVACOMP = $(SHELL) javacomp.sh +AR = ar +RANLIB = @RANLIB@ + +EXTRA_DIST += $(hello_SOURCES) +CLEANFILES = +DISTCLEANFILES = javacomp.sh javaexec.sh + + +if USEJEXE + + +# Rules for compiling Java programs as native code. + +all-local: $(hello_MAINCLASS)$(EXEEXT) hello-resources.jar hello.sh + +# Does not work yet with GCC 3.3. +#$(hello_MAINCLASS)$(EXEEXT): $(srcdir)/Hello.java +# CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) $(srcdir)/Hello.java $(hello_JAVALIBS) --main=$(hello_MAINCLASS) -o $@ + +$(hello_MAINCLASS)$(EXEEXT): Hello.$(OBJEXT) libintl.a + $(GCJ) $(GCJFLAGS) Hello.$(OBJEXT) libintl.a --main=$(hello_MAINCLASS) -o $@ + +Hello.$(OBJEXT): $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) -c $(srcdir)/Hello.java -o $@ + +libintl.a: + rm -rf tmpdir + mkdir tmpdir + cd tmpdir && $(JAR) xf @LIBINTL_JAR@ && \ + for f in `find . -name '*.class' -print`; do \ + $(GCJ) $(GCJFLAGS) -c $$f -o `echo $$f | sed -e 's,^\./,,' -e 's,\.class$$,,' -e 's,/,.,g'`.$(OBJEXT) || exit 1; \ + done && \ + rm -f ../libintl.a && \ + ar cru ../libintl.a `find . -name '*.$(OBJEXT)' -print` + rm -rf tmpdir + $(RANLIB) $@ + +hello-resources.jar: + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cf $@ $(hello_RESOURCES) $$catalogs + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello-resources.jar'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec '$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT)' \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(hello_MAINCLASS)$(EXEEXT) $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello-resources.jar $(DESTDIR)$(jardir)/hello-resources.jar + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $(DESTDIR)$(jardir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + rm -f $(DESTDIR)$(jardir)/hello-resources.jar + +CLEANFILES += $(hello_MAINCLASS)$(EXEEXT) *.$(OBJEXT) *.a tmpdir hello-resources.jar hello.sh + + +else + + +# Rules for compiling Java programs as jar libraries. +# This is the preferred mode during development, because you can easily test +# the program without installing it, simply by doing "java -jar hello.jar". + +all-local: hello.jar hello.sh + +hello.jar: $(hello_CLASSES) + { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs + rm -f Manifest.mf + +Hello.class: $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(jardir)/hello.jar + rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh + +CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh + + +endif diff --git a/gettext-tools/examples/hello-java-swing/autoclean.sh b/gettext-tools/examples/hello-java-swing/autoclean.sh new file mode 100755 index 0000000..9d0209c --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/autoclean.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Brought in by explicit copy. +rm -f m4/gcj.m4 +rm -f m4/javacomp.m4 +rm -f m4/javaexec.m4 +rm -f javacomp.sh.in +rm -f javaexec.sh.in + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f hello-java-swing*.properties diff --git a/gettext-tools/examples/hello-java-swing/autogen.sh b/gettext-tools/examples/hello-java-swing/autogen.sh new file mode 100755 index 0000000..a8f05a9 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/gcj.m4 m4/gcj.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javacomp.m4 m4/javacomp.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javaexec.m4 m4/javaexec.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javacomp.sh.in javacomp.sh.in +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javaexec.sh.in javaexec.sh.in + +aclocal -I m4 + +autoconf + +automake -a -c + +./configure +cd po +make update-po +cd .. +make distclean diff --git a/gettext-tools/examples/hello-java-swing/configure.ac b/gettext-tools/examples/hello-java-swing/configure.ac new file mode 100644 index 0000000..6abdc3d --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/configure.ac @@ -0,0 +1,70 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(Hello.java) +AM_INIT_AUTOMAKE(hello-java-swing, 0) + +dnl Check whether we can build native executable. +AC_ARG_ENABLE(java-exe, + [ --enable-java-exe compile Java to native code, not to bytecode], + :, enable_java_exe=no) +gt_GCJ +if test "$enable_java_exe" != no && test -n "$HAVE_GCJ"; then + BUILDJAVAEXE=yes +else + BUILDJAVAEXE=no +fi +AC_SUBST(BUILDJAVAEXE) +AM_CONDITIONAL([USEJEXE], [test $BUILDJAVAEXE = yes]) +AC_PROG_RANLIB + +dnl Check whether we can build Java programs at all. +gt_JAVACOMP +AC_CHECK_PROG(JAR, jar, jar) +if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then + BUILDJAVA=yes +else + BUILDJAVA=no +fi +AC_SUBST(BUILDJAVA) + +dnl Check whether we can execute Java programs. +gt_JAVAEXEC([TestAWT], [$srcdir/m4]) +if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then + TESTJAVA=yes +else + TESTJAVA=no +fi +AC_SUBST(TESTJAVA) + +dnl Checks for compiler output filename suffixes. +AC_OBJEXT +AC_EXEEXT + +dnl Checks for needed libraries. +AM_PATH_PROG_WITH_TEST([GETTEXT_WITH_LIBINTL_JAR], [gettext], + [{ basedir=`echo "$ac_dir" | sed -e 's,/bin$,,'`; test -r "$basedir"/share/gettext/libintl.jar; }]) +if test -z "$GETTEXT_WITH_LIBINTL_JAR"; then + echo "Required library libintl.jar not found." 1>&2 + exit 1 +fi +changequote(,)dnl +basedir=`echo "$GETTEXT_WITH_LIBINTL_JAR" | sed -e 's,/[^/]*$,,' | sed -e 's,/bin$,,'` +changequote([, ])dnl +LIBINTL_JAR="$basedir"/share/gettext/libintl.jar +AC_SUBST([LIBINTL_JAR]) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([javacomp.sh]) +AC_CONFIG_FILES([javaexec.sh]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-java-swing/m4/Makefile.am b/gettext-tools/examples/hello-java-swing/m4/Makefile.am new file mode 100644 index 0000000..26f6298 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/m4/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ + nls.m4 po.m4 \ + gcj.m4 javacomp.m4 javaexec.m4 TestAWT.java TestAWT.class diff --git a/gettext-tools/examples/hello-java-swing/m4/TestAWT.class b/gettext-tools/examples/hello-java-swing/m4/TestAWT.class Binary files differnew file mode 100644 index 0000000..1c993c5 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/m4/TestAWT.class diff --git a/gettext-tools/examples/hello-java-swing/m4/TestAWT.java b/gettext-tools/examples/hello-java-swing/m4/TestAWT.java new file mode 100644 index 0000000..21515fc --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/m4/TestAWT.java @@ -0,0 +1,11 @@ +// Test for working AWT. +public class TestAWT { + public static void main (String[] args) { + try { + java.awt.Toolkit.getDefaultToolkit(); + } catch (Throwable e) { + System.exit(1); + } + System.exit(0); + } +} diff --git a/gettext-tools/examples/hello-java-swing/po/LINGUAS b/gettext-tools/examples/hello-java-swing/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-java-swing/po/Makefile.am b/gettext-tools/examples/hello-java-swing/po/Makefile.am new file mode 100644 index 0000000..b1189f9 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/po/Makefile.am @@ -0,0 +1,204 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + Hello.java + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGCAT = msgcat +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES = @PROPERTIESFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES = @CLASSFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS = @JAVACATALOGS@ + +SUFFIXES = .po .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: stamp-po + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + $(MAKE) update-properties + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + +MAINTAINERCLEANFILES = stamp-po + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-properties + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-properties: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po || exit 1; \ + echo "$(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \ + $(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \ + mv $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(top_srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \ + done + +# Alternatively, we could create classes instead of properties files. +update-classes: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \ + done + +echo-catalogs: + @echo $(CATALOGS) diff --git a/gettext-tools/examples/hello-java-swing/po/de.po b/gettext-tools/examples/hello-java-swing/po/de.po new file mode 100644 index 0000000..4009681 --- /dev/null +++ b/gettext-tools/examples/hello-java-swing/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-java-swing package +# German messages for hello-java-swing. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-java-swing package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-java-swing\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:04+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Hello.java:21 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: Hello.java:26 +#, java-format +msgid "This program is running as process number {0}." +msgstr "Dieses Programm läuft mit der Prozess-Nummer {0}." diff --git a/gettext-tools/examples/hello-java/Hello.java b/gettext-tools/examples/hello-java/Hello.java new file mode 100644 index 0000000..a92f18c --- /dev/null +++ b/gettext-tools/examples/hello-java/Hello.java @@ -0,0 +1,38 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. +// +// Source code of the Java program. + +import java.util.*; +import java.io.*; +import java.text.*; +import gnu.gettext.*; + +public class Hello { + public static void main (String[] args) { + ResourceBundle catalog = ResourceBundle.getBundle("hello-java"); + System.out.println(GettextResource.gettext(catalog,"Hello, world!")); + System.out.println( + MessageFormat.format( + GettextResource.gettext(catalog, + "This program is running as process number {0}."), + new Object[] { getPid() })); + } + + /* Return the process ID of the current process. */ + private static String getPid () { + try { + String[] args = new String[] { "/bin/sh", "-c", "echo $PPID" }; + Process p = Runtime.getRuntime().exec(args); + InputStream p_out = p.getInputStream(); + String s = (new BufferedReader(new InputStreamReader(p_out))).readLine(); + p.destroy(); + if (s != null) + return s; + } catch (IOException e) { + e.printStackTrace(); + } + return "???"; + } +} diff --git a/gettext-tools/examples/hello-java/INSTALL b/gettext-tools/examples/hello-java/INSTALL new file mode 100644 index 0000000..ca63171 --- /dev/null +++ b/gettext-tools/examples/hello-java/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - a Java implementation diff --git a/gettext-tools/examples/hello-java/Makefile.am b/gettext-tools/examples/hello-java/Makefile.am new file mode 100644 index 0000000..9b3424c --- /dev/null +++ b/gettext-tools/examples/hello-java/Makefile.am @@ -0,0 +1,166 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_JAVAPROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = Hello.java +hello_CLASSES = Hello.class + +# The entry point of the 'hello' program. +hello_MAINCLASS = Hello + +# The link dependencies of the 'hello' program. +hello_JAVALIBS = @LIBINTL_JAR@ + +# The resources of the 'hello' program, excluding message catalogs, but +# including the fallback message catalog. +hello_RESOURCES = hello-java.properties + +# Resources that are generated from PO files. +MAINTAINERCLEANFILES = hello-java*.properties + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh + + +# ----------------- General rules for compiling Java programs ----------------- + +jardir = $(datadir)/$(PACKAGE) +pkgdatadir = $(datadir)/$(PACKAGE) +pkglibdir = $(libdir)/$(PACKAGE) + +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +JAR = @JAR@ +JAVACOMP = $(SHELL) javacomp.sh +AR = ar +RANLIB = @RANLIB@ + +EXTRA_DIST += $(hello_SOURCES) +CLEANFILES = +DISTCLEANFILES = javacomp.sh javaexec.sh + + +if USEJEXE + + +# Rules for compiling Java programs as native code. + +all-local: $(hello_MAINCLASS)$(EXEEXT) hello-resources.jar hello.sh + +# Does not work yet with GCC 3.3. +#$(hello_MAINCLASS)$(EXEEXT): $(srcdir)/Hello.java +# CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) $(srcdir)/Hello.java $(hello_JAVALIBS) --main=$(hello_MAINCLASS) -o $@ + +$(hello_MAINCLASS)$(EXEEXT): Hello.$(OBJEXT) libintl.a + $(GCJ) $(GCJFLAGS) Hello.$(OBJEXT) libintl.a --main=$(hello_MAINCLASS) -o $@ + +Hello.$(OBJEXT): $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(GCJ) $(GCJFLAGS) -c $(srcdir)/Hello.java -o $@ + +libintl.a: + rm -rf tmpdir + mkdir tmpdir + cd tmpdir && $(JAR) xf @LIBINTL_JAR@ && \ + for f in `find . -name '*.class' -print`; do \ + $(GCJ) $(GCJFLAGS) -c $$f -o `echo $$f | sed -e 's,^\./,,' -e 's,\.class$$,,' -e 's,/,.,g'`.$(OBJEXT) || exit 1; \ + done && \ + rm -f ../libintl.a && \ + ar cru ../libintl.a `find . -name '*.$(OBJEXT)' -print` + rm -rf tmpdir + $(RANLIB) $@ + +hello-resources.jar: + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cf $@ $(hello_RESOURCES) $$catalogs + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello-resources.jar'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec '$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT)' \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(hello_MAINCLASS)$(EXEEXT) $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello-resources.jar $(DESTDIR)$(jardir)/hello-resources.jar + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(mkinstalldirs) $(DESTDIR)$(jardir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(pkglibdir)/$(hello_MAINCLASS)$(EXEEXT) + rm -f $(DESTDIR)$(jardir)/hello-resources.jar + +CLEANFILES += $(hello_MAINCLASS)$(EXEEXT) *.$(OBJEXT) *.a tmpdir hello-resources.jar hello.sh + + +else + + +# Rules for compiling Java programs as jar libraries. +# This is the preferred mode during development, because you can easily test +# the program without installing it, simply by doing "java -jar hello.jar". + +all-local: hello.jar hello.sh + +hello.jar: $(hello_CLASSES) + { echo "Manifest-Version: 1.0"; echo "Main-Class: $(hello_MAINCLASS)"; echo 'Class-Path: @LIBINTL_JAR@'; } > Manifest.mf + catalogs=`MAKEFLAGS= $(MAKE) -s -C po echo-catalogs`; \ + $(JAR) cfm $@ Manifest.mf Hello*.class $(hello_RESOURCES) $$catalogs + rm -f Manifest.mf + +Hello.class: $(srcdir)/Hello.java + CLASSPATH=.@CLASSPATH_SEPARATOR@$(hello_JAVALIBS) $(JAVACOMP) -d . $(srcdir)/Hello.java + +hello.sh: + { echo '#!/bin/sh'; \ + echo "CLASSPATH='$(jardir)/hello.jar@CLASSPATH_SEPARATOR@$(hello_JAVALIBS)'\$${CLASSPATH+\"@CLASSPATH_SEPARATOR@\$$CLASSPATH\"}"; \ + echo "export CLASSPATH"; \ + echo "exec /bin/sh '$(pkgdatadir)/javaexec.sh' $(hello_MAINCLASS) \"\$$@\""; \ + } > $@ + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_SCRIPT) hello.sh $(DESTDIR)$(bindir)/hello + +install-data-local: all-local + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(INSTALL_DATA) hello.jar $(DESTDIR)$(jardir)/hello.jar + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL_DATA) javaexec.sh $(DESTDIR)$(pkgdatadir)/javaexec.sh + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(jardir) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello + rm -f $(DESTDIR)$(jardir)/hello.jar + rm -f $(DESTDIR)$(pkgdatadir)/javaexec.sh + +CLEANFILES += hello.jar Hello*.class Manifest.mf hello.sh + + +endif diff --git a/gettext-tools/examples/hello-java/autoclean.sh b/gettext-tools/examples/hello-java/autoclean.sh new file mode 100755 index 0000000..7a34384 --- /dev/null +++ b/gettext-tools/examples/hello-java/autoclean.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Brought in by explicit copy. +rm -f m4/gcj.m4 +rm -f m4/javacomp.m4 +rm -f m4/javaexec.m4 +rm -f javacomp.sh.in +rm -f javaexec.sh.in + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f hello-java*.properties diff --git a/gettext-tools/examples/hello-java/autogen.sh b/gettext-tools/examples/hello-java/autogen.sh new file mode 100755 index 0000000..a8f05a9 --- /dev/null +++ b/gettext-tools/examples/hello-java/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/gcj.m4 m4/gcj.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javacomp.m4 m4/javacomp.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/m4}/javaexec.m4 m4/javaexec.m4 +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javacomp.sh.in javacomp.sh.in +cp -p ${EXAMPLESCONFIGDIR-../../../gettext-tools/lib}/javaexec.sh.in javaexec.sh.in + +aclocal -I m4 + +autoconf + +automake -a -c + +./configure +cd po +make update-po +cd .. +make distclean diff --git a/gettext-tools/examples/hello-java/configure.ac b/gettext-tools/examples/hello-java/configure.ac new file mode 100644 index 0000000..8536f00 --- /dev/null +++ b/gettext-tools/examples/hello-java/configure.ac @@ -0,0 +1,70 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(Hello.java) +AM_INIT_AUTOMAKE(hello-java, 0) + +dnl Check whether we can build native executable. +AC_ARG_ENABLE(java-exe, + [ --disable-java-exe compile Java to bytecode only, not to native code], + :, enable_java_exe=yes) +gt_GCJ +if test "$enable_java_exe" != no && test -n "$HAVE_GCJ"; then + BUILDJAVAEXE=yes +else + BUILDJAVAEXE=no +fi +AC_SUBST(BUILDJAVAEXE) +AM_CONDITIONAL([USEJEXE], [test "$BUILDJAVAEXE" = yes]) +AC_PROG_RANLIB + +dnl Check whether we can build Java programs at all. +gt_JAVACOMP +AC_CHECK_PROG(JAR, jar, jar) +if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then + BUILDJAVA=yes +else + BUILDJAVA=no +fi +AC_SUBST(BUILDJAVA) + +dnl Check whether we can execute Java programs. +gt_JAVAEXEC +if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then + TESTJAVA=yes +else + TESTJAVA=no +fi +AC_SUBST(TESTJAVA) + +dnl Checks for compiler output filename suffixes. +AC_OBJEXT +AC_EXEEXT + +dnl Checks for needed libraries. +AM_PATH_PROG_WITH_TEST([GETTEXT_WITH_LIBINTL_JAR], [gettext], + [{ basedir=`echo "$ac_dir" | sed -e 's,/bin$,,'`; test -r "$basedir"/share/gettext/libintl.jar; }]) +if test -z "$GETTEXT_WITH_LIBINTL_JAR"; then + echo "Required library libintl.jar not found." 1>&2 + exit 1 +fi +changequote(,)dnl +basedir=`echo "$GETTEXT_WITH_LIBINTL_JAR" | sed -e 's,/[^/]*$,,' | sed -e 's,/bin$,,'` +changequote([, ])dnl +LIBINTL_JAR="$basedir"/share/gettext/libintl.jar +AC_SUBST([LIBINTL_JAR]) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([javacomp.sh]) +AC_CONFIG_FILES([javaexec.sh]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-java/m4/Makefile.am b/gettext-tools/examples/hello-java/m4/Makefile.am new file mode 100644 index 0000000..20c951f --- /dev/null +++ b/gettext-tools/examples/hello-java/m4/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ + nls.m4 po.m4 \ + gcj.m4 javacomp.m4 javaexec.m4 diff --git a/gettext-tools/examples/hello-java/po/LINGUAS b/gettext-tools/examples/hello-java/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-java/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-java/po/Makefile.am b/gettext-tools/examples/hello-java/po/Makefile.am new file mode 100644 index 0000000..b1189f9 --- /dev/null +++ b/gettext-tools/examples/hello-java/po/Makefile.am @@ -0,0 +1,204 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + Hello.java + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGCAT = msgcat +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES = @PROPERTIESFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES = @CLASSFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS = @JAVACATALOGS@ + +SUFFIXES = .po .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: stamp-po + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + $(MAKE) update-properties + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + +MAINTAINERCLEANFILES = stamp-po + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-properties + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-properties: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -o /dev/null $(srcdir)/$${lang}.po || exit 1; \ + echo "$(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties $(srcdir)/$${lang}.po"; \ + $(MSGCAT) --properties-output -o $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(srcdir)/$${lang}.po || exit 1; \ + mv $(top_srcdir)/$(DOMAIN)_$$lang.properties.tmp $(top_srcdir)/$(DOMAIN)_$$lang.properties || exit 1; \ + done + +# Alternatively, we could create classes instead of properties files. +update-classes: Makefile $(DOMAIN).pot $(POFILES) + @echo "$(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties"; \ + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l en --properties-output -o $(top_srcdir)/$(DOMAIN).properties || { rm -f $(top_srcdir)/$(DOMAIN).properties; exit 1; } + @for f in $(POFILES); do \ + lang=`echo $$f | sed -e 's,.*/,,' -e 's,\.po$$,,'`; \ + echo "$(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po"; \ + $(GMSGFMT) -c --statistics -j -d $(top_srcdir) -r $(DOMAIN) -l $${lang} $(srcdir)/$${lang}.po || exit 1; \ + done + +echo-catalogs: + @echo $(CATALOGS) diff --git a/gettext-tools/examples/hello-java/po/de.po b/gettext-tools/examples/hello-java/po/de.po new file mode 100644 index 0000000..6a9ceda --- /dev/null +++ b/gettext-tools/examples/hello-java/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-java package +# German messages for hello-java. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-java package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-java\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:14+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Hello.java:15 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: Hello.java:19 +#, java-format +msgid "This program is running as process number {0}." +msgstr "Dieses Programm läuft mit der Prozess-Nummer {0}." diff --git a/gettext-tools/examples/hello-librep/INSTALL b/gettext-tools/examples/hello-librep/INSTALL new file mode 100644 index 0000000..ec06ff0 --- /dev/null +++ b/gettext-tools/examples/hello-librep/INSTALL @@ -0,0 +1 @@ +This example relies on librep. diff --git a/gettext-tools/examples/hello-librep/Makefile.am b/gettext-tools/examples/hello-librep/Makefile.am new file mode 100644 index 0000000..d6f4488 --- /dev/null +++ b/gettext-tools/examples/hello-librep/Makefile.am @@ -0,0 +1,30 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Compilation of librep programs. +SUFFIXES = .jl .jlc +.jl.jlc: + rep --batch --no-rc -l compiler -f compile-batch $< +CLEANFILES = *.jlc + +# Making a librep program executable. +hello: hello.jlc + (echo '#!@REP@'; echo '!#'; cat $<) > $@ + chmod a+x $@ +CLEANFILES += hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-librep/autoclean.sh b/gettext-tools/examples/hello-librep/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-librep/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-librep/autogen.sh b/gettext-tools/examples/hello-librep/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-librep/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-librep/configure.ac b/gettext-tools/examples/hello-librep/configure.ac new file mode 100644 index 0000000..22a1974 --- /dev/null +++ b/gettext-tools/examples/hello-librep/configure.ac @@ -0,0 +1,39 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.jl.in) +AM_INIT_AUTOMAKE(hello-librep, 0) + +dnl Check for availability of the Tcl interpreter. +AC_PATH_PROG(REP, rep) +if test -z "$REP"; then + echo "*** Essential program rep not found" 1>&2 + exit 1 +fi +AC_SUBST(REP) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile hello.jl]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-librep/hello.jl.in b/gettext-tools/examples/hello-librep/hello.jl.in new file mode 100644 index 0000000..b71a540 --- /dev/null +++ b/gettext-tools/examples/hello-librep/hello.jl.in @@ -0,0 +1,17 @@ +#| Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the librep program. +|# + +(require 'rep.i18n.gettext) + +(textdomain "hello-librep") +(bindtextdomain "hello-librep" "@localedir@") + +(write standard-output (_ "Hello, world!")) +(write standard-output "\n"); +(format standard-output (_ "This program is running as process number %d.") + (process-id)) +(write standard-output "\n"); diff --git a/gettext-tools/examples/hello-librep/m4/Makefile.am b/gettext-tools/examples/hello-librep/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-librep/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-librep/po/LINGUAS b/gettext-tools/examples/hello-librep/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-librep/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-librep/po/Makefile.am b/gettext-tools/examples/hello-librep/po/Makefile.am new file mode 100644 index 0000000..d111506 --- /dev/null +++ b/gettext-tools/examples/hello-librep/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.jl.in + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-librep/po/de.po b/gettext-tools/examples/hello-librep/po/de.po new file mode 100644 index 0000000..20a4acc --- /dev/null +++ b/gettext-tools/examples/hello-librep/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-librep package +# German messages for hello-librep. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-librep package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-librep\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:03+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.jl.in:13 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.jl.in:15 +#, librep-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-objc-gnome/INSTALL b/gettext-tools/examples/hello-objc-gnome/INSTALL new file mode 100644 index 0000000..b2b8a9e --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/INSTALL @@ -0,0 +1,10 @@ +This example relies on: + - the GNOME libraries (libgnomeui, libgnome, libgnomesupport, libart_lgpl) + and their dependencies: imlib (libgdk_imlib), audiofile (libaudiofile), + esound (libesd), zlib (libz). + - the GTK libraries (libgtk, libgdk) + - the glib libraries (libglib, libgmodule) + - the X11 libraries + - the GNOME / Objective C bindings (libobgnome) + - the GTK / Objective C bindings (libobgtk) + - the Objective C runtime libraries (libobjc) diff --git a/gettext-tools/examples/hello-objc-gnome/Makefile.am b/gettext-tools/examples/hello-objc-gnome/Makefile.am new file mode 100644 index 0000000..e6e399e --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.m + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gnome.h include file is found. +INCLUDES = $(OBGNOME_INCLUDES) $(GNOME_INCLUDEDIR) + +# Link time dependencies. +LDADD = $(GNOME_LIBDIR) $(GNOMEUI_LIBS) -lobgnome -lobgtk -lobjc @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-objc-gnome/autoclean.sh b/gettext-tools/examples/hello-objc-gnome/autoclean.sh new file mode 100755 index 0000000..980bf44 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/autoclean.sh @@ -0,0 +1,51 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-objc-gnome/autogen.sh b/gettext-tools/examples/hello-objc-gnome/autogen.sh new file mode 100755 index 0000000..755010a --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-objc-gnome/configure.ac b/gettext-tools/examples/hello-objc-gnome/configure.ac new file mode 100644 index 0000000..4490752 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/configure.ac @@ -0,0 +1,32 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.m) +AM_INIT_AUTOMAKE(hello-objc-gnome, 0) + +AC_PROG_CC +OBJC=$CC +AC_SUBST([OBJC]) +OBJCFLAGS=$CFLAGS +AC_SUBST([OBJCFLAGS]) + +GNOME_INIT +OBGNOME_INCLUDES= +obgnome_prefix=`obgnome-config --prefix` +if test -n "$obgnome_prefix"; then + OBGNOME_INCLUDES="-I $obgnome_prefix/include" +fi +AC_SUBST([OBGNOME_INCLUDES]) + +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-objc-gnome/hello.m b/gettext-tools/examples/hello-objc-gnome/hello.m new file mode 100644 index 0000000..4edb3e9 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/hello.m @@ -0,0 +1,89 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the Objective C program. */ + + +/* Get GNOME declarations. */ +#include <obgnome/obgnome.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +static void +quit_callback (GtkWidget *widget, void *data) +{ + gtk_main_quit (); +} + +int +main (int argc, char *argv[]) +{ + Gnome_App *application; + Gtk_Window *window; + Gtk_VBox *panel; + Gtk_Label *label1; + Gtk_Alignment *label1aligned; + Gtk_Label *label2; + Gtk_Alignment *label2aligned; + Gtk_Button *button; + Gtk_ButtonBox *buttonbar; + + /* Initializations. */ + + application = [[Gnome_App alloc] initApp: PACKAGE : VERSION : argc : argv]; + textdomain ("hello-objc-gnome"); + bindtextdomain ("hello-objc-gnome", LOCALEDIR); + + /* Create the GUI elements. */ + + window = [[Gtk_Window alloc] initWithWindowInfo: GTK_WINDOW_TOPLEVEL]; + [window set_title: "Hello example"]; + [window realize]; + [window signal_connect: "delete_event" signalFunc: quit_callback funcData: NULL]; + + label1 = [[Gtk_Label alloc] initWithLabelInfo: _("Hello, world!")]; + + label1aligned = [[Gtk_Alignment alloc] initWithAlignmentInfo: 0.0 : 0.5 : 0 : 0]; + [label1aligned add: label1]; + + label2 = [[Gtk_Label alloc] initWithLabelInfo: g_strdup_printf (_("This program is running as process number %d."), getpid ())]; + + label2aligned = [[Gtk_Alignment alloc] initWithAlignmentInfo: 0.0 : 0.5 : 0 : 0]; + [label2aligned add: label2]; + + button = [Gtk_Button alloc]; + [button initWithLabel: "OK"]; + [button signal_connect: "clicked" signalFunc: quit_callback funcData: NULL]; + + buttonbar = [Gtk_HButtonBox new]; + [buttonbar set_layout: GTK_BUTTONBOX_END]; + [buttonbar pack_start_defaults: button]; + + panel = [[Gtk_VBox alloc] initWithVBoxInfo: FALSE : GNOME_PAD_SMALL]; + [panel pack_start_defaults: label1aligned]; + [panel pack_start_defaults: label2aligned]; + [panel pack_start_defaults: buttonbar]; + + [window add: panel]; + + /* Make the GUI elements visible. */ + + [label1 show]; + [label1aligned show]; + [label2 show]; + [label2aligned show]; + [button show]; + [buttonbar show]; + [panel show]; + [window show]; + + /* Start the event loop. */ + + gtk_main (); + + return 0; +} diff --git a/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am b/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am new file mode 100644 index 0000000..14dc5db --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/m4/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 \ + gnome.m4 gnome-gnorba-check.m4 gnome-orbit-check.m4 diff --git a/gettext-tools/examples/hello-objc-gnome/m4/gnome-gnorba-check.m4 b/gettext-tools/examples/hello-objc-gnome/m4/gnome-gnorba-check.m4 new file mode 100644 index 0000000..dbac0a6 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/m4/gnome-gnorba-check.m4 @@ -0,0 +1,35 @@ +dnl +dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag) +dnl +dnl if failflag is "failure" it aborts if gnorba is not found. +dnl + +AC_DEFUN([GNOME_GNORBA_HOOK],[ + GNOME_ORBIT_HOOK([],$2) + AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ + gnome_cv_gnorba_found=no + if test x$gnome_cv_orbit_found = xyes; then + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + if test -n "$GNORBA_LIBS"; then + gnome_cv_gnorba_found=yes + fi + fi + ]) + AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + AC_SUBST(GNORBA_CFLAGS) + AC_SUBST(GNORBA_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(gnorba library not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_GNORBA_CHECK], [ + GNOME_GNORBA_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-objc-gnome/m4/gnome-orbit-check.m4 b/gettext-tools/examples/hello-objc-gnome/m4/gnome-orbit-check.m4 new file mode 100644 index 0000000..54bf33a --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/m4/gnome-orbit-check.m4 @@ -0,0 +1,33 @@ +dnl +dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag) +dnl +dnl if failflag is "failure" it aborts if orbit is not found. +dnl + +AC_DEFUN([GNOME_ORBIT_HOOK],[ + AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) + AC_PATH_PROG(ORBIT_IDL,orbit-idl,no) + AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ + if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then + gnome_cv_orbit_found=no + else + gnome_cv_orbit_found=yes + fi + ]) + AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + ORBIT_CFLAGS=`orbit-config --cflags client server` + ORBIT_LIBS=`orbit-config --use-service=name --libs client server` + AC_SUBST(ORBIT_CFLAGS) + AC_SUBST(ORBIT_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(ORBit not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_ORBIT_CHECK], [ + GNOME_ORBIT_HOOK([],failure) +]) diff --git a/gettext-tools/examples/hello-objc-gnome/m4/gnome.m4 b/gettext-tools/examples/hello-objc-gnome/m4/gnome.m4 new file mode 100644 index 0000000..659c22c --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/m4/gnome.m4 @@ -0,0 +1,128 @@ +dnl +dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits]) +dnl +dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh +dnl is not found. +dnl + +AC_DEFUN([GNOME_INIT_HOOK],[ + AC_SUBST(GNOME_LIBS) + AC_SUBST(GNOMEUI_LIBS) + AC_SUBST(GNOMEGNORBA_LIBS) + AC_SUBST(GTKXMHTML_LIBS) + AC_SUBST(ZVT_LIBS) + AC_SUBST(GNOME_LIBDIR) + AC_SUBST(GNOME_INCLUDEDIR) + + AC_ARG_WITH(gnome-includes, + [ --with-gnome-includes Specify location of GNOME headers],[ + CFLAGS="$CFLAGS -I$withval" + ]) + + AC_ARG_WITH(gnome-libs, + [ --with-gnome-libs Specify location of GNOME libs],[ + LDFLAGS="$LDFLAGS -L$withval" + gnome_prefix=$withval + ]) + + AC_ARG_WITH(gnome, + [ --with-gnome Specify prefix for GNOME files], + if test x$withval = xyes; then + want_gnome=yes + dnl Note that an empty true branch is not + dnl valid sh syntax. + ifelse([$1], [], :, [$1]) + else + if test "x$withval" = xno; then + want_gnome=no + else + want_gnome=yes + LDFLAGS="$LDFLAGS -L$withval/lib" + CFLAGS="$CFLAGS -I$withval/include" + gnome_prefix=$withval/lib + fi + fi, + want_gnome=yes) + + if test "x$want_gnome" = xyes; then + + AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) + if test "$GNOME_CONFIG" = "no"; then + no_gnome_config="yes" + else + AC_MSG_CHECKING(if $GNOME_CONFIG works) + if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + GNOME_GNORBA_HOOK([],$2) + GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" + GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" + GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" + GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" + ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" + GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" + GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" + $1 + else + AC_MSG_RESULT(no) + no_gnome_config="yes" + fi + fi + + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + gnome_prefix=$ac_default_prefix/lib + else + gnome_prefix=$prefix/lib + fi + else + gnome_prefix=`eval echo \`echo $libdir\`` + fi + + if test "$no_gnome_config" = "yes"; then + AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) + if test -f $gnome_prefix/gnomeConf.sh; then + AC_MSG_RESULT(found) + echo "loading gnome configuration from" \ + "$gnome_prefix/gnomeConf.sh" + . $gnome_prefix/gnomeConf.sh + $1 + else + AC_MSG_RESULT(not found) + if test x$2 = xfail; then + AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install) + fi + fi + fi + fi + + if test -n "$3"; then + n="$3" + for i in $n; do + AC_MSG_CHECKING(extra library \"$i\") + case $i in + applets) + AC_SUBST(GNOME_APPLETS_LIBS) + GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` + AC_MSG_RESULT($GNOME_APPLETS_LIBS);; + docklets) + AC_SUBST(GNOME_DOCKLETS_LIBS) + GNOME_DOCKLETS_LIBS=`$GNOME_CONFIG --libs-only-l docklets` + AC_MSG_RESULT($GNOME_DOCKLETS_LIBS);; + capplet) + AC_SUBST(GNOME_CAPPLET_LIBS) + GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` + AC_MSG_RESULT($GNOME_CAPPLET_LIBS);; + *) + AC_MSG_RESULT(unknown library) + esac + done + fi +]) + +dnl +dnl GNOME_INIT ([additional-inits]) +dnl + +AC_DEFUN([GNOME_INIT],[ + GNOME_INIT_HOOK([],fail,$1) +]) diff --git a/gettext-tools/examples/hello-objc-gnome/po/LINGUAS b/gettext-tools/examples/hello-objc-gnome/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-objc-gnome/po/Makevars b/gettext-tools/examples/hello-objc-gnome/po/Makevars new file mode 100644 index 0000000..e20fc8c --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/po/Makevars @@ -0,0 +1,55 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format \ + --flag=g_log:3:c-format --flag=g_logv:3:c-format \ + --flag=g_error:1:c-format --flag=g_message:1:c-format \ + --flag=g_critical:1:c-format --flag=g_warning:1:c-format \ + --flag=g_print:1:c-format \ + --flag=g_printerr:1:c-format \ + --flag=g_strdup_printf:1:c-format --flag=g_strdup_vprintf:1:c-format \ + --flag=g_printf_string_upper_bound:1:c-format \ + --flag=g_snprintf:3:c-format --flag=g_vsnprintf:3:c-format \ + --flag=g_string_sprintf:2:c-format \ + --flag=g_string_sprintfa:2:c-format \ + --flag=g_scanner_error:2:c-format \ + --flag=g_scanner_warn:2:c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-objc-gnome/po/POTFILES.in b/gettext-tools/examples/hello-objc-gnome/po/POTFILES.in new file mode 100644 index 0000000..0d88dcd --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.m diff --git a/gettext-tools/examples/hello-objc-gnome/po/de.po b/gettext-tools/examples/hello-objc-gnome/po/de.po new file mode 100644 index 0000000..da59a7d --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnome/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-objc-gnome package +# German messages for hello-objc-gnome. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-objc-gnome package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-objc-gnome\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.m:48 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.m:53 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-objc-gnustep/AppController.h b/gettext-tools/examples/hello-objc-gnustep/AppController.h new file mode 100644 index 0000000..8f7eed4 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/AppController.h @@ -0,0 +1,36 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Interface of the AppController class. */ + +#include <AppKit/AppKit.h> + +@class Hello; + +@interface AppController : NSObject +{ + Hello *hello; +} + ++ (void)initialize; + +- (id)init; +- (void)dealloc; + +- (void)awakeFromNib; + +- (void)applicationDidFinishLaunching + :(NSNotification *)notif; + +- (BOOL)applicationShouldTerminate:(id)sender; +- (void)applicationWillTerminate:(NSNotification *)notification; + +- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName; + +- (void)showPrefPanel:(id)sender; +- (void)showInfoPanel:(id)sender; + +- (void)showHelloWindow:(id)sender; + +@end diff --git a/gettext-tools/examples/hello-objc-gnustep/AppController.m b/gettext-tools/examples/hello-objc-gnustep/AppController.m new file mode 100644 index 0000000..0d2bbab --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/AppController.m @@ -0,0 +1,82 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the AppController class. */ + +#include "AppController.h" +#include "Hello.h" + +@implementation AppController + +static NSDictionary *infoDict = nil; + ++ (void)initialize +{ + NSMutableDictionary *defaults = [NSMutableDictionary dictionary]; + + [[NSUserDefaults standardUserDefaults] registerDefaults: defaults]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +- (id)init +{ + self = [super init]; + return self; +} + +- (void)dealloc +{ + if (hello) + RELEASE (hello); + + [super dealloc]; +} + +- (void)awakeFromNib +{ +} + +- (void)applicationDidFinishLaunching:(NSNotification *)notif +{ +} + +- (BOOL)applicationShouldTerminate:(id)sender +{ + return YES; +} + +- (void)applicationWillTerminate:(NSNotification *)notification +{ +} + +- (BOOL)application:(NSApplication *)application openFile:(NSString *)fileName +{ +} + +- (void)showPrefPanel:(id)sender +{ +} + +- (void)showInfoPanel:(id)sender +{ + if (!infoDict) + { + NSString *fp; + NSBundle *bundle = [NSBundle mainBundle]; + + fp = [bundle pathForResource: @"Info-project" ofType: @"plist"]; + infoDict = [[NSDictionary dictionaryWithContentsOfFile: fp] retain]; + } + [[NSApplication sharedApplication] orderFrontStandardInfoPanelWithOptions: infoDict]; +} + +- (void)showHelloWindow:(id)sender +{ + if (!hello) + hello = [[Hello alloc] init]; + + [hello makeKeyAndOrderFront]; +} + +@end diff --git a/gettext-tools/examples/hello-objc-gnustep/GNUmakefile b/gettext-tools/examples/hello-objc-gnustep/GNUmakefile new file mode 100644 index 0000000..8bbbd0c --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/GNUmakefile @@ -0,0 +1,37 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. + +include $(GNUSTEP_MAKEFILES)/common.make + +# Subprojects +SUBPROJECTS = po + +# Main application +PACKAGE_NAME = Hello +APP_NAME = Hello +GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_LOCAL_ROOT) +Hello_APPLICATION_ICON = + +# Additional libraries +ADDITIONAL_GUI_LIBS += + +# Resource files +Hello_RESOURCE_FILES = +Hello_LOCALIZED_RESOURCE_FILES = Localizable.strings +Hello_LANGUAGES := $(sort English $(shell MAKEFLAGS= $(MAKE) -s -C po echo-languages)) + +# Header files +Hello_HEADERS = AppController.h Hello.h + +# Class files +Hello_OBJC_FILES = main.m AppController.m Hello.m + +# C files +Hello_C_FILES = + +-include GNUmakefile.preamble +-include GNUmakefile.local +include $(GNUSTEP_MAKEFILES)/aggregate.make +include $(GNUSTEP_MAKEFILES)/application.make +-include GNUmakefile.postamble diff --git a/gettext-tools/examples/hello-objc-gnustep/Hello.h b/gettext-tools/examples/hello-objc-gnustep/Hello.h new file mode 100644 index 0000000..ddab89c --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/Hello.h @@ -0,0 +1,32 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Interface of the Hello class. */ + +#include <AppKit/AppKit.h> + +@interface Hello : NSObject +{ + NSWindow *window; + + NSTextField *label1; + NSTextField *label2; + + id okButton; +} + +- (id)init; +- (void)dealloc; + +- (void)makeKeyAndOrderFront; + +- (void)done; + +@end + +@interface Hello (UIBuilder) + +- (void)createUI; + +@end diff --git a/gettext-tools/examples/hello-objc-gnustep/Hello.m b/gettext-tools/examples/hello-objc-gnustep/Hello.m new file mode 100644 index 0000000..fc6f5c9 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/Hello.m @@ -0,0 +1,100 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the Hello class. */ + +#include <unistd.h> +#include "Hello.h" +#include <GNUstepGUI/GSHbox.h> +#include <GNUstepGUI/GSVbox.h> + +@implementation Hello + +- (id)init +{ + if ((self = [super init])) + [self createUI]; + return self; +} + +- (void)dealloc +{ + RELEASE (window); + [super dealloc]; +} + +- (void)makeKeyAndOrderFront +{ + if (![window isVisible]) + [window center]; + [window makeKeyAndOrderFront:self]; +} + +- (void)done +{ + [window close]; +} + +@end + +@implementation Hello (UIBuilder) + +- (void)createUI +{ + GSVbox *cview; + GSHbox *buttonbar; + int i; + + label1 = [NSTextField new]; + [label1 setStringValue: _(@"Hello, world!")]; + [label1 setAlignment: NSLeftTextAlignment]; + [label1 setBordered: NO]; + [label1 setEditable: NO]; + [label1 setBezeled: NO]; + [label1 setDrawsBackground: NO]; + [label1 sizeToFit]; + + label2 = [NSTextField new]; + [label2 setStringValue: [NSString stringWithFormat: _(@"This program is running as process number %d."), [[NSProcessInfo processInfo] processIdentifier]]]; + [label2 setAlignment: NSLeftTextAlignment]; + [label2 setBordered: NO]; + [label2 setEditable: NO]; + [label2 setBezeled: NO]; + [label2 setDrawsBackground: NO]; + [label2 sizeToFit]; + + okButton = [NSButton new]; + [okButton setTitle: @"OK"]; + [okButton setTarget: self]; + [okButton setAction: @selector(done)]; + [okButton setFrameSize: NSMakeSize(60,22)]; + [okButton setAutoresizingMask: 7]; + + buttonbar = [GSHbox new]; + [buttonbar setAutoresizingMask: NSViewMinXMargin]; + [buttonbar addView: okButton]; + AUTORELEASE (okButton); + + cview = [GSVbox new]; + // GSVbox is flawed: We have to add the controls bottom-up, and mark the + // last one (= the topmost one) as non-resizable in Y direction, so that the + // Y space becomes equally distributed _between_ (not above) the subviews. + [cview addView: buttonbar]; + AUTORELEASE (buttonbar); + [cview addView: label2]; + AUTORELEASE (label2); + [cview addView: label1 enablingYResizing: NO]; + AUTORELEASE (label1); + + window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0,0, [cview frame].size.width, [cview frame].size.height) + styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask) + backing: NSBackingStoreBuffered + defer: NO]; + [window setDelegate: self]; + [window setTitle: @"Hello example"]; + [window setReleasedWhenClosed: NO]; + [window setContentView: cview]; +} + +@end diff --git a/gettext-tools/examples/hello-objc-gnustep/INSTALL b/gettext-tools/examples/hello-objc-gnustep/INSTALL new file mode 100644 index 0000000..f3dd2fb --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/INSTALL @@ -0,0 +1,10 @@ +This example relies on: + - the GNUstep libraries (libgnustep-gui, libgnustep-base) + and their dependencies (libiconv or glibc, and ffcall) + - the Objective C runtime libraries (libobjc) + +GNUstep applications don't need to be configured or installed in order to run; +all you need is to + 1. Prepare your environment, as described in the GNUstep-HOWTO + 2. make + 3. openapp Hello diff --git a/gettext-tools/examples/hello-objc-gnustep/autoclean.sh b/gettext-tools/examples/hello-objc-gnustep/autoclean.sh new file mode 100755 index 0000000..2d20592 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/autoclean.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +make distclean + +rm -f po/remove-potcdate.sed +rm -f po/remove-potcdate.sin +rm -f po/*.pot diff --git a/gettext-tools/examples/hello-objc-gnustep/autogen.sh b/gettext-tools/examples/hello-objc-gnustep/autogen.sh new file mode 100755 index 0000000..795b7f8 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/autogen.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin diff --git a/gettext-tools/examples/hello-objc-gnustep/main.m b/gettext-tools/examples/hello-objc-gnustep/main.m new file mode 100644 index 0000000..2abf293 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/main.m @@ -0,0 +1,114 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the main program. */ + +#include <AppKit/AppKit.h> +#include "AppController.h" + +#define APP_NAME @"Hello" + +/* Create the application's menu. */ +static void +createMenu () +{ + NSMenu *menu; + NSMenu *info; + NSMenu *edit; + NSMenu *services; + NSMenu *windows; + + SEL action = @selector(method:); + + menu = [[NSMenu alloc] initWithTitle: APP_NAME]; + [menu addItemWithTitle: @"Info" + action: action + keyEquivalent: @""]; + [menu addItemWithTitle: @"Edit" + action: action + keyEquivalent: @""]; + [menu addItemWithTitle: @"Hello..." + action: @selector(showHelloWindow:) + keyEquivalent: @""]; + [menu addItemWithTitle: @"Windows" + action: action + keyEquivalent: @""]; + [menu addItemWithTitle: @"Services" + action: action + keyEquivalent: @""]; + [menu addItemWithTitle: @"Hide" + action: @selector(hide:) + keyEquivalent: @"h"]; + [menu addItemWithTitle: @"Quit" + action: @selector(terminate:) + keyEquivalent: @"q"]; + + info = AUTORELEASE ([[NSMenu alloc] init]); + [info addItemWithTitle: @"Info Panel..." + action: @selector(showInfoPanel:) + keyEquivalent: @""]; + [info addItemWithTitle: @"Preferences" + action: @selector(showPrefPanel:) + keyEquivalent: @""]; + [info addItemWithTitle: @"Help" + action: action + keyEquivalent: @"?"]; + [menu setSubmenu: info forItem: [menu itemWithTitle: @"Info"]]; + + edit = AUTORELEASE ([[NSMenu alloc] init]); + [edit addItemWithTitle: @"Cut" + action: @selector(cut:) + keyEquivalent: @"x"]; + [edit addItemWithTitle: @"Copy" + action: @selector(copy:) + keyEquivalent: @"c"]; + [edit addItemWithTitle: @"Paste" + action: @selector(paste:) + keyEquivalent: @"v"]; + [edit addItemWithTitle: @"Delete" + action: @selector(delete:) + keyEquivalent: @""]; + [edit addItemWithTitle: @"Select All" + action: @selector(selectAll:) + keyEquivalent: @"a"]; + [menu setSubmenu: edit forItem: [menu itemWithTitle: @"Edit"]]; + + windows = AUTORELEASE ([[NSMenu alloc] init]); + [windows addItemWithTitle: @"Arrange" + action: @selector(arrangeInFront:) + keyEquivalent: @""]; + [windows addItemWithTitle: @"Miniaturize" + action: @selector(performMiniaturize:) + keyEquivalent: @"m"]; + [windows addItemWithTitle: @"Close" + action: @selector(performClose:) + keyEquivalent: @"w"]; + [menu setSubmenu: windows forItem: [menu itemWithTitle: @"Windows"]]; + + services = AUTORELEASE ([[NSMenu alloc] init]); + [menu setSubmenu: services forItem: [menu itemWithTitle: @"Services"]]; + + [[NSApplication sharedApplication] setMainMenu: menu]; + [[NSApplication sharedApplication] setServicesMenu: services]; + [[NSApplication sharedApplication] setWindowsMenu: windows]; +} + +/* Initialise and go! */ +int +main(int argc, const char *argv[]) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + AppController *controller; + + [NSApplication sharedApplication]; + + createMenu (); + + controller = [[AppController alloc] init]; + [NSApp setDelegate:controller]; + + RELEASE (pool); + + return NSApplicationMain (argc, argv); +} diff --git a/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile b/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile new file mode 100644 index 0000000..cebbbfe --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile @@ -0,0 +1,173 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile - processed by GNU make. + +# NLS is enabled by default. +USE_NLS = yes + +# List of files which contain translatable strings. +POTFILES = \ + Hello.m + +# Usually the message domain is the same as the package name in lower case. +DOMAIN = hello-objc-gnustep + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +XGETTEXT = xgettext +MSGMERGE = msgmerge +MSGMERGE_UPDATE = msgmerge --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# Set of available languages. +LINGUAS := $(shell sed -e "/^\#/d" LINGUAS) +# Set of languages which use msgen. +ENLINGUAS := $(filter-out $(LINGUAS), en) + +top_srcdir = .. + +include LocaleAliases + +POTFILES_DEPS = $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POFILES = $(foreach lang, $(LINGUAS), $(lang).po) +UPDATEPOFILES = $(foreach lang, $(LINGUAS), $(lang).po-update) +DUMMYPOFILES = $(foreach lang, $(LINGUAS), $(lang).nop) +STRINGSFILES = $(foreach lang, $(LINGUAS), $(top_srcdir)/$(NSLOCALE_$(lang)).lproj/Localizable.strings) +ENSTRINGSFILES = $(foreach lang, $(ENLINGUAS), $(top_srcdir)/$(NSLOCALE_$(lang)).lproj/Localizable.strings) +CATALOGS = $(STRINGSFILES) $(ENSTRINGSFILES) + +.SUFFIXES: .po .mo .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +internal-all:: all-local-$(USE_NLS) + +all-local-yes: $(CATALOGS) +all-local-no: + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).pot && \ + mv $(DOMAIN).po $(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + echo "$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + +update-po: + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-strings + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + echo "$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + + +update-strings: $(CATALOGS) + @: + +# I don't know how to make a dependency from a particular .strings file to its +# corresponding .po file; therefore I put here a dependency towards all .po +# files. It's safer than no dependency at all. +$(STRINGSFILES): $(POFILES) + $(MAKE) $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))).po + mkdir -p $(patsubst %/,%, $(dir $@)) + msgcat --stringtable-output -o $@.tmp $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))).po + mv $@.tmp $@ + +$(ENSTRINGSFILES): $(DOMAIN).pot + $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $(UNIXLOCALE_$(patsubst %.lproj,%, $(notdir $(patsubst %/,%, $(dir $@))))) --stringtable-output -o $@.tmp + mv $@.tmp $@ + +echo-languages: + @echo $(foreach lang, $(LINGUAS), $(NSLOCALE_$(lang))) + +-include $(GNUSTEP_MAKEFILES)/rules.make + diff --git a/gettext-tools/examples/hello-objc-gnustep/po/LINGUAS b/gettext-tools/examples/hello-objc-gnustep/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-objc-gnustep/po/LocaleAliases b/gettext-tools/examples/hello-objc-gnustep/po/LocaleAliases new file mode 100644 index 0000000..7d50523 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/po/LocaleAliases @@ -0,0 +1,165 @@ +# The correspondence between Unix style and NeXTstep style locale names is +# taken from +# $prefix/System/Library/Libraries/Resources/gnustep-base/Languages/Locale.aliases + +NSLOCALE_cs = Czech +NSLOCALE_da = Danish +NSLOCALE_de = German +NSLOCALE_de_AT = AustriaGerman +NSLOCALE_de_BE = BelgiumGerman +NSLOCALE_de_CH = SwitzerlandGerman +NSLOCALE_de_LU = LuxemburgGerman +NSLOCALE_el = Greek +NSLOCALE_el_GR = GreeceGreek +NSLOCALE_en = English +NSLOCALE_en_AU = AustraliaEnglish +NSLOCALE_en_CA = CanadaEnglish +NSLOCALE_en_DK = DenmarkEnglish +NSLOCALE_en_GB = BritainEnglish +NSLOCALE_en_IE = IrelandEnglish +NSLOCALE_en_NZ = NewZealandEnglish +NSLOCALE_en_US = AmericanEnglish +NSLOCALE_en_ZA = SouthAfricaEnglish +NSLOCALE_es = Spanish +NSLOCALE_es_AR = ArgentinaSpanish +NSLOCALE_es_BO = BoliviaSpanish +NSLOCALE_es_CL = ChileSpanish +NSLOCALE_es_CO = ColombiaSpanish +NSLOCALE_es_DO = DominicanRepublicSpanish +NSLOCALE_es_EC = EquadorSpanish +NSLOCALE_es_GT = GuatemalaSpanish +NSLOCALE_es_HN = HondurasSpanish +NSLOCALE_es_MX = MexicoSpanish +NSLOCALE_es_PA = PanamaSpanish +NSLOCALE_es_PE = PeruSpanish +NSLOCALE_es_PY = ParaguaySpanish +NSLOCALE_es_SV = ElSalvadorSpanish +NSLOCALE_es_US = USASpanish +NSLOCALE_es_UY = UruguaySpanish +NSLOCALE_es_VE = VenezuelaSpanish +NSLOCALE_et = Estonian +NSLOCALE_et_EE = EstoniaEstonian +NSLOCALE_eu = Basque +NSLOCALE_eu_ES = SpainBasque +NSLOCALE_fi = Finnish +NSLOCALE_fo = Faroese +NSLOCALE_fr = French +NSLOCALE_fr_BE = BelgiumFrench +NSLOCALE_fr_CA = CanadaFrench +NSLOCALE_fr_CH = SwitzerlandFrench +NSLOCALE_fr_LU = LuxemburgFrench +NSLOCALE_ga = Irish +NSLOCALE_he = Hebrew +NSLOCALE_hr = Croatian +NSLOCALE_hu = Hungarian +NSLOCALE_id = Indonesian +NSLOCALE_in = Indonesian +NSLOCALE_is = Icelandic +NSLOCALE_it = Italian +NSLOCALE_it_CH = SwitzerlandItalian +NSLOCALE_iw = Hebrew +NSLOCALE_ja = Japanese +NSLOCALE_kl = Greenlandic +NSLOCALE_lt = Lithuanian +NSLOCALE_lv = Latvian +NSLOCALE_nl = Dutch +NSLOCALE_nl_BE = BelgiumDutch +NSLOCALE_nl_NL = NetherlandsDutch +NSLOCALE_no = Norwegian +NSLOCALE_pl = Polish +NSLOCALE_pt = Portuguese +NSLOCALE_pt_BR = BrasilPortuguese +NSLOCALE_ro = Romanian +NSLOCALE_ru = Russian +NSLOCALE_ru_UA = UkraineRussian +NSLOCALE_sk = Slovak +NSLOCALE_sl = Slovenian +NSLOCALE_sr = Serbian +NSLOCALE_sv = Swedish +NSLOCALE_sv_FI = FinlandSwedish +NSLOCALE_th = Thai +NSLOCALE_tr = Turkish +NSLOCALE_uk = Ukrainian +NSLOCALE_zh = Chinese +NSLOCALE_zh_TW = TraditionalChinese + +UNIXLOCALE_Czech = cs +UNIXLOCALE_Danish = da +UNIXLOCALE_German = de +UNIXLOCALE_AustriaGerman = de_AT +UNIXLOCALE_BelgiumGerman = de_BE +UNIXLOCALE_SwitzerlandGerman = de_CH +UNIXLOCALE_LuxemburgGerman = de_LU +UNIXLOCALE_Greek = el +UNIXLOCALE_GreeceGreek = el_GR +UNIXLOCALE_English = en +UNIXLOCALE_AustraliaEnglish = en_AU +UNIXLOCALE_CanadaEnglish = en_CA +UNIXLOCALE_DenmarkEnglish = en_DK +UNIXLOCALE_BritainEnglish = en_GB +UNIXLOCALE_IrelandEnglish = en_IE +UNIXLOCALE_NewZealandEnglish = en_NZ +UNIXLOCALE_AmericanEnglish = en_US +UNIXLOCALE_SouthAfricaEnglish = en_ZA +UNIXLOCALE_Spanish = es +UNIXLOCALE_ArgentinaSpanish = es_AR +UNIXLOCALE_BoliviaSpanish = es_BO +UNIXLOCALE_ChileSpanish = es_CL +UNIXLOCALE_ColombiaSpanish = es_CO +UNIXLOCALE_DominicanRepublicSpanish = es_DO +UNIXLOCALE_EquadorSpanish = es_EC +UNIXLOCALE_GuatemalaSpanish = es_GT +UNIXLOCALE_HondurasSpanish = es_HN +UNIXLOCALE_MexicoSpanish = es_MX +UNIXLOCALE_PanamaSpanish = es_PA +UNIXLOCALE_PeruSpanish = es_PE +UNIXLOCALE_ParaguaySpanish = es_PY +UNIXLOCALE_ElSalvadorSpanish = es_SV +UNIXLOCALE_USASpanish = es_US +UNIXLOCALE_UruguaySpanish = es_UY +UNIXLOCALE_VenezuelaSpanish = es_VE +UNIXLOCALE_Estonian = et +UNIXLOCALE_EstoniaEstonian = et_EE +UNIXLOCALE_Basque = eu +UNIXLOCALE_SpainBasque = eu_ES +UNIXLOCALE_Finnish = fi +UNIXLOCALE_Faroese = fo +UNIXLOCALE_French = fr +UNIXLOCALE_BelgiumFrench = fr_BE +UNIXLOCALE_CanadaFrench = fr_CA +UNIXLOCALE_SwitzerlandFrench = fr_CH +UNIXLOCALE_LuxemburgFrench = fr_LU +UNIXLOCALE_Irish = ga +UNIXLOCALE_Hebrew = he +UNIXLOCALE_Croatian = hr +UNIXLOCALE_Hungarian = hu +UNIXLOCALE_Indonesian = id +UNIXLOCALE_Indonesian = in +UNIXLOCALE_Icelandic = is +UNIXLOCALE_Italian = it +UNIXLOCALE_SwitzerlandItalian = it_CH +UNIXLOCALE_Hebrew = iw +UNIXLOCALE_Japanese = ja +UNIXLOCALE_Greenlandic = kl +UNIXLOCALE_Lithuanian = lt +UNIXLOCALE_Latvian = lv +UNIXLOCALE_Dutch = nl +UNIXLOCALE_BelgiumDutch = nl_BE +UNIXLOCALE_NetherlandsDutch = nl_NL +UNIXLOCALE_Norwegian = no +UNIXLOCALE_Polish = pl +UNIXLOCALE_Portuguese = pt +UNIXLOCALE_BrasilPortuguese = pt_BR +UNIXLOCALE_Romanian = ro +UNIXLOCALE_Russian = ru +UNIXLOCALE_UkraineRussian = ru_UA +UNIXLOCALE_Slovak = sk +UNIXLOCALE_Slovenian = sl +UNIXLOCALE_Serbian = sr +UNIXLOCALE_Swedish = sv +UNIXLOCALE_FinlandSwedish = sv_FI +UNIXLOCALE_Thai = th +UNIXLOCALE_Turkish = tr +UNIXLOCALE_Ukrainian = uk +UNIXLOCALE_Chinese = zh +UNIXLOCALE_TraditionalChinese = zh_TW diff --git a/gettext-tools/examples/hello-objc-gnustep/po/de.po b/gettext-tools/examples/hello-objc-gnustep/po/de.po new file mode 100644 index 0000000..b736440 --- /dev/null +++ b/gettext-tools/examples/hello-objc-gnustep/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-objc-gnustep package +# German messages for hello-objc-gnustep. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-objc-gnustep package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-objc-gnustep\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: Hello.m:50 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: Hello.m:59 +#, objc-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-objc/INSTALL b/gettext-tools/examples/hello-objc/INSTALL new file mode 100644 index 0000000..679deb3 --- /dev/null +++ b/gettext-tools/examples/hello-objc/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - the Objective C runtime libraries (libobjc) diff --git a/gettext-tools/examples/hello-objc/Makefile.am b/gettext-tools/examples/hello-objc/Makefile.am new file mode 100644 index 0000000..2fd9bef --- /dev/null +++ b/gettext-tools/examples/hello-objc/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign no-dependencies +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.m gettext.h + +# Define a C macro LOCALEDIR indicating where catalogs will be installed. +localedir = $(datadir)/locale +DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ + +# Make sure the gettext.h include file is found. +INCLUDES = -I. -I$(srcdir) + +# Link time dependencies. +LDADD = @LIBINTL@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-objc/autoclean.sh b/gettext-tools/examples/hello-objc/autoclean.sh new file mode 100755 index 0000000..d6b42cd --- /dev/null +++ b/gettext-tools/examples/hello-objc/autoclean.sh @@ -0,0 +1,54 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f gettext.h + +# Brought in by autopoint. +rm -f ABOUT-NLS +rm -f config.rpath +rm -f m4/codeset.m4 +rm -f m4/gettext.m4 +rm -f m4/glibc21.m4 +rm -f m4/iconv.m4 +rm -f m4/intdiv0.m4 +rm -f m4/inttypes-pri.m4 +rm -f m4/inttypes.m4 +rm -f m4/inttypes_h.m4 +rm -f m4/isc-posix.m4 +rm -f m4/lcmessage.m4 +rm -f m4/lib-ld.m4 +rm -f m4/lib-link.m4 +rm -f m4/lib-prefix.m4 +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f m4/stdint_h.m4 +rm -f m4/uintmax_t.m4 +rm -f m4/ulonglong.m4 +rm -f mkinstalldirs +rm -f po/Makefile.in.in +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f install-sh +rm -f missing +rm -f config.guess +rm -f config.sub +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-objc/autogen.sh b/gettext-tools/examples/hello-objc/autogen.sh new file mode 100755 index 0000000..c21af8c --- /dev/null +++ b/gettext-tools/examples/hello-objc/autogen.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${GETTEXTSRCDIR-../../../gettext-tools/lib}/gettext.h gettext.h + +autopoint -f # was: gettextize -f -c +rm po/Makevars.template +rm po/Rules-quot +rm po/boldquot.sed +rm po/en@boldquot.header +rm po/en@quot.header +rm po/insert-header.sin +rm po/quot.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-objc/configure.ac b/gettext-tools/examples/hello-objc/configure.ac new file mode 100644 index 0000000..3563b5f --- /dev/null +++ b/gettext-tools/examples/hello-objc/configure.ac @@ -0,0 +1,21 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.m) +AM_INIT_AUTOMAKE(hello-objc, 0) + +AC_PROG_CC +OBJC="$CC" +AC_SUBST(OBJC) +AC_CHECK_HEADERS([unistd.h]) +AM_GNU_GETTEXT([external]) +AM_GNU_GETTEXT_VERSION(0.12.1) + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile.in]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-objc/hello.m b/gettext-tools/examples/hello-objc/hello.m new file mode 100644 index 0000000..3dc6b5e --- /dev/null +++ b/gettext-tools/examples/hello-objc/hello.m @@ -0,0 +1,36 @@ +/* Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the Objective-C program. */ + + +/* Get setlocale() declaration. */ +#include <locale.h> + +/* Get printf() declaration. */ +#include <stdio.h> + +/* Get getpid() declaration. */ +#if HAVE_UNISTD_H +# include <unistd.h> +#endif + +/* Get gettext(), textdomain(), bindtextdomain() declaration. */ +#include "gettext.h" +/* Define shortcut for gettext(). */ +#define _(string) gettext (string) + +int +main () +{ + setlocale (LC_ALL, ""); + textdomain ("hello-objc"); + bindtextdomain ("hello-objc", LOCALEDIR); + + printf ("%s\n", _("Hello, world!")); + printf (_("This program is running as process number %d."), getpid ()); + putchar ('\n'); + + return 0; +} diff --git a/gettext-tools/examples/hello-objc/m4/Makefile.am b/gettext-tools/examples/hello-objc/m4/Makefile.am new file mode 100644 index 0000000..d6431f0 --- /dev/null +++ b/gettext-tools/examples/hello-objc/m4/Makefile.am @@ -0,0 +1,5 @@ +EXTRA_DIST = \ + codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 inttypes.m4 \ + inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 \ + lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \ + ulonglong.m4 diff --git a/gettext-tools/examples/hello-objc/po/LINGUAS b/gettext-tools/examples/hello-objc/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-objc/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-objc/po/Makevars b/gettext-tools/examples/hello-objc/po/Makevars new file mode 100644 index 0000000..03bfa22 --- /dev/null +++ b/gettext-tools/examples/hello-objc/po/Makevars @@ -0,0 +1,43 @@ +# Makefile variables for PO directory in any package using GNU gettext. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + --keyword=_ --flag=_:1:pass-c-format \ + --keyword=N_ --flag=N_:1:pass-c-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = diff --git a/gettext-tools/examples/hello-objc/po/POTFILES.in b/gettext-tools/examples/hello-objc/po/POTFILES.in new file mode 100644 index 0000000..0d88dcd --- /dev/null +++ b/gettext-tools/examples/hello-objc/po/POTFILES.in @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# List of files which contain translatable strings. +hello.m diff --git a/gettext-tools/examples/hello-objc/po/de.po b/gettext-tools/examples/hello-objc/po/de.po new file mode 100644 index 0000000..2dda17a --- /dev/null +++ b/gettext-tools/examples/hello-objc/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-objc package +# German messages for hello-objc. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-objc package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-objc\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.m:31 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.m:32 +#, c-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-pascal/INSTALL b/gettext-tools/examples/hello-pascal/INSTALL new file mode 100644 index 0000000..4c00a19 --- /dev/null +++ b/gettext-tools/examples/hello-pascal/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - Free Pascal (ppc386) diff --git a/gettext-tools/examples/hello-pascal/Makefile.am b/gettext-tools/examples/hello-pascal/Makefile.am new file mode 100644 index 0000000..e7c48d1 --- /dev/null +++ b/gettext-tools/examples/hello-pascal/Makefile.am @@ -0,0 +1,46 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_PASCALPROGRAMS = hello + +# The source files of the 'hello' program. +hello_SOURCES = hello.pas + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh + +# ---------------- General rules for compiling Pascal programs ---------------- + +all-local: hello$(EXEEXT) + +# How to build the 'hello' program. +hello$(EXEEXT) hello.rst: $(hello_SOURCES) + LOCALEDIR='@localedir@' $(PPC) $(hello_SOURCES) + +install-exec-local: all-local + $(mkinstalldirs) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) hello$(EXEEXT) $(DESTDIR)$(bindir)/hello$(EXEEXT) + +installdirs-local: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +uninstall-local: + rm -f $(DESTDIR)$(bindir)/hello$(EXEEXT) + +# Distribute the RST file because it's needed to generate POT files and can +# only be rebuilt on those platforms to which the Pascal compiler is ported. +EXTRA_DIST += hello.rst + +# The list of auxiliary files generated during the compilation. +CLEANFILES = hello.o hello$(EXEEXT) diff --git a/gettext-tools/examples/hello-pascal/autoclean.sh b/gettext-tools/examples/hello-pascal/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-pascal/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-pascal/autogen.sh b/gettext-tools/examples/hello-pascal/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-pascal/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-pascal/configure.ac b/gettext-tools/examples/hello-pascal/configure.ac new file mode 100644 index 0000000..acbc290 --- /dev/null +++ b/gettext-tools/examples/hello-pascal/configure.ac @@ -0,0 +1,39 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.pas) +AM_INIT_AUTOMAKE(hello-pascal, 0) + +dnl Check for availability of the Free Pascal Compiler. +AC_PATH_PROG(PPC, ppc386) +if test -z "$PPC"; then + echo "*** Essential program ppc386 not found" 1>&2 + exit 1 +fi +AC_SUBST(PPC) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-pascal/hello.pas b/gettext-tools/examples/hello-pascal/hello.pas new file mode 100644 index 0000000..e5af3da --- /dev/null +++ b/gettext-tools/examples/hello-pascal/hello.pas @@ -0,0 +1,22 @@ +{ Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the Pascal program. } + +program hello; +{$mode delphi} + +uses gettext, { translateresourcestrings } + linux, { getpid } + sysutils; { format } + +resourcestring + hello_world = 'Hello, world!'; + running_as = 'This program is running as process number %d.'; + +begin + translateresourcestrings({$i %LOCALEDIR%}+'/%s/LC_MESSAGES/hello-pascal.mo'); + writeln(hello_world); + writeln(format(running_as,[getpid])); +end. diff --git a/gettext-tools/examples/hello-pascal/hello.rst b/gettext-tools/examples/hello-pascal/hello.rst new file mode 100644 index 0000000..9f04be6 --- /dev/null +++ b/gettext-tools/examples/hello-pascal/hello.rst @@ -0,0 +1,8 @@ + +# hash value = 153469889 +hello.hello_world='Hello, world!' + + +# hash value = 1323310 +hello.running_as='This program is running as process number %d.' + diff --git a/gettext-tools/examples/hello-pascal/m4/Makefile.am b/gettext-tools/examples/hello-pascal/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-pascal/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-pascal/po/LINGUAS b/gettext-tools/examples/hello-pascal/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-pascal/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-pascal/po/Makefile.am b/gettext-tools/examples/hello-pascal/po/Makefile.am new file mode 100644 index 0000000..bdee73d --- /dev/null +++ b/gettext-tools/examples/hello-pascal/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.rst + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-pascal/po/de.po b/gettext-tools/examples/hello-pascal/po/de.po new file mode 100644 index 0000000..7a1977e --- /dev/null +++ b/gettext-tools/examples/hello-pascal/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-pascal package +# German messages for hello-pascal. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-pascal package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-pascal\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:05+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.hello_world +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.running_as +#, object-pascal-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-perl/INSTALL b/gettext-tools/examples/hello-perl/INSTALL new file mode 100644 index 0000000..71a379e --- /dev/null +++ b/gettext-tools/examples/hello-perl/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - Perl (perl) diff --git a/gettext-tools/examples/hello-perl/Makefile.am b/gettext-tools/examples/hello-perl/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-perl/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-perl/autoclean.sh b/gettext-tools/examples/hello-perl/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-perl/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-perl/autogen.sh b/gettext-tools/examples/hello-perl/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-perl/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-perl/configure.ac b/gettext-tools/examples/hello-perl/configure.ac new file mode 100644 index 0000000..920382f --- /dev/null +++ b/gettext-tools/examples/hello-perl/configure.ac @@ -0,0 +1,40 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.pl) +AM_INIT_AUTOMAKE(hello-perl, 0) + +dnl Check for availability of the Perl interpreter. +AC_PATH_PROG(PERL, perl) +if test -z "$PERL"; then + echo "*** Essential program perl not found" 1>&2 + exit 1 +fi +AC_SUBST(PERL) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.pl], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-perl/hello.pl b/gettext-tools/examples/hello-perl/hello.pl new file mode 100644 index 0000000..58323d1 --- /dev/null +++ b/gettext-tools/examples/hello-perl/hello.pl @@ -0,0 +1,17 @@ +#!@PERL@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the Perl program. + +use Locale::Messages; +use POSIX qw(getpid); + +textdomain "hello-perl"; +bindtextdomain "hello-perl", "@localedir@"; + +print _"Hello, world!"; +print "\n"; +printf _"This program is running as process number %d.", getpid(); +print "\n"; diff --git a/gettext-tools/examples/hello-perl/m4/Makefile.am b/gettext-tools/examples/hello-perl/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-perl/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-perl/po/LINGUAS b/gettext-tools/examples/hello-perl/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-perl/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-perl/po/Makefile.am b/gettext-tools/examples/hello-perl/po/Makefile.am new file mode 100644 index 0000000..560e998 --- /dev/null +++ b/gettext-tools/examples/hello-perl/po/Makefile.am @@ -0,0 +1,292 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.pl + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = \ + -k_ --flag=_:1:pass-perl-format --flag=_:1:pass-perl-brace-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-perl/po/de.po b/gettext-tools/examples/hello-perl/po/de.po new file mode 100644 index 0000000..e2934b6 --- /dev/null +++ b/gettext-tools/examples/hello-perl/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-perl package +# German messages for hello-perl. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-perl package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-perl\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:05+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.pl:14 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.pl:16 +#, perl-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-php/INSTALL b/gettext-tools/examples/hello-php/INSTALL new file mode 100644 index 0000000..fb80188 --- /dev/null +++ b/gettext-tools/examples/hello-php/INSTALL @@ -0,0 +1 @@ +This example relies on PHP. diff --git a/gettext-tools/examples/hello-php/Makefile.am b/gettext-tools/examples/hello-php/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-php/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-php/README b/gettext-tools/examples/hello-php/README new file mode 100644 index 0000000..1658db3 --- /dev/null +++ b/gettext-tools/examples/hello-php/README @@ -0,0 +1,5 @@ +The gettext/PHP binding has a limitation: While it works fine for standalone +PHP programs, it cannot be used inside a web server, to translate parts of web +pages into the preferred encoding of user that makes a HTTP connection. The +reason is that a web server usually is multithreaded, and the gettext() API +relies on the process' global locale. diff --git a/gettext-tools/examples/hello-php/autoclean.sh b/gettext-tools/examples/hello-php/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-php/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-php/autogen.sh b/gettext-tools/examples/hello-php/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-php/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-php/configure.ac b/gettext-tools/examples/hello-php/configure.ac new file mode 100644 index 0000000..fed6b4d --- /dev/null +++ b/gettext-tools/examples/hello-php/configure.ac @@ -0,0 +1,40 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.php) +AM_INIT_AUTOMAKE(hello-php, 0) + +dnl Check for availability of the PHP system. +AC_PATH_PROG(PHP, php) +if test -z "$PHP"; then + echo "*** Essential program php not found" 1>&2 + exit 1 +fi +AC_SUBST(PHP) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.php], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-php/hello.php b/gettext-tools/examples/hello-php/hello.php new file mode 100644 index 0000000..bb7f908 --- /dev/null +++ b/gettext-tools/examples/hello-php/hello.php @@ -0,0 +1,18 @@ +#!@PHP@ -q +<? + // Example for use of GNU gettext. + // Copyright (C) 2003 Free Software Foundation, Inc. + // This file is in the public domain. + // + // Source code of the PHP program. + + setlocale (LC_ALL, ""); + textdomain ("hello-php"); + bindtextdomain ("hello-php", "@localedir@"); + + echo _("Hello, world!"); + echo "\n"; + echo printf (_("This program is running as process number %d."), + posix_getpid()); + echo "\n"; +?> diff --git a/gettext-tools/examples/hello-php/m4/Makefile.am b/gettext-tools/examples/hello-php/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-php/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-php/po/LINGUAS b/gettext-tools/examples/hello-php/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-php/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-php/po/Makefile.am b/gettext-tools/examples/hello-php/po/Makefile.am new file mode 100644 index 0000000..a347aee --- /dev/null +++ b/gettext-tools/examples/hello-php/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.php + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-php/po/de.po b/gettext-tools/examples/hello-php/po/de.po new file mode 100644 index 0000000..af96d97 --- /dev/null +++ b/gettext-tools/examples/hello-php/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-php package +# German messages for hello-php. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-php package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-php\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:06+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.php:13 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.php:15 +#, php-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-python/INSTALL b/gettext-tools/examples/hello-python/INSTALL new file mode 100644 index 0000000..755ed88 --- /dev/null +++ b/gettext-tools/examples/hello-python/INSTALL @@ -0,0 +1 @@ +This example relies on Python 2.0 or newer. diff --git a/gettext-tools/examples/hello-python/Makefile.am b/gettext-tools/examples/hello-python/Makefile.am new file mode 100644 index 0000000..76f8e1f --- /dev/null +++ b/gettext-tools/examples/hello-python/Makefile.am @@ -0,0 +1,27 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Making a Python program executable. +# FIXME: How to make a compiled python program (output of automake's +# py-compile command) executable? +hello: hello.py + (echo '#!@PYTHON@'; cat $<) > $@ + chmod a+x $@ +CLEANFILES = hello +#CLEANFILES += *.pyc *.pyo + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-python/autoclean.sh b/gettext-tools/examples/hello-python/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-python/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-python/autogen.sh b/gettext-tools/examples/hello-python/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-python/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-python/configure.ac b/gettext-tools/examples/hello-python/configure.ac new file mode 100644 index 0000000..30b9fb0 --- /dev/null +++ b/gettext-tools/examples/hello-python/configure.ac @@ -0,0 +1,38 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.py.in) +AM_INIT_AUTOMAKE(hello-python, 0) + +dnl Check for availability of the Python interpreter. +AM_PATH_PYTHON +if test -z "$PYTHON"; then + echo "*** Essential program python not found" 1>&2 + exit 1 +fi + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile hello.py]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-python/hello.py.in b/gettext-tools/examples/hello-python/hello.py.in new file mode 100644 index 0000000..4e56cc1 --- /dev/null +++ b/gettext-tools/examples/hello-python/hello.py.in @@ -0,0 +1,15 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the Python program. + +import gettext +import os + +gettext.textdomain('hello-python') +gettext.bindtextdomain('hello-python', '@localedir@') + +print gettext.gettext("Hello, world!") +print gettext.gettext("This program is running as process number %(pid)d.") \ + % { 'pid': os.getpid() } diff --git a/gettext-tools/examples/hello-python/m4/Makefile.am b/gettext-tools/examples/hello-python/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-python/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-python/po/LINGUAS b/gettext-tools/examples/hello-python/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-python/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-python/po/Makefile.am b/gettext-tools/examples/hello-python/po/Makefile.am new file mode 100644 index 0000000..1bb1253 --- /dev/null +++ b/gettext-tools/examples/hello-python/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.py.in + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-python/po/de.po b/gettext-tools/examples/hello-python/po/de.po new file mode 100644 index 0000000..043e7ba --- /dev/null +++ b/gettext-tools/examples/hello-python/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-python package +# German messages for hello-python. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-python package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-python\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.py.in:13 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.py.in:14 +#, python-format +msgid "This program is running as process number %(pid)d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %(pid)d." diff --git a/gettext-tools/examples/hello-sh/INSTALL b/gettext-tools/examples/hello-sh/INSTALL new file mode 100644 index 0000000..a4502d9 --- /dev/null +++ b/gettext-tools/examples/hello-sh/INSTALL @@ -0,0 +1 @@ +This example relies just on sh and gettext-runtime. diff --git a/gettext-tools/examples/hello-sh/Makefile.am b/gettext-tools/examples/hello-sh/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-sh/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-sh/autoclean.sh b/gettext-tools/examples/hello-sh/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-sh/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-sh/autogen.sh b/gettext-tools/examples/hello-sh/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-sh/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-sh/configure.ac b/gettext-tools/examples/hello-sh/configure.ac new file mode 100644 index 0000000..c34eb74 --- /dev/null +++ b/gettext-tools/examples/hello-sh/configure.ac @@ -0,0 +1,32 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.sh) +AM_INIT_AUTOMAKE(hello-sh, 0) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.sh], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-sh/hello.sh b/gettext-tools/examples/hello-sh/hello.sh new file mode 100644 index 0000000..f0997b5 --- /dev/null +++ b/gettext-tools/examples/hello-sh/hello.sh @@ -0,0 +1,18 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the POSIX sh program. + +. gettext.sh + +TEXTDOMAIN=hello-sh +export TEXTDOMAIN +TEXTDOMAINDIR='@localedir@' +export TEXTDOMAINDIR + +gettext "Hello, world!"; echo + +pid=$$ +eval_gettext "This program is running as process number \$pid."; echo diff --git a/gettext-tools/examples/hello-sh/m4/Makefile.am b/gettext-tools/examples/hello-sh/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-sh/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-sh/po/LINGUAS b/gettext-tools/examples/hello-sh/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-sh/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-sh/po/Makefile.am b/gettext-tools/examples/hello-sh/po/Makefile.am new file mode 100644 index 0000000..ca1d48c --- /dev/null +++ b/gettext-tools/examples/hello-sh/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.sh + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-sh/po/de.po b/gettext-tools/examples/hello-sh/po/de.po new file mode 100644 index 0000000..ca1e375 --- /dev/null +++ b/gettext-tools/examples/hello-sh/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-sh package +# German messages for hello-sh. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-sh package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:02+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.sh:15 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.sh:18 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dieses Programm läuft mit der Prozess-Nummer $pid." diff --git a/gettext-tools/examples/hello-smalltalk/INSTALL b/gettext-tools/examples/hello-smalltalk/INSTALL new file mode 100644 index 0000000..3fb700d --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/INSTALL @@ -0,0 +1 @@ +This example relies on gst (GNU Smalltalk). diff --git a/gettext-tools/examples/hello-smalltalk/Makefile.am b/gettext-tools/examples/hello-smalltalk/Makefile.am new file mode 100644 index 0000000..2587bd5 --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/Makefile.am @@ -0,0 +1,27 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello +all-local: hello +CLEANFILES = hello + +# The Smalltalk program is installed as data and invoked through a shell script. +pkgdata_DATA = hello.st +hello: + { echo '#!/bin/sh'; \ + echo "exec '@GST@' -Q '$(pkgdatadir)/hello.st' \"\$$@\""; \ + } > $@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-smalltalk/autoclean.sh b/gettext-tools/examples/hello-smalltalk/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-smalltalk/autogen.sh b/gettext-tools/examples/hello-smalltalk/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-smalltalk/configure.ac b/gettext-tools/examples/hello-smalltalk/configure.ac new file mode 100644 index 0000000..52b6422 --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/configure.ac @@ -0,0 +1,39 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.st.in) +AM_INIT_AUTOMAKE(hello-smalltalk, 0) + +dnl Check for availability of GNU Smalltalk. +AC_PATH_PROG(GST, gst) +if test -z "$GST"; then + echo "*** Essential program gst not found" 1>&2 + exit 1 +fi +AC_SUBST(GST) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "localedir=\"${datadir}/locale\"" +prefix="$save_prefix" +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile hello.st]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-smalltalk/hello.st.in b/gettext-tools/examples/hello-smalltalk/hello.st.in new file mode 100644 index 0000000..a01e004 --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/hello.st.in @@ -0,0 +1,46 @@ +" Example for use of GNU gettext. + Copyright (C) 2003 Free Software Foundation, Inc. + This file is in the public domain. + + Source code of the GNU Smalltalk program. +" + +PackageLoader fileInPackage: 'I18N' ! + +Object subclass: #Main + instanceVariableNames: '' + classVariableNames: 'NLS' + poolDictionaries: '' + category: 'Program' +! +!Main methodsFor: 'running'! +run + NLS := I18N Locale default messages domain: 'hello-smalltalk' localeDirectory: '@localedir@'. + Transcript showCr: (NLS ? 'Hello, world!'). + Transcript showCr: ((NLS ? 'This program is running as process number %1.') bindWith: self getpid). +! + + +"Unfortunately I cannot define getpid like this - it gives + 'C function getpid not defined'. + +SystemDictionary defineCFunc: 'getpid' + withSelectorArgs: 'getpid' + returning: #int + args: #() +! + +So let's define it through an external process." + +!Main methodsFor: 'auxiliary stuff'! +getpid + | stream pid | + stream := FileDescriptor popen: 'echo $PPID' dir: #read. + pid := stream contents asNumber. + stream close. + ^ pid +! +! + + +Main new run! diff --git a/gettext-tools/examples/hello-smalltalk/m4/Makefile.am b/gettext-tools/examples/hello-smalltalk/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-smalltalk/po/LINGUAS b/gettext-tools/examples/hello-smalltalk/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-smalltalk/po/Makefile.am b/gettext-tools/examples/hello-smalltalk/po/Makefile.am new file mode 100644 index 0000000..9387717 --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.st.in + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-smalltalk/po/de.po b/gettext-tools/examples/hello-smalltalk/po/de.po new file mode 100644 index 0000000..c9bd61e --- /dev/null +++ b/gettext-tools/examples/hello-smalltalk/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-smalltalk package +# German messages for hello-smalltalk. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-smalltalk package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:03+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.st.in:19 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.st.in:20 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/gettext-tools/examples/hello-tcl-tk/INSTALL b/gettext-tools/examples/hello-tcl-tk/INSTALL new file mode 100644 index 0000000..516aaba --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/INSTALL @@ -0,0 +1,3 @@ +This example relies on: + - Tk (wish and libtk) + - Tcl (tclsh and libtcl) diff --git a/gettext-tools/examples/hello-tcl-tk/Makefile.am b/gettext-tools/examples/hello-tcl-tk/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-tcl-tk/autoclean.sh b/gettext-tools/examples/hello-tcl-tk/autoclean.sh new file mode 100755 index 0000000..beb6fc6 --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.msg diff --git a/gettext-tools/examples/hello-tcl-tk/autogen.sh b/gettext-tools/examples/hello-tcl-tk/autogen.sh new file mode 100755 index 0000000..c9165ae --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c --tcl -d . -l $lang $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-tcl-tk/configure.ac b/gettext-tools/examples/hello-tcl-tk/configure.ac new file mode 100644 index 0000000..3541e8c --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/configure.ac @@ -0,0 +1,40 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.tcl) +AM_INIT_AUTOMAKE(hello-tcl-tk, 0) + +dnl Check for availability of the Tcl/Tk interpreter. +AC_PATH_PROG(WISH, wish) +if test -z "$WISH"; then + echo "*** Essential program wish not found" 1>&2 + exit 1 +fi +AC_SUBST(WISH) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "pkgdatadir=\"${datadir}/${PACKAGE}\"" +prefix="$save_prefix" +AC_SUBST(pkgdatadir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.tcl], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-tcl-tk/hello.tcl b/gettext-tools/examples/hello-tcl-tk/hello.tcl new file mode 100644 index 0000000..ecb688a --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/hello.tcl @@ -0,0 +1,20 @@ +#!@WISH@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the Tcl/Tk program. + +package require msgcat +::msgcat::mcload [file join "@pkgdatadir@" "msgs"] +proc _ {s} {return [::msgcat::mc $s]} + +frame .my +button .my.button \ + -text [_ "Hello, world!"] \ + -command exit +label .my.label \ + -text [format [_ "This program is running as process number %d."] [pid]] +pack .my.button -side top +pack .my.label -side bottom +pack .my diff --git a/gettext-tools/examples/hello-tcl-tk/m4/Makefile.am b/gettext-tools/examples/hello-tcl-tk/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-tcl-tk/po/LINGUAS b/gettext-tools/examples/hello-tcl-tk/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-tcl-tk/po/Makefile.am b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am new file mode 100644 index 0000000..0a4de9b --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am @@ -0,0 +1,209 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.tcl + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --flag=_:1:pass-tcl-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(frob $(lang)).msg) +MSGFILES = @MSGFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(frob $(lang)).msg) +CATALOGS = @TCLCATALOGS@ + +SUFFIXES = .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(MSGFILES)" || $(MAKE) $(MSGFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/msgs + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + echo "installing $$realcat as $(DESTDIR)$(pkgdatadir)/msgs/$$cat"; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/msgs + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + rm -f $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = stamp-po $(MSGFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(MSGFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-msg + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-msg: Makefile $(MSGFILES) + @: diff --git a/gettext-tools/examples/hello-tcl-tk/po/de.po b/gettext-tools/examples/hello-tcl-tk/po/de.po new file mode 100644 index 0000000..ee178b0 --- /dev/null +++ b/gettext-tools/examples/hello-tcl-tk/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-tcl-tk package +# German messages for hello-tcl-tk. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-tcl-tk package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:05+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:14 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.tcl:17 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-tcl/INSTALL b/gettext-tools/examples/hello-tcl/INSTALL new file mode 100644 index 0000000..e9e21ad --- /dev/null +++ b/gettext-tools/examples/hello-tcl/INSTALL @@ -0,0 +1,2 @@ +This example relies on: + - Tcl (tclsh and libtcl) diff --git a/gettext-tools/examples/hello-tcl/Makefile.am b/gettext-tools/examples/hello-tcl/Makefile.am new file mode 100644 index 0000000..212d2a8 --- /dev/null +++ b/gettext-tools/examples/hello-tcl/Makefile.am @@ -0,0 +1,18 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-tcl/autoclean.sh b/gettext-tools/examples/hello-tcl/autoclean.sh new file mode 100755 index 0000000..beb6fc6 --- /dev/null +++ b/gettext-tools/examples/hello-tcl/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.msg diff --git a/gettext-tools/examples/hello-tcl/autogen.sh b/gettext-tools/examples/hello-tcl/autogen.sh new file mode 100755 index 0000000..c9165ae --- /dev/null +++ b/gettext-tools/examples/hello-tcl/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c --tcl -d . -l $lang $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-tcl/configure.ac b/gettext-tools/examples/hello-tcl/configure.ac new file mode 100644 index 0000000..a65aa76 --- /dev/null +++ b/gettext-tools/examples/hello-tcl/configure.ac @@ -0,0 +1,40 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.tcl) +AM_INIT_AUTOMAKE(hello-tcl, 0) + +dnl Check for availability of the Tcl interpreter. +AC_PATH_PROG(TCLSH, tclsh) +if test -z "$TCLSH"; then + echo "*** Essential program tclsh not found" 1>&2 + exit 1 +fi +AC_SUBST(TCLSH) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "pkgdatadir=\"${datadir}/${PACKAGE}\"" +prefix="$save_prefix" +AC_SUBST(pkgdatadir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.tcl], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-tcl/hello.tcl b/gettext-tools/examples/hello-tcl/hello.tcl new file mode 100644 index 0000000..3dac5cb --- /dev/null +++ b/gettext-tools/examples/hello-tcl/hello.tcl @@ -0,0 +1,13 @@ +#!@TCLSH@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Source code of the Tcl program. + +package require msgcat +::msgcat::mcload [file join "@pkgdatadir@" "msgs"] +proc _ {s} {return [::msgcat::mc $s]} + +puts [_ "Hello, world!"] +puts [format [_ "This program is running as process number %d."] [pid]] diff --git a/gettext-tools/examples/hello-tcl/m4/Makefile.am b/gettext-tools/examples/hello-tcl/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-tcl/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-tcl/po/LINGUAS b/gettext-tools/examples/hello-tcl/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-tcl/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-tcl/po/Makefile.am b/gettext-tools/examples/hello-tcl/po/Makefile.am new file mode 100644 index 0000000..0a4de9b --- /dev/null +++ b/gettext-tools/examples/hello-tcl/po/Makefile.am @@ -0,0 +1,209 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.tcl + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --flag=_:1:pass-tcl-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(frob $(lang)).msg) +MSGFILES = @MSGFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(frob $(lang)).msg) +CATALOGS = @TCLCATALOGS@ + +SUFFIXES = .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(MSGFILES)" || $(MAKE) $(MSGFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/msgs + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + echo "installing $$realcat as $(DESTDIR)$(pkgdatadir)/msgs/$$cat"; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/msgs + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + rm -f $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = stamp-po $(MSGFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(MSGFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-msg + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-msg: Makefile $(MSGFILES) + @: diff --git a/gettext-tools/examples/hello-tcl/po/de.po b/gettext-tools/examples/hello-tcl/po/de.po new file mode 100644 index 0000000..a1764ba --- /dev/null +++ b/gettext-tools/examples/hello-tcl/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-tcl package +# German messages for hello-tcl. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-tcl package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 15:05+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:12 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.tcl:13 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/gettext-tools/examples/hello-ycp/INSTALL b/gettext-tools/examples/hello-ycp/INSTALL new file mode 100644 index 0000000..1a03944 --- /dev/null +++ b/gettext-tools/examples/hello-ycp/INSTALL @@ -0,0 +1 @@ +This example relies on YaST2 (SuSE Linux: package yast2-core). diff --git a/gettext-tools/examples/hello-ycp/Makefile.am b/gettext-tools/examples/hello-ycp/Makefile.am new file mode 100644 index 0000000..3c316f9 --- /dev/null +++ b/gettext-tools/examples/hello-ycp/Makefile.am @@ -0,0 +1,31 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello +all-local: hello +CLEANFILES = hello + +# The YCP program is installed as data and invoked through a shell script. +pkgdata_DATA = hello.ycp +hello: + { echo '#!/bin/sh'; \ + echo 'if test -n "$$DISPLAY"; then'; \ + echo " exec /usr/lib/YaST2/bin/y2base '$(pkgdatadir)/hello.ycp' qt"; \ + echo 'else'; \ + echo " exec /usr/lib/YaST2/bin/y2base '$(pkgdatadir)/hello.ycp' ncurses"; \ + echo 'fi'; \ + } > $@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/gettext-tools/examples/hello-ycp/autoclean.sh b/gettext-tools/examples/hello-ycp/autoclean.sh new file mode 100755 index 0000000..a309cee --- /dev/null +++ b/gettext-tools/examples/hello-ycp/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f po/remove-potcdate.sin + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f mkinstalldirs +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/gettext-tools/examples/hello-ycp/autogen.sh b/gettext-tools/examples/hello-ycp/autogen.sh new file mode 100755 index 0000000..dc73bff --- /dev/null +++ b/gettext-tools/examples/hello-ycp/autogen.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +test -r ../Makefile.am || . ../installpaths + +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-../../../gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${GETTEXTSRCPODIR-../../../gettext-runtime/po}/remove-potcdate.sin po/remove-potcdate.sin + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/gettext-tools/examples/hello-ycp/configure.ac b/gettext-tools/examples/hello-ycp/configure.ac new file mode 100644 index 0000000..3b0303e --- /dev/null +++ b/gettext-tools/examples/hello-ycp/configure.ac @@ -0,0 +1,29 @@ +dnl Example for use of GNU gettext. +dnl Copyright (C) 2003 Free Software Foundation, Inc. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT +AC_CONFIG_SRCDIR(hello.ycp) +AM_INIT_AUTOMAKE(hello-ycp, 0) + +dnl Check for availability of YaST's engine. +test -f /usr/lib/YaST2/bin/y2base || { + echo "*** Essential program y2base not found" 1>&2 + exit 1 +} + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, YaST hard codes the message catalog directory. +localedir=/usr/share/YaST2/locale +AC_SUBST(localedir) + +dnl Support for the po directory. +AM_NLS +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/gettext-tools/examples/hello-ycp/hello.ycp b/gettext-tools/examples/hello-ycp/hello.ycp new file mode 100644 index 0000000..e9a57d2 --- /dev/null +++ b/gettext-tools/examples/hello-ycp/hello.ycp @@ -0,0 +1,31 @@ +// Example for use of GNU gettext. +// Copyright (C) 2003 Free Software Foundation, Inc. +// This file is in the public domain. + +// Source code of the YCP program. + +UI(``{ + textdomain "hello-ycp"; + + map bash_out = SCR::Execute (.target.bash_output, "echo $PPID"); + integer pid = tointeger (bash_out["stdout"]:"99999"); + + OpenDialog ( + `VBox ( + `HBox ( + `Label (_("Hello, world!")), + `HStretch () + ), + `HBox ( + `Label (sformat (_("This program is running as process number %1."), pid)), + `HStretch () + ), + `HBox ( + `HStretch (), + `PushButton (`opt(`default), "&OK") + ) + ) + ); + UserInput(); + CloseDialog(); +}) diff --git a/gettext-tools/examples/hello-ycp/m4/Makefile.am b/gettext-tools/examples/hello-ycp/m4/Makefile.am new file mode 100644 index 0000000..8a841b3 --- /dev/null +++ b/gettext-tools/examples/hello-ycp/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/gettext-tools/examples/hello-ycp/po/LINGUAS b/gettext-tools/examples/hello-ycp/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/hello-ycp/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/hello-ycp/po/Makefile.am b/gettext-tools/examples/hello-ycp/po/Makefile.am new file mode 100644 index 0000000..71ebc6d --- /dev/null +++ b/gettext-tools/examples/hello-ycp/po/Makefile.am @@ -0,0 +1,291 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.ycp + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = @localedir@ + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES = @GMOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +# This is computed as +# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) +CATALOGS = @CATALOGS@ + +SUFFIXES = .po .gmo .mo .sed .sin .nop .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ + +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(POTFILES) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(mkinstalldirs) $(DESTDIR)$(datadir) + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkinstalldirs) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = *.mo + +MAINTAINERCLEANFILES = stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sin LINGUAS $(DOMAIN).pot stamp-po $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/gettext-tools/examples/hello-ycp/po/de.po b/gettext-tools/examples/hello-ycp/po/de.po new file mode 100644 index 0000000..67057bf --- /dev/null +++ b/gettext-tools/examples/hello-ycp/po/de.po @@ -0,0 +1,27 @@ +# German translations for hello-ycp package +# German messages for hello-ycp. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the hello-ycp package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:26+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.ycp:16 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/gettext-tools/examples/installpaths.in b/gettext-tools/examples/installpaths.in new file mode 100644 index 0000000..a41988b --- /dev/null +++ b/gettext-tools/examples/installpaths.in @@ -0,0 +1,8 @@ +prefix='@prefix@' +exec_prefix="@exec_prefix@" +datadir="@datadir@" +docdir="@docdir@" +ACLOCALDIR="@aclocaldir@" +GETTEXTSRCDIR="@datadir@/gettext" +GETTEXTSRCPODIR="@datadir@/gettext/po" +EXAMPLESCONFIGDIR="@docdir@/examples/config" diff --git a/gettext-tools/examples/po/LINGUAS b/gettext-tools/examples/po/LINGUAS new file mode 100644 index 0000000..b3b791d --- /dev/null +++ b/gettext-tools/examples/po/LINGUAS @@ -0,0 +1,6 @@ +# Example for use of GNU gettext. +# Copyright (C) 2003 Free Software Foundation, Inc. +# This file is in the public domain. +# +# Set of available languages. +de diff --git a/gettext-tools/examples/po/Makefile.am b/gettext-tools/examples/po/Makefile.am new file mode 100644 index 0000000..5205dff --- /dev/null +++ b/gettext-tools/examples/po/Makefile.am @@ -0,0 +1,426 @@ +## Makefile for the gettext-tools/examples/po subdirectory of GNU gettext +## Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc. +## +## 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) +## 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. +## +## 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. + +## Process this file with automake to produce Makefile.in. + +AUTOMAKE_OPTIONS = 1.5 gnits + +# List of files which contain translatable strings. +POTFILES = \ + examples/hello-c/hello.c \ + examples/hello-c-gnome/hello.c \ + examples/hello-c++/hello.cc \ + examples/hello-c++-qt/hello.cc \ + examples/hello-c++-kde/hello.cc \ + examples/hello-c++-kde/hellowindow.h \ + examples/hello-c++-kde/hellowindow.cc \ + examples/hello-c++-gnome/hello.cc \ + examples/hello-objc/hello.m \ + examples/hello-objc-gnustep/main.m \ + examples/hello-objc-gnustep/AppController.h \ + examples/hello-objc-gnustep/AppController.m \ + examples/hello-objc-gnustep/Hello.h \ + examples/hello-objc-gnustep/Hello.m \ + examples/hello-objc-gnome/hello.m \ + examples/hello-sh/hello.sh \ + examples/hello-python/hello.py.in \ + examples/hello-clisp/hello.lisp.in \ + examples/hello-librep/hello.jl.in \ + examples/hello-smalltalk/hello.st.in \ + examples/hello-java/Hello.java \ + examples/hello-java-awt/Hello.java \ + examples/hello-java-swing/Hello.java \ + examples/hello-gawk/hello.awk \ + examples/hello-pascal/hello.pas \ + examples/hello-ycp/hello.ycp \ + examples/hello-tcl/hello.tcl \ + examples/hello-tcl-tk/hello.tcl \ + examples/hello-perl/hello.pl \ + examples/hello-php/hello.php + +# List of small POT files. +SMALLPOTS = \ + hello-c.pot \ + hello-c-gnome.pot \ + hello-c++.pot \ + hello-c++-qt.pot \ + hello-c++-kde.pot \ + hello-c++-gnome.pot \ + hello-objc.pot \ + hello-objc-gnustep.pot \ + hello-objc-gnome.pot \ + hello-sh.pot \ + hello-python.pot \ + hello-clisp.pot \ + hello-librep.pot \ + hello-smalltalk.pot \ + hello-java.pot \ + hello-java-awt.pot \ + hello-java-swing.pot \ + hello-gawk.pot \ + hello-pascal.pot \ + hello-ycp.pot \ + hello-tcl.pot \ + hello-tcl-tk.pot \ + hello-perl.pot \ + hello-php.pot + +# This is a synthetic domain name. +DOMAIN = gettext-examples + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +localedir = $(datadir)/locale + +MSGMERGE = msgmerge +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +SUFFIXES = .po .sed .sin .nop .po-update + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(SMALLPOTS) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + + +hello-c.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c + +hello-c-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c-gnome + +hello-c++.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++ + +hello-c++-qt.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-qt + +hello-c++-kde.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-kde + +hello-c++-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-gnome + +hello-objc.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc + +hello-objc-gnustep.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc-gnustep + +hello-objc-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc-gnome + +hello-sh.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-sh + +hello-python.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-python + +hello-clisp.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-clisp + +hello-librep.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-librep + +hello-smalltalk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-smalltalk + +hello-java.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java + +hello-java-awt.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java-awt + +hello-java-swing.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java-swing + +hello-gawk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-gawk + +hello-pascal.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-pascal + +hello-ycp.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-ycp + +hello-tcl.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-tcl + +hello-tcl-tk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-tcl-tk + +hello-perl.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-perl + +hello-php.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-php + + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += remove-potcdate.sed +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +DISTCLEANFILES = $(SMALLPOTS) + +MAINTAINERCLEANFILES = stamp-po + +EXTRA_DIST = remove-potcdate.sin xsmallpot.sh mmsmallpo.sh LINGUAS \ + $(DOMAIN).pot stamp-po $(POFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + $(MAKE) $(SMALLPOFILES_FOR_lang) LL=$$lang; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + + +# Rules for updating small PO files in the other directories. +# Depend on LL being set. + +SMALLPOFILES_FOR_lang = \ + ../hello-c/po/$$lang.po \ + ../hello-c-gnome/po/$$lang.po \ + ../hello-c++/po/$$lang.po \ + ../hello-c++-qt/po/$$lang.po \ + ../hello-c++-kde/po/$$lang.po \ + ../hello-c++-gnome/po/$$lang.po \ + ../hello-objc/po/$$lang.po \ + ../hello-objc-gnustep/po/$$lang.po \ + ../hello-objc-gnome/po/$$lang.po \ + ../hello-sh/po/$$lang.po \ + ../hello-python/po/$$lang.po \ + ../hello-clisp/po/$$lang.po \ + ../hello-librep/po/$$lang.po \ + ../hello-smalltalk/po/$$lang.po \ + ../hello-java/po/$$lang.po \ + ../hello-java-awt/po/$$lang.po \ + ../hello-java-swing/po/$$lang.po \ + ../hello-gawk/po/$$lang.po \ + ../hello-pascal/po/$$lang.po \ + ../hello-ycp/po/$$lang.po \ + ../hello-tcl/po/$$lang.po \ + ../hello-tcl-tk/po/$$lang.po \ + ../hello-perl/po/$$lang.po \ + ../hello-php/po/$$lang.po + +../hello-c/po/$(LL).po: hello-c.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c $(LL) + +../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c-gnome $(LL) + +../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++ $(LL) + +../hello-c++-qt/po/$(LL).po: hello-c++-qt.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-qt $(LL) + +../hello-c++-kde/po/$(LL).po: hello-c++-kde.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-kde $(LL) + +../hello-c++-gnome/po/$(LL).po: hello-c++-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-gnome $(LL) + +../hello-objc/po/$(LL).po: hello-objc.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc $(LL) + +../hello-objc-gnustep/po/$(LL).po: hello-objc-gnustep.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc-gnustep $(LL) + +../hello-objc-gnome/po/$(LL).po: hello-objc-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc-gnome $(LL) + +../hello-sh/po/$(LL).po: hello-sh.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-sh $(LL) + +../hello-python/po/$(LL).po: hello-python.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-python $(LL) + +../hello-clisp/po/$(LL).po: hello-clisp.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-clisp $(LL) + +../hello-librep/po/$(LL).po: hello-librep.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-librep $(LL) + +../hello-smalltalk/po/$(LL).po: hello-smalltalk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-smalltalk $(LL) + +../hello-java/po/$(LL).po: hello-java.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java $(LL) + +../hello-java-awt/po/$(LL).po: hello-java-awt.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java-awt $(LL) + +../hello-java-swing/po/$(LL).po: hello-java-swing.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java-swing $(LL) + +../hello-gawk/po/$(LL).po: hello-gawk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-gawk $(LL) + +../hello-pascal/po/$(LL).po: hello-pascal.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-pascal $(LL) + +../hello-ycp/po/$(LL).po: hello-ycp.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-ycp $(LL) + +../hello-tcl/po/$(LL).po: hello-tcl.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-tcl $(LL) + +../hello-tcl-tk/po/$(LL).po: hello-tcl-tk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-tcl-tk $(LL) + +../hello-perl/po/$(LL).po: hello-perl.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-perl $(LL) + +../hello-php/po/$(LL).po: hello-php.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-php $(LL) diff --git a/gettext-tools/examples/po/Makefile.in b/gettext-tools/examples/po/Makefile.in new file mode 100644 index 0000000..545c49e --- /dev/null +++ b/gettext-tools/examples/po/Makefile.in @@ -0,0 +1,766 @@ +# Makefile.in generated by automake 1.7.8 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +ALLOCA_H = @ALLOCA_H@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BUILDJAVA = @BUILDJAVA@ +BUILDJAVAEXE = @BUILDJAVAEXE@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CLASSPATH = @CLASSPATH@ +CLASSPATH_SEPARATOR = @CLASSPATH_SEPARATOR@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CROSS_COMPILING = @CROSS_COMPILING@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DATADIRNAME = @DATADIRNAME@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DVIPS = @DVIPS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EMACS = @EMACS@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FNMATCH_H = @FNMATCH_H@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ +GENCAT = @GENCAT@ +GLIBC21 = @GLIBC21@ +GMSGFMT = @GMSGFMT@ +HAVE_ASPRINTF = @HAVE_ASPRINTF@ +HAVE_GCJ = @HAVE_GCJ@ +HAVE_GCJ_C = @HAVE_GCJ_C@ +HAVE_GCJ_IN_PATH = @HAVE_GCJ_IN_PATH@ +HAVE_GIJ = @HAVE_GIJ@ +HAVE_GIJ_IN_PATH = @HAVE_GIJ_IN_PATH@ +HAVE_JAVA = @HAVE_JAVA@ +HAVE_JAVAC = @HAVE_JAVAC@ +HAVE_JAVAC_IN_PATH = @HAVE_JAVAC_IN_PATH@ +HAVE_JAVA_IN_PATH = @HAVE_JAVA_IN_PATH@ +HAVE_JIKES = @HAVE_JIKES@ +HAVE_JIKES_IN_PATH = @HAVE_JIKES_IN_PATH@ +HAVE_JRE = @HAVE_JRE@ +HAVE_JRE_IN_PATH = @HAVE_JRE_IN_PATH@ +HAVE_JVIEW = @HAVE_JVIEW@ +HAVE_JVIEW_IN_PATH = @HAVE_JVIEW_IN_PATH@ +HAVE_LIBEXPAT = @HAVE_LIBEXPAT@ +HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ +HAVE_SNPRINTF = @HAVE_SNPRINTF@ +HAVE_WPRINTF = @HAVE_WPRINTF@ +HAVE__BOOL = @HAVE__BOOL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +JAR = @JAR@ +JAVA = @JAVA@ +JAVAC = @JAVAC@ +LDFLAGS = @LDFLAGS@ +LIBEXPAT = @LIBEXPAT@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LOCALE_FR = @LOCALE_FR@ +LTALLOCA = @LTALLOCA@ +LTLIBEXPAT = @LTLIBEXPAT@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ + +MSGMERGE = msgmerge +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +RELOCATABLE = @RELOCATABLE@ +RELOCATABLE_VIA_LD_FALSE = @RELOCATABLE_VIA_LD_FALSE@ +RELOCATABLE_VIA_LD_TRUE = @RELOCATABLE_VIA_LD_TRUE@ +SET_MAKE = @SET_MAKE@ +SET_RELOCATABLE = @SET_RELOCATABLE@ +SHELL = @SHELL@ +STDBOOL_H = @STDBOOL_H@ +STRIP = @STRIP@ +TESTJAVA = @TESTJAVA@ +TEXI2PDF = @TEXI2PDF@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XGETTEXT = @XGETTEXT@ +YACC = @YACC@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_AS = @ac_ct_AS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DLLTOOL = @ac_ct_DLLTOOL@ +ac_ct_F77 = @ac_ct_F77@ +ac_ct_OBJDUMP = @ac_ct_OBJDUMP@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +aclocaldir = @aclocaldir@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +docdir = @docdir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +lispdir = @lispdir@ + +localedir = $(datadir)/locale +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +AUTOMAKE_OPTIONS = 1.5 gnits + +# List of files which contain translatable strings. +POTFILES = \ + examples/hello-c/hello.c \ + examples/hello-c-gnome/hello.c \ + examples/hello-c++/hello.cc \ + examples/hello-c++-qt/hello.cc \ + examples/hello-c++-kde/hello.cc \ + examples/hello-c++-kde/hellowindow.h \ + examples/hello-c++-kde/hellowindow.cc \ + examples/hello-c++-gnome/hello.cc \ + examples/hello-objc/hello.m \ + examples/hello-objc-gnustep/main.m \ + examples/hello-objc-gnustep/AppController.h \ + examples/hello-objc-gnustep/AppController.m \ + examples/hello-objc-gnustep/Hello.h \ + examples/hello-objc-gnustep/Hello.m \ + examples/hello-objc-gnome/hello.m \ + examples/hello-sh/hello.sh \ + examples/hello-python/hello.py.in \ + examples/hello-clisp/hello.lisp.in \ + examples/hello-librep/hello.jl.in \ + examples/hello-smalltalk/hello.st.in \ + examples/hello-java/Hello.java \ + examples/hello-java-awt/Hello.java \ + examples/hello-java-swing/Hello.java \ + examples/hello-gawk/hello.awk \ + examples/hello-pascal/hello.pas \ + examples/hello-ycp/hello.ycp \ + examples/hello-tcl/hello.tcl \ + examples/hello-tcl-tk/hello.tcl \ + examples/hello-perl/hello.pl \ + examples/hello-php/hello.php + + +# List of small POT files. +SMALLPOTS = \ + hello-c.pot \ + hello-c-gnome.pot \ + hello-c++.pot \ + hello-c++-qt.pot \ + hello-c++-kde.pot \ + hello-c++-gnome.pot \ + hello-objc.pot \ + hello-objc-gnustep.pot \ + hello-objc-gnome.pot \ + hello-sh.pot \ + hello-python.pot \ + hello-clisp.pot \ + hello-librep.pot \ + hello-smalltalk.pot \ + hello-java.pot \ + hello-java-awt.pot \ + hello-java-swing.pot \ + hello-gawk.pot \ + hello-pascal.pot \ + hello-ycp.pot \ + hello-tcl.pot \ + hello-tcl-tk.pot \ + hello-perl.pot \ + hello-php.pot + + +# This is a synthetic domain name. +DOMAIN = gettext-examples + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgstr strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gnu-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS = @POTFILES_DEPS@ + +# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) +POFILES = @POFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) +UPDATEPOFILES = @UPDATEPOFILES@ +# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) +DUMMYPOFILES = @DUMMYPOFILES@ + +SUFFIXES = .po .sed .sin .nop .po-update + +MOSTLYCLEANFILES = remove-potcdate.sed stamp-poT core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po *.o + +DISTCLEANFILES = $(SMALLPOTS) + +MAINTAINERCLEANFILES = stamp-po + +EXTRA_DIST = remove-potcdate.sin xsmallpot.sh mmsmallpo.sh LINGUAS \ + $(DOMAIN).pot stamp-po $(POFILES) + + + +# Rules for updating small PO files in the other directories. +# Depend on LL being set. +SMALLPOFILES_FOR_lang = \ + ../hello-c/po/$$lang.po \ + ../hello-c-gnome/po/$$lang.po \ + ../hello-c++/po/$$lang.po \ + ../hello-c++-qt/po/$$lang.po \ + ../hello-c++-kde/po/$$lang.po \ + ../hello-c++-gnome/po/$$lang.po \ + ../hello-objc/po/$$lang.po \ + ../hello-objc-gnustep/po/$$lang.po \ + ../hello-objc-gnome/po/$$lang.po \ + ../hello-sh/po/$$lang.po \ + ../hello-python/po/$$lang.po \ + ../hello-clisp/po/$$lang.po \ + ../hello-librep/po/$$lang.po \ + ../hello-smalltalk/po/$$lang.po \ + ../hello-java/po/$$lang.po \ + ../hello-java-awt/po/$$lang.po \ + ../hello-java-swing/po/$$lang.po \ + ../hello-gawk/po/$$lang.po \ + ../hello-pascal/po/$$lang.po \ + ../hello-ycp/po/$$lang.po \ + ../hello-tcl/po/$$lang.po \ + ../hello-tcl-tk/po/$$lang.po \ + ../hello-perl/po/$$lang.po \ + ../hello-php/po/$$lang.po + +subdir = examples/po +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/../config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DIST_COMMON = $(srcdir)/Makefile.in Makefile.am +all: all-am + +.SUFFIXES: +.SUFFIXES: .po .sed .sin .nop .po-update +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnits examples/po/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile all-local + +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-info-am + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool distclean distclean-generic distclean-libtool \ + distdir dvi dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ + uninstall-info-am + + +.sin.sed: + sed -e '/^#/d' $< > t-$@ + mv t-$@ $@ + +all-local: all-local-@USE_NLS@ + +all-local-yes: stamp-po +all-local-no: + +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot + @echo "touch stamp-po" + @echo timestamp > stamp-poT + @mv stamp-poT stamp-po + +# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', +# otherwise packages like GCC can not be built if only parts of the source +# have been downloaded. + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +$(DOMAIN).pot-update: $(POTFILES_DEPS) $(SMALLPOTS) remove-potcdate.sed + $(XGETTEXT) --default-domain=$(DOMAIN) \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' \ + $(SMALLPOTS) + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +hello-c.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c + +hello-c-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c-gnome + +hello-c++.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++ + +hello-c++-qt.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-qt + +hello-c++-kde.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-kde + +hello-c++-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-c++-gnome + +hello-objc.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc + +hello-objc-gnustep.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc-gnustep + +hello-objc-gnome.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-objc-gnome + +hello-sh.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-sh + +hello-python.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-python + +hello-clisp.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-clisp + +hello-librep.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-librep + +hello-smalltalk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-smalltalk + +hello-java.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java + +hello-java-awt.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java-awt + +hello-java-swing.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-java-swing + +hello-gawk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-gawk + +hello-pascal.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-pascal + +hello-ycp.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-ycp + +hello-tcl.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-tcl + +hello-tcl-tk.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-tcl-tk + +hello-perl.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-perl + +hello-php.pot : $(POTFILES_DEPS) + $(SHELL) xsmallpot.sh hello-php + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot + +html ID: + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + $(MAKE) $(SMALLPOFILES_FOR_lang) LL=$$lang; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +../hello-c/po/$(LL).po: hello-c.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c $(LL) + +../hello-c-gnome/po/$(LL).po: hello-c-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c-gnome $(LL) + +../hello-c++/po/$(LL).po: hello-c++.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++ $(LL) + +../hello-c++-qt/po/$(LL).po: hello-c++-qt.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-qt $(LL) + +../hello-c++-kde/po/$(LL).po: hello-c++-kde.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-kde $(LL) + +../hello-c++-gnome/po/$(LL).po: hello-c++-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-c++-gnome $(LL) + +../hello-objc/po/$(LL).po: hello-objc.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc $(LL) + +../hello-objc-gnustep/po/$(LL).po: hello-objc-gnustep.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc-gnustep $(LL) + +../hello-objc-gnome/po/$(LL).po: hello-objc-gnome.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-objc-gnome $(LL) + +../hello-sh/po/$(LL).po: hello-sh.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-sh $(LL) + +../hello-python/po/$(LL).po: hello-python.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-python $(LL) + +../hello-clisp/po/$(LL).po: hello-clisp.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-clisp $(LL) + +../hello-librep/po/$(LL).po: hello-librep.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-librep $(LL) + +../hello-smalltalk/po/$(LL).po: hello-smalltalk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-smalltalk $(LL) + +../hello-java/po/$(LL).po: hello-java.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java $(LL) + +../hello-java-awt/po/$(LL).po: hello-java-awt.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java-awt $(LL) + +../hello-java-swing/po/$(LL).po: hello-java-swing.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-java-swing $(LL) + +../hello-gawk/po/$(LL).po: hello-gawk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-gawk $(LL) + +../hello-pascal/po/$(LL).po: hello-pascal.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-pascal $(LL) + +../hello-ycp/po/$(LL).po: hello-ycp.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-ycp $(LL) + +../hello-tcl/po/$(LL).po: hello-tcl.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-tcl $(LL) + +../hello-tcl-tk/po/$(LL).po: hello-tcl-tk.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-tcl-tk $(LL) + +../hello-perl/po/$(LL).po: hello-perl.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-perl $(LL) + +../hello-php/po/$(LL).po: hello-php.pot $(LL).po + $(SHELL) mmsmallpo.sh hello-php $(LL) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gettext-tools/examples/po/de.po b/gettext-tools/examples/po/de.po new file mode 100644 index 0000000..3635729 --- /dev/null +++ b/gettext-tools/examples/po/de.po @@ -0,0 +1,77 @@ +# German translations for gettext-examples package +# German messages for gettext-examples. +# Copyright (C) 2003 Yoyodyne, Inc. +# This file is distributed under the same license as the gettext-examples package. +# Bruno Haible <bruno@clisp.org>, 2003. +# +msgid "" +msgstr "" +"Project-Id-Version: gettext-examples\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:44+0100\n" +"PO-Revision-Date: 2003-11-15 01:25+0100\n" +"Last-Translator: Bruno Haible <bruno@clisp.org>\n" +"Language-Team: German <de@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello-c/hello.c:31 hello-c-gnome/hello.c:47 hello-c++/hello.cc:40 +#: hello-c++-qt/hello.cc:46 hello-c++-kde/hellowindow.cc:42 +#: hello-c++-gnome/hello.cc:51 hello-objc/hello.m:31 +#: hello-objc-gnustep/Hello.m:50 hello-objc-gnome/hello.m:48 +#: hello-sh/hello.sh:15 hello-python/hello.py.in:13 +#: hello-clisp/hello.lisp.in:12 hello-librep/hello.jl.in:13 +#: hello-smalltalk/hello.st.in:19 hello-java/Hello.java:15 +#: hello-java-awt/Hello.java:24 hello-java-swing/Hello.java:21 +#: hello-gawk/hello.awk:12 hello-pascal/hello.hello_world +#: hello-ycp/hello.ycp:16 hello-tcl/hello.tcl:12 hello-tcl-tk/hello.tcl:14 +#: hello-perl/hello.pl:14 hello-php/hello.php:13 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello-c/hello.c:32 hello-c-gnome/hello.c:52 hello-c++/hello.cc:41 +#: hello-c++-gnome/hello.cc:56 hello-objc/hello.m:32 +#: hello-objc-gnustep/Hello.m:59 hello-objc-gnome/hello.m:53 +#: hello-librep/hello.jl.in:15 hello-gawk/hello.awk:13 +#: hello-pascal/hello.running_as hello-tcl/hello.tcl:13 +#: hello-tcl-tk/hello.tcl:17 hello-perl/hello.pl:16 hello-php/hello.php:15 +#, php-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." + +#: hello-c++-qt/hello.cc:53 hello-c++-kde/hellowindow.cc:49 +#: hello-smalltalk/hello.st.in:20 hello-ycp/hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." + +#: hello-c++-kde/hello.cc:46 +msgid "Hello example" +msgstr "Beispiel Hallo" + +#: hello-c++-kde/hello.cc:48 +msgid "Hello world example" +msgstr "Beispiel Hallo-Welt" + +#: hello-sh/hello.sh:18 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dieses Programm läuft mit der Prozess-Nummer $pid." + +#: hello-python/hello.py.in:14 +#, python-format +msgid "This program is running as process number %(pid)d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %(pid)d." + +#: hello-clisp/hello.lisp.in:14 +#, lisp-format +msgid "This program is running as process number ~D." +msgstr "Dieses Programm läuft mit der Prozess-Nummer ~D." + +#: hello-java/Hello.java:19 hello-java-awt/Hello.java:29 +#: hello-java-swing/Hello.java:26 +#, java-format +msgid "This program is running as process number {0}." +msgstr "Dieses Programm läuft mit der Prozess-Nummer {0}." diff --git a/gettext-tools/examples/po/gettext-examples.pot b/gettext-tools/examples/po/gettext-examples.pot new file mode 100644 index 0000000..67288c1 --- /dev/null +++ b/gettext-tools/examples/po/gettext-examples.pot @@ -0,0 +1,76 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: bug-gnu-gettext@gnu.org\n" +"POT-Creation-Date: 2003-11-15 14:44+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: hello-c/hello.c:31 hello-c-gnome/hello.c:47 hello-c++/hello.cc:40 +#: hello-c++-qt/hello.cc:46 hello-c++-kde/hellowindow.cc:42 +#: hello-c++-gnome/hello.cc:51 hello-objc/hello.m:31 +#: hello-objc-gnustep/Hello.m:50 hello-objc-gnome/hello.m:48 +#: hello-sh/hello.sh:15 hello-python/hello.py.in:13 +#: hello-clisp/hello.lisp.in:12 hello-librep/hello.jl.in:13 +#: hello-smalltalk/hello.st.in:19 hello-java/Hello.java:15 +#: hello-java-awt/Hello.java:24 hello-java-swing/Hello.java:21 +#: hello-gawk/hello.awk:12 hello-pascal/hello.hello_world +#: hello-ycp/hello.ycp:16 hello-tcl/hello.tcl:12 hello-tcl-tk/hello.tcl:14 +#: hello-perl/hello.pl:14 hello-php/hello.php:13 +msgid "Hello, world!" +msgstr "" + +#: hello-c/hello.c:32 hello-c-gnome/hello.c:52 hello-c++/hello.cc:41 +#: hello-c++-gnome/hello.cc:56 hello-objc/hello.m:32 +#: hello-objc-gnustep/Hello.m:59 hello-objc-gnome/hello.m:53 +#: hello-librep/hello.jl.in:15 hello-gawk/hello.awk:13 +#: hello-pascal/hello.running_as hello-tcl/hello.tcl:13 +#: hello-tcl-tk/hello.tcl:17 hello-perl/hello.pl:16 hello-php/hello.php:15 +#, php-format +msgid "This program is running as process number %d." +msgstr "" + +#: hello-c++-qt/hello.cc:53 hello-c++-kde/hellowindow.cc:49 +#: hello-smalltalk/hello.st.in:20 hello-ycp/hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "" + +#: hello-c++-kde/hello.cc:46 +msgid "Hello example" +msgstr "" + +#: hello-c++-kde/hello.cc:48 +msgid "Hello world example" +msgstr "" + +#: hello-sh/hello.sh:18 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "" + +#: hello-python/hello.py.in:14 +#, python-format +msgid "This program is running as process number %(pid)d." +msgstr "" + +#: hello-clisp/hello.lisp.in:14 +#, lisp-format +msgid "This program is running as process number ~D." +msgstr "" + +#: hello-java/Hello.java:19 hello-java-awt/Hello.java:29 +#: hello-java-swing/Hello.java:26 +#, java-format +msgid "This program is running as process number {0}." +msgstr "" diff --git a/gettext-tools/examples/po/mmsmallpo.sh b/gettext-tools/examples/po/mmsmallpo.sh new file mode 100755 index 0000000..6f36bbd --- /dev/null +++ b/gettext-tools/examples/po/mmsmallpo.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Usage: mmsmallpo.sh hello-foo ll + +set -e + +test $# = 2 || { echo "Usage: mmsmallpo.sh hello-foo ll" 1>&2; exit 1; } +directory=$1 +language=$2 + +msgmerge $language.po $directory.pot -o - | \ +msgattrib --no-obsolete | \ +sed -e "s, $directory/, ,g" | sed -e "s,gettext-examples,$directory," \ + > ../$directory/po/$language.po diff --git a/gettext-tools/examples/po/remove-potcdate.sin b/gettext-tools/examples/po/remove-potcdate.sin new file mode 100644 index 0000000..2436c49 --- /dev/null +++ b/gettext-tools/examples/po/remove-potcdate.sin @@ -0,0 +1,19 @@ +# Sed script that remove the POT-Creation-Date line in the header entry +# from a POT file. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/gettext-tools/examples/po/stamp-po b/gettext-tools/examples/po/stamp-po new file mode 100644 index 0000000..9788f70 --- /dev/null +++ b/gettext-tools/examples/po/stamp-po @@ -0,0 +1 @@ +timestamp diff --git a/gettext-tools/examples/po/xsmallpot.sh b/gettext-tools/examples/po/xsmallpot.sh new file mode 100755 index 0000000..1a8f1bb --- /dev/null +++ b/gettext-tools/examples/po/xsmallpot.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Usage: xsmallpot.sh hello-foo [hello-foobar.pot] + +set -e + +test $# = 1 || test $# = 2 || { echo "Usage: xsmallpot.sh hello-foo [hello-foobar.pot]" 1>&2; exit 1; } +directory=$1 +potfile=${2-$directory.pot} + +cd .. +rm -rf tmp-$directory +cp -p -r $directory tmp-$directory +cd tmp-$directory +case $directory in + hello-c++-kde) + ./autogen.sh + sed -e 's,tmp-,,' < configure.in > configure.ac + grep '^\(AC_INIT\|AC_CONFIG\|AM_INIT\|AM_CONDITIONAL\|AM_GNU_GETTEXT\|AM_NLS\|AM_PO_SUBDIRS\|AC_OUTPUT\)' configure.ac > configure.in + rm -f configure.ac + autoconf + ./configure + ;; + hello-objc-gnustep) + ./autogen.sh + ;; + *) + grep '^\(AC_INIT\|AC_CONFIG\|AM_INIT\|AM_CONDITIONAL\|AM_GNU_GETTEXT\|AM_NLS\|AM_PO_SUBDIRS\|AC_OUTPUT\)' configure.ac > configure.in + rm -f configure.ac + ./autogen.sh + ./configure + ;; +esac +cd po +make $potfile +sed -e "/^#:/ { +s, \\([^ ]\\), $directory/\\1,g +}" < $potfile > ../../po/$potfile +cd .. +cd .. +rm -rf tmp-$directory |