From be75c98a06d569fbaa2d86f92676af961795d094 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Fri, 21 Oct 2011 01:28:48 +0100 Subject: Add the mdkconf patch --- po/.cvsignore | 1 - po/Makefile | 71 ----------------------------------------- po/xgettext_sh | 27 ---------------- po/xgettext_sh.py | 94 ------------------------------------------------------- 4 files changed, 193 deletions(-) delete mode 100644 po/.cvsignore delete mode 100644 po/Makefile delete mode 100644 po/xgettext_sh delete mode 100755 po/xgettext_sh.py (limited to 'po') diff --git a/po/.cvsignore b/po/.cvsignore deleted file mode 100644 index cd1f2c94..00000000 --- a/po/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.mo diff --git a/po/Makefile b/po/Makefile deleted file mode 100644 index 2ecae4f0..00000000 --- a/po/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -INSTALL= /usr/bin/install -c -INSTALL_PROGRAM= ${INSTALL} -INSTALL_DATA= ${INSTALL} -m 644 -INSTALLNLSDIR=/usr/share/locale - -MSGMERGE = msgmerge - -NLSPACKAGE = initscripts - -CATALOGS = $(shell ls *.po) -FMTCATALOGS = $(patsubst %.po,%.mo,$(CATALOGS)) - -POTFILES = /etc/ppp/ip* /etc/rc.d/init.d/* /etc/rc.d/rc /etc/rc.d/rc.* \ - $(shell ls /etc/sysconfig/network-scripts/* | grep -v ifcfg-) \ - /sbin/service /usr/sbin/sys-unconfig /etc/init/*.conf - -all: $(NLSPACKAGE).pot $(FMTCATALOGS) - -$(NLSPACKAGE).pot: - @echo "Please don't run 'make initscripts.pot unless you have a *FULL*, current install." - -new-pot-file-i-really-mean-it: $(POTFILES) - ./xgettext_sh.py $(POTFILES) > $(NLSPACKAGE).po - if cmp -s $(NLSPACKAGE).po $(NLSPACKAGE).pot; then \ - rm -f $(NLSPACKAGE).po; \ - else \ - mv $(NLSPACKAGE).po $(NLSPACKAGE).pot; \ - fi - -refresh-po: Makefile - catalogs='$(CATALOGS)'; \ - for cat in $$catalogs; do \ - lang=`echo $$cat | sed 's/.po//'`; \ - if $(MSGMERGE) $$lang.po $(NLSPACKAGE).pot > $$lang.pot ; then \ - mv -f $$lang.pot $$lang.po ; \ - echo "$(MSGMERGE) of $$lang succeeded" ; \ - else \ - echo "$(MSGMERGE) of $$lang failed" ; \ - rm -f $$lang.pot ; \ - fi \ - done - -update-po: $(NLSPACKAGE).pot Makefile refresh-po - -report: - @for cat in $(CATALOGS); do \ - echo -n "$$cat: "; \ - msgfmt -v --statistics -o /dev/null $$cat; \ - done - -clean: - rm -f *mo *.pyc - -distclean: clean - rm -f .depend Makefile - -depend: - -install: all - mkdir -p $(PREFIX)/$(INSTALLNLSDIR) - for n in $(CATALOGS); do \ - l=`basename $$n .po`; \ - mo=$$l.mo; \ - $(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/xgettext_sh b/po/xgettext_sh deleted file mode 100644 index a9f1f6de..00000000 --- a/po/xgettext_sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python - -# xgettext_sh -- extracts translatable strings from a shell script -# Copyright (C) 1999 Conectiva Consultoria e Desenvolvimento de Sistemas LTDA -# -# 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. - -from sys import path -if not '/usr/lib/conectiva/xgettext_sh' in path: - path[:0] = ['/usr/lib/conectiva/xgettext_sh'] - -from xgettext_sh import main - -if __name__ == '__main__': - main() diff --git a/po/xgettext_sh.py b/po/xgettext_sh.py deleted file mode 100755 index ac18593e..00000000 --- a/po/xgettext_sh.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/python -# sh_xgettext -# Arnaldo Carvalho de Melo -# Wed Mar 10 10:24:35 EST 1999 -# Copyright Conectiva Consultoria e Desenvolvimento de Sistemas LTDA -# -# 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 of the License, 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Changelog -# Mon May 31 1999 Wanderlei Antonio Cavassin -# * option --initscripts - - -from sys import argv -from string import find, split, strip -import re - -s = {} -pattern = re.compile('[ =]\$"') - -def xgettext(arq): - line = 0 - f = open(arq, "r") - while 1: - l = f.readline() - if not l: break - line = line + 1 - if l[0:1] == '#': continue - elif l[0:1] == '\n': continue - else: - for match in pattern.finditer(l): - pos = match.start() - p1 = l.find('"',pos) + 1 - p2 = p1+1 - while 1: - p2 = l.find('"',p2) - if p2 == -1: - p2 = p1 - break - if l[p2-1] == '\\': - p2 = p2 + 1 - else: - break - text = l[p1:p2] - #text = split(l[pos:], '"')[1] - if s.has_key(text): - s[text].append((arq, line)) - else: - s[text] = [(arq, line)] - f.close() - -def print_header(): - print 'msgid ""' - print 'msgstr ""' - print '"Project-Id-Version: \\n"' - print '"PO-Revision-Date: YYYY-MM-DD HH:MM TZO DST\\n"' - print '"Last-Translator: \\n"' - print '"Language-Team: \\n"' - print '"MIME-Version: 1.0\\n"' - print '"Content-Type: text/plain; charset=ISO-8859-1\\n"' - print '"Content-Transfer-Encoding: 8-bit\\n"\n' - -def print_pot(): - print_header() - - for text in s.keys(): - print '#:', - for p in s[text]: - print '%s:%d' % p, - if find(text, '%') != -1: - print '\n#, c-format', - print '\nmsgid "' + text + '"' - print 'msgstr ""\n' - -def main(): - for a in argv: - xgettext(a) - - print_pot() - -if __name__ == '__main__': - main() -- cgit v1.2.1