From 20ed2dceefcf28a64148e1cd1266c31284e6e7af Mon Sep 17 00:00:00 2001 From: dwayne Date: Nov 26 2009 15:30:54 +0000 Subject: - Update to 1.5.1 - Support for OmegaT glossary files - Fixes for the fast (but still experimental) C PO parser - Fixes for the LRU cache - Fixes for correct and faster language identification - Update to 1.5.0 - The tmserver will now be multithreaded if cherrypy is installed - New faster PO parser for testing - Optionally preserve HTML comments in html2po. Bug #1183 - Many reliability and API improvements for the upcoming versions of Pootle and Virtaal - Move langmodels into /usr/share/translate-toolkit - Update to 1.4.1 - Better support for printf (including numbered) variables (bug 1118) - Fixes for the upcoming Pootle, including combined searches (bug 1036) - subtle bug in tmserver handling of the percent sign (%) (bug 1101) - obsolete messages seen as translatable (bug 1114) - Update to 1.4.0 final - Remove old excludes for /usr/bin/*.py{o,c} - Refresh poterminology patch - Rebuild using %{ix86} instead of i386 --- diff --git a/.cvsignore b/.cvsignore index 5718a9f..1cdc60d 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -translate-toolkit-1.2.0.tar.bz2 +translate-toolkit-1.5.1.tar.bz2 diff --git a/sources b/sources index a45a7cc..123ce65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f2e872c72898f1bc3afaa341affbfeb5 translate-toolkit-1.2.0.tar.bz2 +035bd0f56394d88e9f28f06fd33beaa2 translate-toolkit-1.5.1.tar.bz2 diff --git a/translate-toolkit-1.2.0-vobject.patch b/translate-toolkit-1.2.0-vobject.patch deleted file mode 100644 index 73fbc15..0000000 --- a/translate-toolkit-1.2.0-vobject.patch +++ /dev/null @@ -1,744 +0,0 @@ -Don't install any ical related converters since there is no python-vobject support -in EL-5 -diff -up translate-toolkit-1.2.0/setup.py.vobject translate-toolkit-1.2.0/setup.py -diff -up translate-toolkit-1.2.0/setup.py.vobject translate-toolkit-1.2.0/setup.py ---- translate-toolkit-1.2.0/setup.py.vobject 2008-10-06 16:25:51.000000000 +0200 -+++ translate-toolkit-1.2.0/setup.py 2008-11-16 16:48:51.000000000 +0200 -@@ -44,7 +44,6 @@ translatescripts = [apply(join, ('transl - ('convert', 'txt2po'), ('convert', 'po2txt'), - ('convert', 'ts2po'), ('convert', 'po2ts'), - ('convert', 'html2po'), ('convert', 'po2html'), -- ('convert', 'ical2po'), ('convert', 'po2ical'), - ('convert', 'ini2po'), ('convert', 'po2ini'), - ('convert', 'php2po'), ('convert', 'po2php'), - ('convert', 'rc2po'), ('convert', 'po2rc'), -diff -Nur translate-toolkit-1.2.0.ical/translate/convert/ical2po translate-toolkit-1.2.0/translate/convert/ical2po ---- translate-toolkit-1.2.0.ical/translate/convert/ical2po 2008-09-24 16:27:39.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/convert/ical2po 1970-01-01 02:00:00.000000000 +0200 -@@ -1,27 +0,0 @@ --#!/usr/bin/env python --# --# Copyright 2008 Zuza Software Foundation --# --# This file is part of translate. --# --# translate 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. --# --# translate 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 translate; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --"""simple script to convert an iCal file to a gettext .po localization file""" -- --from translate.convert import ical2po -- --if __name__ == '__main__': -- ical2po.main() -- -diff -Nur translate-toolkit-1.2.0.ical/translate/convert/ical2po.py translate-toolkit-1.2.0/translate/convert/ical2po.py ---- translate-toolkit-1.2.0.ical/translate/convert/ical2po.py 2008-09-24 16:27:39.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/convert/ical2po.py 1970-01-01 02:00:00.000000000 +0200 -@@ -1,106 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# Copyright 2007 Zuza Software Foundation --# --# This file is part of translate. --# --# translate 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. --# --# translate 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 translate; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --"""convert iCal files to Gettext PO localization files""" -- --import sys --from translate.storage import po --from translate.storage import xliff --from translate.storage import ical -- --class ical2po: -- """convert a iCal file to a .po file for handling the translation...""" -- def convertstore(self, theinifile, duplicatestyle="msgctxt"): -- """converts a iCal file to a .po file...""" -- thetargetfile = po.pofile() -- targetheader = thetargetfile.makeheader(charset="UTF-8", encoding="8bit") -- targetheader.addnote("extracted from %s" % theinifile.filename, "developer") -- thetargetfile.addunit(targetheader) -- for iniunit in theinifile.units: -- pounit = self.convertunit(iniunit, "developer") -- if pounit is not None: -- thetargetfile.addunit(pounit) -- thetargetfile.removeduplicates(duplicatestyle) -- return thetargetfile -- -- def mergestore(self, originifile, translatedinifile, blankmsgstr=False, duplicatestyle="msgctxt"): -- """converts two iCal files to a .po file...""" -- thetargetfile = po.pofile() -- targetheader = thetargetfile.makeheader(charset="UTF-8", encoding="8bit") -- targetheader.addnote("extracted from %s, %s" % (originifile.filename, translatedinifile.filename), "developer") -- thetargetfile.addunit(targetheader) -- translatedinifile.makeindex() -- for origini in originifile.units: -- origpo = self.convertunit(origini, "developer") -- # try and find a translation of the same name... -- origininame = "".join(origini.getlocations()) -- if origininame in translatedinifile.locationindex: -- translatedini = translatedinifile.locationindex[origininame] -- translatedpo = self.convertunit(translatedini, "translator") -- else: -- translatedpo = None -- # if we have a valid po unit, get the translation and add it... -- if origpo is not None: -- if translatedpo is not None and not blankmsgstr: -- origpo.target = translatedpo.source -- thetargetfile.addunit(origpo) -- elif translatedpo is not None: -- print >> sys.stderr, "error converting original iCal definition %s" % origini.name -- thetargetfile.removeduplicates(duplicatestyle) -- return thetargetfile -- -- def convertunit(self, inputunit, commenttype): -- """Converts a .ini unit to a .po unit. Returns None if empty -- or not for translation.""" -- if inputunit is None: -- return None -- # escape unicode -- pounit = po.pounit(encoding="UTF-8") -- pounit.addlocation("".join(inputunit.getlocations())) -- pounit.addnote(inputunit.getnotes("developer"), "developer") -- pounit.source = inputunit.source -- pounit.target = "" -- return pounit -- --def convertical(inputfile, outputfile, templatefile, pot=False, duplicatestyle="msgctxt"): -- """reads in inputfile using iCal, converts using ical2po, writes to outputfile""" -- inputstore = ical.icalfile(inputfile) -- convertor = ical2po() -- if templatefile is None: -- outputstore = convertor.convertstore(inputstore, duplicatestyle=duplicatestyle) -- else: -- templatestore = ical.icalfile(templatefile) -- outputstore = convertor.mergestore(templatestore, inputstore, blankmsgstr=pot, duplicatestyle=duplicatestyle) -- if outputstore.isempty(): -- return 0 -- outputfile.write(str(outputstore)) -- return 1 -- --def main(argv=None): -- from translate.convert import convert -- formats = {"ics": ("po", convertical), ("ics", "ics"): ("po", convertical)} -- parser = convert.ConvertOptionParser(formats, usetemplates=True, usepots=True, description=__doc__) -- parser.add_duplicates_option() -- parser.passthrough.append("pot") -- parser.run(argv) -- --if __name__ == '__main__': -- main() -diff -Nur translate-toolkit-1.2.0.ical/translate/convert/po2ical translate-toolkit-1.2.0/translate/convert/po2ical ---- translate-toolkit-1.2.0.ical/translate/convert/po2ical 2008-09-24 16:27:39.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/convert/po2ical 1970-01-01 02:00:00.000000000 +0200 -@@ -1,27 +0,0 @@ --#!/usr/bin/env python --# --# Copyright 2008 Zuza Software Foundation --# --# This file is part of translate. --# --# translate 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. --# --# translate 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 translate; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --"""simple script to convert a gettext .po localization file to an iCal file""" -- --from translate.convert import po2ical -- --if __name__ == '__main__': -- po2ical.main() -- -diff -Nur translate-toolkit-1.2.0.ical/translate/convert/po2ical.py translate-toolkit-1.2.0/translate/convert/po2ical.py ---- translate-toolkit-1.2.0.ical/translate/convert/po2ical.py 2008-09-24 16:27:39.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/convert/po2ical.py 1970-01-01 02:00:00.000000000 +0200 -@@ -1,72 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# Copyright 2002-2006 Zuza Software Foundation --# --# This file is part of translate. --# --# translate 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. --# --# translate 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 translate; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- --"""convert Gettext PO localization files to iCal files""" -- --from translate.storage import factory --from translate.storage import ical -- --class reical: -- def __init__(self, templatefile): -- self.templatefile = templatefile -- self.templatestore = ical.icalfile(templatefile) -- self.inputdict = {} -- -- def convertstore(self, inputstore, includefuzzy=False): -- self.makestoredict(inputstore, includefuzzy) -- for unit in self.templatestore.units: -- for location in unit.getlocations(): -- unit.target = self.inputdict[location] -- return str(self.templatestore) -- -- def makestoredict(self, store, includefuzzy=False): -- # make a dictionary of the translations -- for unit in store.units: -- if includefuzzy or not unit.isfuzzy(): -- # there may be more than one entity due to msguniq merge -- for location in unit.getlocations(): -- inistring = unit.target -- if len(inistring.strip()) == 0: -- inistring = unit.source -- self.inputdict[location] = inistring -- --def convertical(inputfile, outputfile, templatefile, includefuzzy=False): -- inputstore = factory.getobject(inputfile) -- if templatefile is None: -- raise ValueError("must have template file for iCal files") -- else: -- convertor = reical(templatefile) -- outputstring = convertor.convertstore(inputstore, includefuzzy) -- outputfile.write(outputstring) -- return 1 -- --def main(argv=None): -- # handle command line options -- from translate.convert import convert -- formats = {("po", "ics"): ("ics", convertical)} -- parser = convert.ConvertOptionParser(formats, usetemplates=True, description=__doc__) -- parser.add_fuzzy_option() -- parser.run(argv) -- --if __name__ == '__main__': -- main() -- -diff -Nur translate-toolkit-1.2.0.ical/translate/doc/user/toolkit-ical2po.html translate-toolkit-1.2.0/translate/doc/user/toolkit-ical2po.html ---- translate-toolkit-1.2.0.ical/translate/doc/user/toolkit-ical2po.html 2008-10-06 18:24:52.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/doc/user/toolkit-ical2po.html 1970-01-01 02:00:00.000000000 +0200 -@@ -1,214 +0,0 @@ -- -- -- -- -- -- -- -- -- -- -- --start
-- -- -- --

ical2po

--
-- --

-- --Converts iCalendar (*.ics) files to Gettext PO format. --

-- --

--

New in v1.2 --

--

-- --
-- --

Usage

--
--
ical2po [options] <ical> <po>
--po2ical [options] -t <ical> <po> <ical>
-- --

-- --Where: --

-- -- -- -- -- -- -- --
<ical> is a valid .ics file or directory of those files
<po> is a directory of PO or POT files
-- --

-- --Options (ical2po): --

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--version show program's version number and exit
-h, --help show this help message and exit
--manpage output a manpage based on the help
--progress=PROGRESS show progress as: dots, none, bar, names, verbose
--errorlevel=ERRORLEVEL show errorlevel as: none, message, exception, traceback
-i INPUT, --input=INPUT read from INPUT in php format
-x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths
-o OUTPUT, --output=OUTPUT write to OUTPUT in po, pot formats
-t TEMPLATE, --template=TEMPLATE read from TEMPLATE in php format
--psyco=MODE use psyco to speed up the operation, modes: none, full, profile
-P, --pot output PO Templates (.pot) rather than PO files (.po)
--duplicates=DUPLICATESTYLE what to do with duplicate strings (identical source text): merge, msgid_comment, msgctxt, keep, msgid_comment_all (default: 'msgctxt')
-- --

-- --Options (po2ical): --

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--version show program's version number and exit
-h, --help show this help message and exit
--manpage output a manpage based on the help
--progress=PROGRESS show progress as: dots, none, bar, names, verbose
--errorlevel=ERRORLEVEL show errorlevel as: none, message, exception, traceback
-i INPUT, --input=INPUT read from INPUT in po, pot formats
-x EXCLUDE, --exclude=EXCLUDE exclude names matching EXCLUDE from input paths
-o OUTPUT, --output=OUTPUT write to OUTPUT in php format
-t TEMPLATE, --template=TEMPLATE read from TEMPLATE in php format
--psyco=MODE use psyco to speed up the operation, modes: none, full, profile
--fuzzy use translations marked fuzzy
--nofuzzy don't use translations marked fuzzy (default)
-- --
-- --

Examples

--
-- --

-- --This example looks at roundtrip of iCalendar translations. While you can do recovery of translations, its unlikely that you will ever need to do that. --

-- --

--First we need to create a set of POT files. -- --

--
ical2po -P ical.ics ical.pot
-- --

-- --The ical.ics file is converted to Gettext POT files called ical.pot. Directories of iCalendar files can also be processed. --

-- --

--Begin translating the ical.pot file by first copying it to make a PO file. -- --

--
cp ical.pot ical-af.po
-- --

-- --You are now in a position to translate the file ical-af.po in your favourite translation tool. --

-- --

--Once translated you can convert back as follows: -- --

--
po2ical -t ical.ics ical-af.po ical-af.ics
-- --

-- --Your translations found in the Afrikaans PO file, ical-ad.po, will be converted to .ics using the file ical.ics as a template and creating your newly translated .ics file ical-af.ics. --

-- --

--To update your translations simply redo the POT creation step and make use of pot2po to bring your translation up-to-date. --

-- --
-- --

Notes

--
-- --

-- --The converter will only process events in the calender file, the file itself can contain many other things that could be localisable. Please raise a bug if you want to extract additional items. --

-- --

--The converter does not make use of the LANGUAGE attribute which is permitted in the format. The LANGUAGE attribute does not aid multilingualism in this context so is ignored. --

-- --

--The converter could conceivably also process vCard files, but this has not been implemented for lack of a clear need. Please raise a bug with an example if you have such a file that could benefit from localisation. --

-- --
-- --

Bugs

--
-- --

-- --None known -- --

-- --
-- -- -diff -Nur translate-toolkit-1.2.0.ical/translate/doc/user/toolkit-ical.html translate-toolkit-1.2.0/translate/doc/user/toolkit-ical.html ---- translate-toolkit-1.2.0.ical/translate/doc/user/toolkit-ical.html 2008-10-06 18:24:52.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/doc/user/toolkit-ical.html 1970-01-01 02:00:00.000000000 +0200 -@@ -1,126 +0,0 @@ -- -- -- -- -- -- -- -- -- -- -- --start
-- -- -- --

iCalendar

--
-- --

-- --Support for iCalendar (*.ics) files. This allows calendars to be localised. --

-- --

--The format extracts certain properties from VEVENT objects. The properties are limited to textual entries that would need to be localised, it does not include entries such as dates and durations that would indeed change for various locales. --

-- --
-- --

Resources

--
-- -- --
-- --

Conformance

--
-- --

-- --We are not creating iCal files, simply extracting localisable information and rebuilding the file. We rely on VObject to ensure correctness. --

-- --

--The following data is extracted: -- --

-- -- --

-- --No other sections are extracted. --

-- --
-- --

Notes

--
-- --
-- --

LANGUAGE: not a multilingual solution

--
-- --

-- --It is possible to set the language attribute on an entry e.g. -- --

--
SUMMARY:LANGUAGE=af;New Year's Day
-- --

-- --However since only one SUMMARY entry is allowed this does not allow you to specify multiple entries which would allow a single multilingual file. With that in mind it is not clear why the LANGUAGE attribute is allowed, the examples they give are for LOCATION entries but that is still not clearly useful. --

-- --
-- --

Broken Lotus Notes

--
-- --

-- --Lotus notes creates broken iCalendar files. They include _ (underscore) is some of the property names, [A-Z0-9\-] are the only valid chars. Therefore, we require vobject >= v0.6.5 (but there is unfortunately no way to check for the version of vobject). See vobject bug #12008 for further details. --

-- --
-- --

Development Notes

--
-- --

-- --If we use LANGUAGE at all it will be to ensure that we specify that an entry is in a given language. --

-- --
-- -- -diff -Nur translate-toolkit-1.2.0.ical/translate/storage/ical.py translate-toolkit-1.2.0/translate/storage/ical.py ---- translate-toolkit-1.2.0.ical/translate/storage/ical.py 2008-09-27 09:15:16.000000000 +0200 -+++ translate-toolkit-1.2.0/translate/storage/ical.py 1970-01-01 02:00:00.000000000 +0200 -@@ -1,130 +0,0 @@ --#!/usr/bin/env python --# -*- coding: utf-8 -*- --# --# Copyright 2007-2008 Zuza Software Foundation --# --# This file is part of translate. --# --# translate 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. --# --# translate 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 translate; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- --"""Class that manages iCalender files for translation -- -- Implementation -- ============== -- iCalendar files follow the U{RFC2445} -- specification. -- -- The iCalendar specification uses the following naming conventions: -- - Component: an event, journal entry, timezone, etc -- - Property: a property of a component: summary, description, start time, etc -- - Attribute: an attribute of a property, e.g. language -- -- The following are localisable in this implementation: -- - VEVENT component: SUMMARY, DESCRIPTION, COMMENT and LOCATION properties -- -- While other items could be localised this is not seen as important until use -- cases arise. In such a case simply adjusting the component.name and -- property.name lists to include these will allow expanded localisation. -- -- LANGUAGE Attribute -- ------------------ -- While the iCalendar format allows items to have a language attribute this is -- not used. The reason being that for most of the items that we localise they -- are only allowed to occur zero or once. Thus 'summary' would ideally -- be present in multiple languages in one file, the format does not allow -- such multiple entries. This is unfortunate as it prevents the creation -- of a single multilingual iCalendar file. -- -- Future Format Support -- ===================== -- As this format used U{vobject} which -- supports various formats including U{vCard} -- it is possible to expand this format to understand those if needed. -- --""" --from translate.storage import base --from StringIO import StringIO --import re --import vobject -- -- --class icalunit(base.TranslationUnit): -- """An ical entry that is translatable""" -- def __init__(self, source=None, encoding="UTF-8"): -- self.location = "" -- if source: -- self.source = source -- super(icalunit, self).__init__(source) -- -- def addlocation(self, location): -- self.location = location -- -- def getlocations(self): -- return [self.location] -- --class icalfile(base.TranslationStore): -- """An ical file""" -- UnitClass = icalunit -- def __init__(self, inputfile=None, unitclass=icalunit): -- """construct an ical file, optionally reading in from inputfile.""" -- self.UnitClass = unitclass -- base.TranslationStore.__init__(self, unitclass=unitclass) -- self.units = [] -- self.filename = '' -- self._icalfile = None -- if inputfile is not None: -- self.parse(inputfile) -- -- def __str__(self): -- _outicalfile = self._icalfile -- for unit in self.units: -- for location in unit.getlocations(): -- match = re.match('\\[(?P.+)\\](?P.+)', location) -- for component in self._icalfile.components(): -- if component.name != "VEVENT": -- continue -- if component.uid.value != match.groupdict()['uid']: -- continue -- for property in component.getChildren(): -- if property.name == match.groupdict()['property']: -- property.value = unit.target -- -- if _outicalfile: -- return str(_outicalfile.serialize()) -- else: -- return "" -- -- def parse(self, input): -- """parse the given file or file source string""" -- if hasattr(input, 'name'): -- self.filename = input.name -- elif not getattr(self, 'filename', ''): -- self.filename = '' -- if hasattr(input, "read"): -- inisrc = input.read() -- input.close() -- input = inisrc -- if isinstance(input, str): -- input = StringIO(input) -- self._icalfile = vobject.readComponents(input).next() -- else: -- self._icalfile = vobject.readComponents(open(input)).next() -- for component in self._icalfile.components(): -- if component.name == "VEVENT": -- for property in component.getChildren(): -- if property.name in ('SUMMARY', 'DESCRIPTION', 'COMMENT', 'LOCATION'): -- newunit = self.addsourceunit(property.value) -- newunit.addnote("Start date: %s" % component.dtstart.value) -- newunit.addlocation("[%s]%s" % (component.uid.value, property.name)) diff --git a/translate-toolkit-1.2.1-stoplist.patch b/translate-toolkit-1.2.1-stoplist.patch new file mode 100644 index 0000000..e189687 --- /dev/null +++ b/translate-toolkit-1.2.1-stoplist.patch @@ -0,0 +1,12 @@ +diff -up translate-toolkit-1.2.1/translate/tools/poterminology.py.stoplist translate-toolkit-1.2.1/translate/tools/poterminology.py +--- translate-toolkit-1.2.1/translate/tools/poterminology.py.stoplist 2008-12-06 14:13:22.000000000 +0200 ++++ translate-toolkit-1.2.1/translate/tools/poterminology.py 2008-12-06 14:13:49.000000000 +0200 +@@ -413,7 +413,7 @@ def main(): + parser.stoprelist = [] + parser.stopfoldtitle = True + parser.stopignorecase = False +- parser.defaultstopfile = file_discovery.get_abs_data_filename('stoplist-en') ++ parser.defaultstopfile = '/usr/share/translate-toolkit/stoplist-en' + parser.add_option("-S", "--stopword-list", type="string", metavar="STOPFILE", + action="callback", callback=parse_stopword_file, + help="read stopword (term exclusion) list from STOPFILE (default %s)" % parser.defaultstopfile, diff --git a/translate-toolkit-1.5.0-langmodel_dir.patch b/translate-toolkit-1.5.0-langmodel_dir.patch new file mode 100644 index 0000000..36e6446 --- /dev/null +++ b/translate-toolkit-1.5.0-langmodel_dir.patch @@ -0,0 +1,13 @@ +diff -up translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir translate-toolkit-1.5.0/translate/lang/identify.py +diff -up translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir translate-toolkit-1.5.0/translate/lang/identify.py +--- translate-toolkit-1.5.0/translate/lang/identify.py.langmodel_dir 2009-11-24 16:33:22.000000000 +0200 ++++ translate-toolkit-1.5.0/translate/lang/identify.py 2009-11-24 16:34:36.000000000 +0200 +@@ -32,7 +32,7 @@ from ngram import NGram + + + class LanguageIdentifier(object): +- MODEL_DIR = get_abs_data_filename('langmodels') ++ MODEL_DIR = '/usr/share/translate-toolkit/langmodels' + """The directory containing the ngram language model files.""" + CONF_FILE = 'fpdb.conf' + """ diff --git a/translate-toolkit.spec b/translate-toolkit.spec index 554b8f3..ef365ff 100644 --- a/translate-toolkit.spec +++ b/translate-toolkit.spec @@ -1,31 +1,44 @@ %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: translate-toolkit -Version: 1.2.0 -Release: 2%{?dist} +Version: 1.5.1 +Release: 1%{?dist} Summary: Tools to assist with translation and software localization Group: Development/Tools License: GPLv2+ URL: http://translate.sourceforge.net/wiki/toolkit/index -Source0: http://downloads.sourceforge.net/translate/%{name}-%{version}.tar.bz2 +Source0: http://downloads.sourceforge.net/project/translate/Translate%20Toolkit/%{version}/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Patch0: translate-poterminology-stoplist.diff -Patch1: translate-toolkit-1.2.0-vobject.patch +# Fedora patches +Patch0: translate-toolkit-1.2.1-stoplist.patch +Patch1: translate-toolkit-1.5.0-langmodel_dir.patch + +# EL patches BuildArch: noarch BuildRequires: python-devel -# EL-5 has gettext = 0.14.6 +# The following are needed for man page generation +# gaupol not packaged for EL-5, sub2po not available +#BuildRequires: gaupol +BuildRequires: python-iniparse +BuildRequires: python-lxml +BuildRequires: python-simplejson +# python-vobject is not packaged for EL-5 +#BuildRequires: python-vobject +# EL-5 has gettext = 0.14.6. cPO and new fPO need libgettextpo which was introduced in +# 0.14.2. Some of the improvements since then won't work Requires: gettext # python-enchant is not yet built for EL-5, spell checking tests will be unavailable #Requires: python-enchant Requires: python-iniparse Requires: python-Levenshtein Requires: python-lxml -# python-psyco not packaged for EL-5 +# python-psyco is not packaged for EL-5 #Requires: python-psyco -# python-vobject not packaged for EL-5 +Requires: python-simplejson +# python-vobject is not packaged for EL-5, ical2po is unavailable #Requires: python-vobject @@ -38,13 +51,15 @@ Including: * Formats: * Core localization formats - XLIFF and Gettext PO * Other localization formats - TMX, TBX, Qt Linguist (.ts), - Java .properties, Wordfast TM + Java .properties, Wordfast TM, OmegaT glossary * Compiled formats: Gettext MO, Qt .qm - * Other formats - text, HTML, CSV, INI, wiki (MediaWiki, DokuWiki) + * Other formats - OpenDocument Format (ODF), text, HTML, CSV, INI, + wiki (MediaWiki, DokuWiki), iCal * Specialised - OpenOffice.org GSI/SDF, PHP, - Mozilla (.dtd, .properties, etc) - * Tools: count, search, debug, segment and extract terminology from - localization files. + Mozilla (.dtd, .properties, etc), Symbian, + Innosetup, tikiwiki, subtitles + * Tools: count, search, debug, segment and pretranslate localization + files. Extract terminology. Pseudo-localize * Checkers: validate translations with over 45 checks %package devel @@ -62,7 +77,7 @@ toolkit or to use the libraries in other localization tools. %prep %setup -q %patch0 -p1 -%patch1 -p1 -b .vobject +%patch1 -p1 -b .langmodel_dir %build @@ -73,11 +88,14 @@ toolkit or to use the libraries in other localization tools. rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +# Cleanup some applications that won't work because of missing dependencies +rm $RPM_BUILD_ROOT/%{_bindir}/{ical2po,po2ical,sub2po,po2sub} + # create manpages mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 for program in $RPM_BUILD_ROOT/%{_bindir}/*; do case $(basename $program) in - pocompendium|poen|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|lookupclient.py) + pocompendium|poen|pomigrate2|popuretext|poreencode|posplit|pocount|poglossary|lookupclient.py|tmserver|build_tmdb) ;; *) LC_ALL=C PYTHONPATH=. $program --manpage \ @@ -96,6 +114,8 @@ rm $RPM_BUILD_ROOT/%{python_sitelib}/translate/misc/README # Move data files to /usr/share mkdir $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit mv $RPM_BUILD_ROOT/%{python_sitelib}/translate/share/stoplist* $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit +mv $RPM_BUILD_ROOT/%{python_sitelib}/translate/share/langmodels $RPM_BUILD_ROOT/%{_datadir}/translate-toolkit +rmdir $RPM_BUILD_ROOT/%{python_sitelib}/translate/share %clean @@ -110,8 +130,6 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/* %{_datadir}/translate-toolkit %{python_sitelib}/translate* -%exclude %{_bindir}/*.pyc -%exclude %{_bindir}/*.pyo %files devel %defattr(-,root,root,-) @@ -119,6 +137,28 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Thu Nov 26 2009 Dwayne Bailey - 1.5.1-1 +- Update to 1.5.1 + - Support for OmegaT glossary files + - Fixes for the fast (but still experimental) C PO parser + - Fixes for the LRU cache + - Fixes for correct and faster language identification +- Update to 1.5.0 + - The tmserver will now be multithreaded if cherrypy is installed + - New faster PO parser for testing + - Optionally preserve HTML comments in html2po. Bug #1183 + - Many reliability and API improvements for the upcoming versions of Pootle and Virtaal +- Move langmodels into /usr/share/translate-toolkit +- Update to 1.4.1 + - Better support for printf (including numbered) variables (bug 1118) + - Fixes for the upcoming Pootle, including combined searches (bug 1036) + - subtle bug in tmserver handling of the percent sign (%) (bug 1101) + - obsolete messages seen as translatable (bug 1114) +- Update to 1.4.0 final +- Remove old excludes for /usr/bin/*.py{o,c} +- Refresh poterminology patch +- Rebuild using %%{ix86} instead of i386 + * Mon Nov 17 2008 Dwayne Bailey - 1.2.0-2 - Remove dependeny: python-enchant