[yum-commits] Makefile plugins/aliases po/da.po po/Makefile po/POTFILES.in po/yum-utils.pot yum-utils.spec

Tim Lauridsen timlau at osuosl.org
Thu Dec 30 13:49:36 UTC 2010


 Makefile                   |    4 +-
 plugins/aliases/aliases.py |   11 +++---
 po/Makefile                |   71 +++++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in             |   53 +++++++++++++++++++++++++++++++++
 po/da.po                   |   49 +++++++++++++++++++++++++++++++
 po/yum-utils.pot           |   46 +++++++++++++++++++++++++++++
 yum-utils.spec             |   17 ++++++++--
 7 files changed, 240 insertions(+), 11 deletions(-)

New commits:
commit cf90b17ec29ec32de54b32af23a938b71f2c05e0
Author: Tim Lauridsen <timlau at fedoraproject.org>
Date:   Thu Dec 30 13:53:23 2010 +0100

    Added translation support to yum-utils
    Added working translation to yum-plugin-aliases

diff --git a/Makefile b/Makefile
index 7e4b443..4a4afa0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS = docs
+SUBDIRS = docs po
 PKGNAME = yum-utils
 UTILS = package-cleanup debuginfo-install repoclosure repomanage repoquery repo-graph repo-rss yumdownloader yum-builddep repotrack reposync repodiff yum-debug-dump yum-debug-restore verifytree yum-groups-manager find-repos-of-install needs-restarting yum-config-manager show-installed
 UTILSROOT = yum-complete-transaction yumdb
@@ -67,7 +67,7 @@ release-tag:
 	@git push --tags origin
 
 install-builddeps:
-	su -c "yum install perl-TimeDate "
+	su -c "yum install perl-TimeDate python-devel gettext intltool rpmdevtools"
 	
 test-release:
 	@git checkout -b release-test
diff --git a/plugins/aliases/aliases.py b/plugins/aliases/aliases.py
index 71db86c..975b538 100644
--- a/plugins/aliases/aliases.py
+++ b/plugins/aliases/aliases.py
@@ -24,12 +24,11 @@ except:
     class CliError: # Never used by yumex
         pass
 
-#try: # $rand yum using python code don't have i18n
-#    from i18n import _
-#except:
-# i18n is now yum.i18n ... but need a real yum-utils i18n so just rm atm.
-if True:
-    def _(x): return x
+from kitchen.i18n import easy_gettext_setup
+
+# setup the translation wrappers
+
+_, P_  = easy_gettext_setup('yum-utils') 
 
 requires_api_version = '2.1'
 plugin_type = (TYPE_INTERACTIVE,)
diff --git a/po/Makefile b/po/Makefile
new file mode 100644
index 0000000..d002c52
--- /dev/null
+++ b/po/Makefile
@@ -0,0 +1,71 @@
+INSTALL= /usr/bin/install -c
+INSTALL_PROGRAM= ${INSTALL}
+INSTALL_DATA= ${INSTALL} -m 644
+INSTALLNLSDIR=$(DESTDIR)/usr/share/locale
+top_srcdir = "."
+
+
+MSGMERGE = intltool-update -x --gettext-package=$(NLSPACKAGE) --dist
+
+NLSPACKAGE = yum-utils
+
+CATALOGS = $(shell ls *.po)
+FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS))
+
+PYFILES  = $(wildcard ../*.py) $(wildcard ../plugins/*/*.py) 
+POTFILES  = $(PYFILES)
+
+all: $(NLSPACKAGE).pot $(FMTCATALOGS)
+
+POTFILES.in:
+	for file in $(POTFILES); do \
+		echo "$${file#../}" ; \
+	done > $@
+
+$(NLSPACKAGE).pot: $(POTFILES) POTFILES.in
+	intltool-update --gettext-package=$(NLSPACKAGE) --pot
+
+update-po: Makefile $(NLSPACKAGE).pot refresh-po
+
+refresh-po: Makefile POTFILES.in
+	catalogs='$(CATALOGS)'; \
+	for cat in $$catalogs; do \
+		lang=`basename $$cat .po`; \
+		cp $$lang.po $$lang.old.po; \
+		if $(MSGMERGE) $$lang ; then \
+			rm -f $$lang.old.po ; \
+			echo "$(MSGMERGE) of $$lang succeeded" ; \
+		else \
+			echo "$(MSGMERGE) of $$lang failed" ; \
+			mv $$lang.old.po $$lang.po ; \
+		fi \
+	done
+
+report:
+	@for cat in *.po ; do \
+		echo -n "$$cat: "; \
+		msgfmt --statistics -o /dev/null $$cat; \
+	done    
+
+clean:
+	@rm -fv *mo *~ .depend *.autosave
+   
+distclean: clean
+	rm -f *mo .depend Makefile $(NLSPACKAGE).pot POTFILES.in
+
+depend:
+
+install:	all
+	mkdir -p $(PREFIX)/$(INSTALLNLSDIR)
+	for n in $(CATALOGS); do \
+	    l=`basename $$n .po`; \
+	    mo=$$l.mo; \
+	    if [ ! -f $$mo ]; then continue; fi; \
+	    $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l; \
+	    $(INSTALL) -m 755 -d $(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES; \
+	    $(INSTALL) -m 644 $$mo \
+		$(PREFIX)/$(INSTALLNLSDIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \
+	done
+
+%.mo: %.po
+	msgfmt -o $@ $<
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..581da0a
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,53 @@
+yum-builddep.py
+yum-groups-manager.py
+yum-complete-transaction.py
+verifytree.py
+yum-debug-dump.py
+yum-debug-restore.py
+yumdownloader.py
+repoquery.py
+needs-restarting.py
+repodiff.py
+yum-config-manager.py
+repo-rss.py
+find-repos-of-install.py
+repo-check.py
+repomanage.py
+show-installed.py
+repoclosure.py
+package-cleanup.py
+repo-graph.py
+debuginfo-install.py
+reposync.py
+yumdb.py
+repotrack.py
+plugins/rpm-warm-cache/rpm-warm-cache.py
+plugins/upgrade-helper/upgrade-helper.py
+plugins/fastestmirror/fastestmirror.py
+plugins/ps/ps.py
+plugins/auto-update-debuginfo/auto-update-debuginfo.py
+plugins/show-leaves/show-leaves.py
+plugins/list-data/list-data.py
+plugins/downloadonly/downloadonly.py
+plugins/allowdowngrade/allowdowngrade.py
+plugins/tsflags/tsflags.py
+plugins/merge-conf/merge-conf.py
+plugins/aliases/aliases.py
+plugins/protectbase/protectbase.py
+plugins/versionlock/versionlock.py
+plugins/security/security.py
+plugins/nofsync/nofsync.py
+plugins/tmprepo/tmprepo.py
+plugins/priorities/priorities.py
+plugins/fs-snapshot/fs-snapshot.py
+plugins/remove-with-leaves/remove-with-leaves.py
+plugins/post-transaction-actions/post-transaction-actions.py
+plugins/local/local.py
+plugins/refresh-updatesd/refresh-updatesd.py
+plugins/filter-data/filter-data.py
+plugins/keys/keys.py
+plugins/changelog/changelog.py
+plugins/verify/verify.py
+plugins/kernel-module/kernel-module.py
+plugins/fedorakmod/fedorakmod.py
+plugins/basearchonly/basearchonly.py
diff --git a/po/da.po b/po/da.po
new file mode 100644
index 0000000..3029c06
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,49 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# Tim Lauridsen <timlau at fedoraproject.org>, 2010
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-12-30 13:46+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: Tim Lauridsen <timlau at fedoraproject.org>\n"
+"Language-Team: Danish <da at li.org>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../debuginfo-install.py:90
+#, python-format
+msgid "enabling %s"
+msgstr "aktivere %s"
+
+#: ../plugins/aliases/aliases.py:113
+#, python-format
+msgid "Can't open aliases file: %s"
+msgstr "Kan ikke finde filen med aliaser: %s"
+
+#: ../plugins/aliases/aliases.py:120
+#, python-format
+msgid ""
+"\n"
+"# Alias added on %s\n"
+"%s\n"
+msgstr ""
+"\n"
+"# Alias tilføjet på %s\n"
+"%s\n"
+
+#: ../plugins/aliases/aliases.py:128
+#, python-format
+msgid "%s, no match for %s"
+msgstr "%s, ingen match for %s"
+
+#: ../plugins/aliases/aliases.py:132 ../plugins/aliases/aliases.py:139
+#, python-format
+msgid "Alias %s = %s"
+msgstr "Alias %s = %s"
diff --git a/po/yum-utils.pot b/po/yum-utils.pot
new file mode 100644
index 0000000..ad15cfc
--- /dev/null
+++ b/po/yum-utils.pot
@@ -0,0 +1,46 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2010-12-30 13:46+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
+"Language-Team: LANGUAGE <LL at li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: ../debuginfo-install.py:90
+#, python-format
+msgid "enabling %s"
+msgstr ""
+
+#: ../plugins/aliases/aliases.py:113
+#, python-format
+msgid "Can't open aliases file: %s"
+msgstr ""
+
+#: ../plugins/aliases/aliases.py:120
+#, python-format
+msgid ""
+"\n"
+"# Alias added on %s\n"
+"%s\n"
+msgstr ""
+
+#: ../plugins/aliases/aliases.py:128
+#, python-format
+msgid "%s, no match for %s"
+msgstr ""
+
+#: ../plugins/aliases/aliases.py:132 ../plugins/aliases/aliases.py:139
+#, python-format
+msgid "Alias %s = %s"
+msgstr ""
diff --git a/yum-utils.spec b/yum-utils.spec
index 4ed0f09..2f19f04 100644
--- a/yum-utils.spec
+++ b/yum-utils.spec
@@ -8,8 +8,12 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz
 URL: http://yum.baseurl.org/download/yum-utils/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
-Requires: python >= 2.4 , yum >= 3.2.29
-BuildRequires: python >= 2.4
+Requires: yum >= 3.2.29
+Requires: python-kitchen
+BuildRequires: python-devel >= 2.4
+BuildRequires: gettext
+BuildRequires: intltool
+Provides: yum-utils-translations = %{version}-%{release}
 
 
 %description
@@ -184,6 +188,7 @@ Obsoletes: yum-aliases < 1.1.20-0
 Conflicts: yum-aliases < 1.1.20-0
 # Requires args_hook
 Requires: yum >= 3.2.23
+Requires: yum-utils-translations = %{version}-%{release}
 
 %description -n yum-plugin-aliases
 This plugin adds the command alias, and parses the aliases config. file to
@@ -367,6 +372,8 @@ rm -rf $RPM_BUILD_ROOT
 make DESTDIR=$RPM_BUILD_ROOT install
 make -C updateonboot DESTDIR=$RPM_BUILD_ROOT install
 
+%find_lang %name
+
 # Plugins to install
 plugins="\
  changelog \
@@ -411,6 +418,7 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d
 touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo
 
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -423,7 +431,7 @@ if [ $1 = 0 ]; then
     /sbin/chkconfig --del yum-updateonboot >/dev/null 2>&1 || :;
 fi
 
-%files
+%files -f %{name}.lang
 %defattr(-, root, root)
 %doc README yum-util-cli-template
 %doc COPYING
@@ -644,6 +652,9 @@ fi
 /usr/lib/yum-plugins/ps.*
 
 %changelog
+* Thu Dec 30 2010 Tim Lauridsen <timlau at fedoraproject.org>
+- Added Translation support and need Requires, BuildRequires 
+
 * Sun Nov 7 2010 Tim Lauridsen <timlau at fedoraproject.org>
 - mark as 1.1.29 
 


More information about the Yum-commits mailing list