From: Bruno Haible Date: Mon, 23 Dec 2024 20:37:36 +0000 (+0100) Subject: examples: Don't fail build if rxgettext is not installed. X-Git-Tag: v0.24~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a1f4d365781fe4131d97583c21866b6bb125364;p=thirdparty%2Fgettext.git examples: Don't fail build if rxgettext is not installed. * gettext-tools/examples/po/xsmallpot.sh: Ignore a 'make' failure in the hello-ruby example. * gettext-tools/examples/po/hello-ruby.pot: New generated file. --- diff --git a/gettext-tools/examples/po/hello-ruby.pot b/gettext-tools/examples/po/hello-ruby.pot new file mode 100644 index 000000000..da5f8dc49 --- /dev/null +++ b/gettext-tools/examples/po/hello-ruby.pot @@ -0,0 +1,27 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Yoyodyne, Inc. +# This file is distributed under the same license as the hello-ruby package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-ruby 0\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"POT-Creation-Date: 2024-12-19 22:56+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: hello-ruby/hello.rb:7 +msgid "Hello, world!" +msgstr "" + +#: hello-ruby/hello.rb:8 +#, ruby-format +msgid "This program is running as process number %{pid}." +msgstr "" diff --git a/gettext-tools/examples/po/xsmallpot.sh b/gettext-tools/examples/po/xsmallpot.sh index 3af9ed7f7..ed5e642b4 100755 --- a/gettext-tools/examples/po/xsmallpot.sh +++ b/gettext-tools/examples/po/xsmallpot.sh @@ -73,10 +73,22 @@ EOF ;; esac cd po -make $potfile -sed -e "/^#:/ { +if make $potfile; then + sed -e "/^#:/ { s, \\([^ ]\\), $directory/\\1,g }" < $potfile > "$abs_srcdir"/$potfile +else + case $directory in + hello-ruby) + # Creating hello-ruby.pot fails if 'rxgettext' is not installed. + # To work around it, we are putting hello-ruby.pot under version control. + ;; + *) + echo "Failed to create $potfile." 1>&2 + exit 1 + ;; + esac +fi cd .. cd .. rm -rf tmp-$directory