]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Add a pig farm.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 3 Mar 2012 15:17:21 +0000 (16:17 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 3 Mar 2012 15:17:21 +0000 (16:17 +0100)
ChangeLog
po/README
po/Rules-piglatin [new file with mode: 0644]
po/en@piglatin.header [new file with mode: 0644]
po/piglatin.sed [new file with mode: 0644]

index eb5b65c414e1fcb281b6873cc52ec53e1b82b688..0b06f7aca3dc483c97d479be335009388856beb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-03-03  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Add a pig farm.
+
+       * po/piglatin.sed: New file.
+       * po/en@piglatin.header: Likewise.
+       * po/Rules-piglatin: Likewise.
+       * po/README: Add en@piglatin to autogenerated languages.
+
 2012-03-03  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/commands/date.c (GRUB_MOD_INIT): Remove non-uniform
index 830f5f0b2fd1af1e7e6baf09fae2ccd90683887f..2fbde856b2cb40ab5bef0e3ccc876291a65d8a4e 100644 (file)
--- a/po/README
+++ b/po/README
@@ -10,7 +10,7 @@ that will hopefully clarify the situation.
 
     Then create a po/LINGUAS file listing all the language codes:
 
-      ((cd po && ls *.po| cut -d. -f1; echo "en@quot"; echo "de_CH") | sort |uniq |  xargs) >po/LINGUAS
+      ((cd po && ls *.po| cut -d. -f1; echo "en@quot"; echo "en@piglatin"; echo "de_CH") | sort |uniq |  xargs) >po/LINGUAS
 
     GRUB's build system will automatically detect those and include them
     in your install.
diff --git a/po/Rules-piglatin b/po/Rules-piglatin
new file mode 100644 (file)
index 0000000..891fd4b
--- /dev/null
@@ -0,0 +1,41 @@
+# Special Makefile rules for Pig Latin message catalogs with quotation marks.
+
+DISTFILES.common.extra3 = piglatin.sed en@piglatin.header insert-header.sin Rules-piglatin
+
+.SUFFIXES: .insert-header .po-update-en
+
+en@piglatin.po-create:
+       $(MAKE) en@piglatin.po-update
+
+en@piglatin.po-update: en@piglatin.po-update-en
+
+.insert-header.po-update-en:
+       @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+       if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+       tmpdir=`pwd`; \
+       echo "$$lang:"; \
+       ll=`echo $$lang | sed -e 's/@.*//'`; \
+       LC_ALL=C; export LC_ALL; \
+       cd $(srcdir); \
+       if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$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 "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+             exit 1; \
+           fi; \
+         fi; \
+       else \
+         echo "creation of $$lang.po failed!" 1>&2; \
+         rm -f $$tmpdir/$$lang.new.po; \
+       fi
+
+en@piglatin.insert-header: insert-header.sin
+       sed -e '/^#/d' -e 's/HEADER/en@piglatin.header/g' $(srcdir)/insert-header.sin > en@piglatin.insert-header
+
+mostlyclean: mostlyclean-piglatin
+mostlyclean-piglatin:
+       rm -f *.insert-header
diff --git a/po/en@piglatin.header b/po/en@piglatin.header
new file mode 100644 (file)
index 0000000..0da9654
--- /dev/null
@@ -0,0 +1,4 @@
+# This catalog in addition to fixing quoting like en@quot translates the
+# messages into Pig Latin. Can be useful for testing that all strings are
+# marked even before any translation is available or without knowing any
+# specific language besides English.
diff --git a/po/piglatin.sed b/po/piglatin.sed
new file mode 100644 (file)
index 0000000..041688c
--- /dev/null
@@ -0,0 +1,21 @@
+/^Project-Id-Version:/ b
+/^Report-Msgid-Bugs-To:/ b
+/^POT-Creation-Date:/ b
+/^PO-Revision-Date:/ b
+/^Last-Translator:/ b
+/^Language-Team:/ b
+/^Language:/ b
+/^MIME-Version:/ b
+/^Content-Type:/ b
+/^Content-Transfer-Encoding:/ b
+/^Plural-Forms:/ b
+
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+
+s,\(^\|[^a-zA-Z0-9%\\]\)\([aoeuiAOEUI]\)\([a-zA-Z]*\),\1\2\3way,g
+s,\(^\|[^a-zA-Z0-9%\\]\)\([bcdfghj-np-tvwxzBCDFGHJ-NP-TVWXZ][bcdfghj-np-tvwxzBCDFGHJ-NP-TVWXZ]*\)\([a-zA-Z]*\),\1\3\2ay,g