diff --git a/Makefile.in b/Makefile.in index 89d5189eb..0b599f51b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,6 +41,8 @@ includedir = @includedir@ pkgdatadir = $(datadir)/`echo @PACKAGE_TARNAME@ | sed '$(transform)'` pkglibdir = $(libdir)/`echo @PACKAGE_TARNAME@/$(target_cpu)-$(platform) | sed '$(transform)'` +LINGUAS = ca + PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ @@ -153,7 +155,7 @@ include $(srcdir)/conf/$(target_cpu)-$(platform).mk ### General targets. -CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) +CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) po/*.mo pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk cat $(DEFSYMFILES) /dev/null \ @@ -237,7 +239,7 @@ build_env.mk: Makefile ) > $@ pkglib_BUILDDIR += config.h grub_script.tab.h -all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) +all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) $(foreach lang, $(LINGUAS), po/$(lang).mo) install: install-local @@ -301,6 +303,13 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \ done + $(foreach lang, $(LINGUAS), \ + $(SHELL) $(mkinstalldirs) $(DESTDIR)/$(datadir)/locale/$(lang)/LC_MESSAGES + @list='po/$(lang).mo'; \ + for file in $$list; do \ + if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ + $(INSTALL_DATA) $$dir$$file $(DESTDIR)/$(datadir)/locale/$(lang)/LC_MESSAGES/grub.mo; \ + done) $(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir) @list='$(info_INFOS)'; \ for file in $$list; do \ @@ -455,6 +464,16 @@ gensymlist.sh: gensymlist.sh.in config.status genkernsyms.sh: genkernsyms.sh.in config.status $(SHELL) ./config.status +po/messages.pot: po/POTFILES + xgettext --from-code=utf-8 --keyword=_ -f $< -o $@ + +po/*.po: po/messages.pot + msgmerge -U $@ po/messages.pot + +po/%.mo: po/%.po + $(MKDIR_P) $$(dirname $@) + msgfmt -c --statistics -o $@ $^ + .PHONY: all install install-strip uninstall clean mostlyclean distclean .PHONY: maintainer-clean info dvi dist check diff --git a/po/POTFILES b/po/POTFILES new file mode 100644 index 000000000..d99ec5449 --- /dev/null +++ b/po/POTFILES @@ -0,0 +1,2 @@ +# List of files which contain translatable strings. +util/i386/pc/grub-mkimage.c diff --git a/po/ca.po b/po/ca.po new file mode 100644 index 000000000..4213346d4 --- /dev/null +++ b/po/ca.po @@ -0,0 +1,20 @@ +# Copyright (C) 2009 Free Software Foundation, Inc +# This file is distributed under the same license as the GNU GRUB package. +# Robert Millan , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU GRUB\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-11-16 00:05+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Robert Millan \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: util/i386/pc/grub-mkimage.c:322 +#, c-format +msgid "Try ``%s --help'' for more information.\n" +msgstr "Proveu «%s --help» per a obtenir més informació.\n" diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 15168f8fa..86f480835 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -33,6 +33,10 @@ #include #include +#include +#include +#define _(str) gettext(str) + #define _GNU_SOURCE 1 #include @@ -315,7 +319,7 @@ static void usage (int status) { if (status) - fprintf (stderr, "Try ``grub-mkimage --help'' for more information.\n"); + fprintf (stderr, _("Try ``%s --help'' for more information.\n"), progname); else printf ("\ Usage: grub-mkimage [OPTION]... [MODULES]\n\ @@ -349,6 +353,8 @@ main (int argc, char *argv[]) progname = "grub-mkimage"; + textdomain ("grub"); + while (1) { int c = getopt_long (argc, argv, "d:p:m:c:o:hVv", options, 0);