summaryrefslogtreecommitdiffstats
path: root/translate_toolkit
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-08-21 21:50:13 +0200
committerXisco Fauli <anistenis@gmail.com>2011-08-21 21:50:13 +0200
commit6c76e4db034fd2c43884698b1a30225fd00b3bfd (patch)
tree1937cb9be81cd2b9f3d0ad27adcc7a7531b8f29d /translate_toolkit
parentImplement partly the 5th step (diff)
parentunusedcode: CollatorWrapper (diff)
downloadcore-6c76e4db034fd2c43884698b1a30225fd00b3bfd.tar.gz
core-6c76e4db034fd2c43884698b1a30225fd00b3bfd.zip
Merge branch 'master' into feature/gsoc2011_wizards
Conflicts: automation/source/inc/cmdbasestream.hxx automation/source/server/cmdbasestream.cxx automation/source/server/retstrm.hxx automation/source/testtool/cmdstrm.cxx automation/source/testtool/cmdstrm.hxx automation/source/testtool/tcommuni.cxx basctl/prj/d.lst basctl/uiconfig/basicide/toolbar/findbar.xml cui/source/dialogs/about.cxx cui/source/dialogs/about.src cui/source/inc/about.hxx extensions/source/abpilot/abpservices.cxx extensions/source/dbpilots/dbpservices.cxx extensions/source/propctrlr/pcrservices.cxx extensions/source/svg/makefile.mk forms/Library_frm.mk lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx lingucomponent/source/spellcheck/spell/sspellimp.cxx package/prj/d.lst package/source/zipapi/XMemoryStream.cxx package/source/zipapi/XMemoryStream.hxx setup_native/prj/d.lst setup_native/source/win32/customactions/relnotes/makefile.mk tools/test/export.map wizards/com/sun/star/wizards/common/ConfigGroup.py wizards/com/sun/star/wizards/common/ConfigNode.py wizards/com/sun/star/wizards/common/Configuration.py wizards/com/sun/star/wizards/common/Desktop.py wizards/com/sun/star/wizards/common/FileAccess.py wizards/com/sun/star/wizards/common/Helper.py wizards/com/sun/star/wizards/common/SystemDialog.py wizards/com/sun/star/wizards/document/OfficeDocument.py wizards/com/sun/star/wizards/fax/FaxDocument.py wizards/com/sun/star/wizards/fax/FaxWizardDialog.py wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.py wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py wizards/com/sun/star/wizards/letter/LetterDocument.py wizards/com/sun/star/wizards/letter/LetterWizardDialog.py wizards/com/sun/star/wizards/letter/LetterWizardDialogConst.py wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py wizards/com/sun/star/wizards/text/TextDocument.py wizards/com/sun/star/wizards/text/TextFieldHandler.py wizards/com/sun/star/wizards/text/TextSectionHandler.py wizards/com/sun/star/wizards/text/ViewHandler.py wizards/com/sun/star/wizards/ui/UnoDialog.py wizards/com/sun/star/wizards/ui/UnoDialog2.py wizards/com/sun/star/wizards/ui/WizardDialog.py wizards/com/sun/star/wizards/ui/event/CommonListener.py wizards/com/sun/star/wizards/ui/event/DataAware.py wizards/com/sun/star/wizards/ui/event/RadioDataAware.py wizards/com/sun/star/wizards/ui/event/UnoDataAware.py wizards/util/helpids.h wizards/util/hidother.src xmlsecurity/prj/build.lst xmlsecurity/prj/d.lst xmlsecurity/qa/certext/SanCertExt.cxx
Diffstat (limited to 'translate_toolkit')
-rw-r--r--translate_toolkit/makefile.mk80
-rw-r--r--translate_toolkit/prj/build.lst3
-rw-r--r--translate_toolkit/prj/d.lst35
-rw-r--r--translate_toolkit/translate-toolkit-1.8.1-skipsource.patch99
4 files changed, 217 insertions, 0 deletions
diff --git a/translate_toolkit/makefile.mk b/translate_toolkit/makefile.mk
new file mode 100644
index 000000000000..b311001c4491
--- /dev/null
+++ b/translate_toolkit/makefile.mk
@@ -0,0 +1,80 @@
+#*************************************************************************
+#
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Petr Mladek <pmladek@suse.cz>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+# Ted <ted@bear.com>
+# Portions created by the Ted are Copyright (C) 2010 Ted. All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#
+#*************************************************************************
+
+PRJ=.
+
+PRJNAME=trt
+TARGET=trt
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+.IF "$(SYSTEM_TRANSLATE_TOOLKIT)" == "YES"
+@all:
+ @echo "Using system translate toolkit..."
+.ENDIF
+
+# --- Python paths --------------------------------------------------
+
+.IF "$(SYSTEM_PYTHON)" == "YES"
+PY_CMD=$(PYTHON)
+.ELSE # "$(SYSTEM_PYTHON)" == "YES"
+.IF "$(OS)"=="MACOSX"
+# the framework only gets delivered as zip, so call it from python's output-dir
+PY_CMD=$(SRC_ROOT)/python/$(INPATH)/misc/build/python-inst/OOoPython.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/OOoPython
+.ELSE
+PY_CMD=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/python
+# watch for the path delimiter
+.IF "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR);$(SOLARLIBDIR)/python;$(SOLARLIBDIR)/python/lib-dynload
+.ELSE # "$(GUI)"=="WNT"
+PYTHONPATH:=$(SOLARLIBDIR):$(SOLARLIBDIR)/python:$(SOLARLIBDIR)/python/lib-dynload
+.ENDIF # "$(GUI)"=="WNT"
+.EXPORT: PYTHONPATH
+.ENDIF # "$(OS)"=="MACOSX"
+.ENDIF # "$(SYSTEM_PYTHON)" == "YES"
+
+# --- Files --------------------------------------------------------
+
+TARFILE_NAME=translate-toolkit-1.8.1
+TARFILE_MD5=b4cae0700aa1c2aef7eb7f345365e6f1
+PATCH_FILES=translate-toolkit-1.8.1-skipsource.patch
+BUILD_ACTION=$(PY_CMD) setup.py build
+BUILD_DIR=
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : set_ext.mk
+.INCLUDE : target.mk
+.INCLUDE : tg_ext.mk
diff --git a/translate_toolkit/prj/build.lst b/translate_toolkit/prj/build.lst
new file mode 100644
index 000000000000..f87945c49ae6
--- /dev/null
+++ b/translate_toolkit/prj/build.lst
@@ -0,0 +1,3 @@
+trt translate_toolkit : solenv PYTHON:python NULL
+trt translate_toolkit usr1 - all trt_mkout NULL
+trt translate_toolkit nmake - all translate_toolkit NULL
diff --git a/translate_toolkit/prj/d.lst b/translate_toolkit/prj/d.lst
new file mode 100644
index 000000000000..31d61b0d507d
--- /dev/null
+++ b/translate_toolkit/prj/d.lst
@@ -0,0 +1,35 @@
+mkdir: %_DEST%\bin\translate
+mkdir: %_DEST%\bin\translate\convert
+mkdir: %_DEST%\bin\translate\filters
+mkdir: %_DEST%\bin\translate\lang
+mkdir: %_DEST%\bin\translate\misc
+mkdir: %_DEST%\bin\translate\misc\typecheck
+mkdir: %_DEST%\bin\translate\storage
+mkdir: %_DEST%\bin\translate\storage\placeables
+mkdir: %_DEST%\bin\translate\storage\versioncontrol
+mkdir: %_DEST%\bin\translate\storage\xml_extract
+mkdir: %_DEST%\bin\translate\search
+mkdir: %_DEST%\bin\translate\search\indexing
+mkdir: %_DEST%\bin\translate\services
+mkdir: %_DEST%\bin\translate\share
+mkdir: %_DEST%\bin\translate\share\langmodels
+mkdir: %_DEST%\bin\translate\tools
+
+..\%__SRC%\misc\build\translate-toolkit-*\translate\* %_DEST%\bin\translate\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\convert\* %_DEST%\bin\translate\convert\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\filters\* %_DEST%\bin\translate\filters\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\lang\* %_DEST%\bin\translate\lang\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\misc\* %_DEST%\bin\translate\misc\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\misc/typecheck\* %_DEST%\bin\translate\misc/typecheck\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\storage\* %_DEST%\bin\translate\storage\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\storage/placeables\* %_DEST%\bin\translate\storage/placeables\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\storage/versioncontrol\* %_DEST%\bin\translate\storage/versioncontrol\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\storage/xml_extract\* %_DEST%\bin\translate\storage/xml_extract\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\search\* %_DEST%\bin\translate\search\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\search/indexing\* %_DEST%\bin\translate\search/indexing\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\services\* %_DEST%\bin\translate\services\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\share\* %_DEST%\bin\translate\share\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\share\langmodels\* %_DEST%\bin\translate\share\langmodels\*
+..\%__SRC%\misc\build\translate-toolkit-*\translate\tools\* %_DEST%\bin\translate\tools\*
+..\%__SRC%\misc\build\translate-toolkit-*\build\scripts-*\oo2po %_DEST%\bin\*
+..\%__SRC%\misc\build\translate-toolkit-*\build\scripts-*\po2oo %_DEST%\bin\*
diff --git a/translate_toolkit/translate-toolkit-1.8.1-skipsource.patch b/translate_toolkit/translate-toolkit-1.8.1-skipsource.patch
new file mode 100644
index 000000000000..c4cd7a07b255
--- /dev/null
+++ b/translate_toolkit/translate-toolkit-1.8.1-skipsource.patch
@@ -0,0 +1,99 @@
+Index: convert/po2oo.py
+===================================================================
+--- misc/translate-toolkit-1.8.1/translate/convert/po2oo.py (revision 17314)
++++ misc/build/translate-toolkit-1.8.1/translate/convert/po2oo.py (working copy)
+@@ -188,7 +188,7 @@
+ filter = oocheckfilter(options, [checks.OpenOfficeChecker, checks.StandardUnitChecker], checks.openofficeconfig)
+
+
+-def convertoo(inputfile, outputfile, templatefile, sourcelanguage=None, targetlanguage=None, timestamp=None, includefuzzy=False, multifilestyle="single", filteraction=None):
++def convertoo(inputfile, outputfile, templatefile, sourcelanguage=None, targetlanguage=None, timestamp=None, includefuzzy=False, multifilestyle="single", skip_source=False, filteraction=None):
+ inputstore = factory.getobject(inputfile)
+ inputstore.filename = getattr(inputfile, 'name', '')
+ if not targetlanguage:
+@@ -205,7 +205,7 @@
+ convertor = reoo(templatefile, languages=languages, timestamp=timestamp, includefuzzy=includefuzzy, long_keys=multifilestyle != "single", filteraction=filteraction)
+ outputstore = convertor.convertstore(inputstore)
+ # TODO: check if we need to manually delete missing items
+- outputfile.write(str(outputstore))
++ outputfile.write(outputstore.__str__(skip_source, targetlanguage))
+ return True
+
+
+@@ -223,6 +223,7 @@
+ help="don't change the timestamps of the strings")
+ parser.add_option("", "--nonrecursiveoutput", dest="allowrecursiveoutput", default=True, action="store_false", help="don't treat the output oo as a recursive store")
+ parser.add_option("", "--nonrecursivetemplate", dest="allowrecursivetemplate", default=True, action="store_false", help="don't treat the template oo as a recursive store")
++ parser.add_option("", "--skipsource", dest="skip_source", default=False, action="store_true", help="don't output the source language, but fallback to it where needed")
+ parser.add_option("", "--filteraction", dest="filteraction", default="none", metavar="ACTION",
+ help="action on pofilter failure: none (default), warn, exclude-serious, exclude-all")
+ parser.add_fuzzy_option()
+@@ -230,6 +231,7 @@
+ parser.passthrough.append("sourcelanguage")
+ parser.passthrough.append("targetlanguage")
+ parser.passthrough.append("timestamp")
++ parser.passthrough.append("skip_source")
+ parser.passthrough.append("filteraction")
+ parser.run(argv)
+
+Index: convert/test_po2oo.py
+===================================================================
+--- misc/translate-toolkit-1.8.1/translate/convert/test_po2oo.py (revision 17280)
++++ misc/build/translate-toolkit-1.8.1/translate/convert/test_po2oo.py (working copy)
+@@ -170,6 +170,7 @@
+ options = self.help_check(options, "--nonrecursiveoutput")
+ options = self.help_check(options, "--nonrecursivetemplate")
+ options = self.help_check(options, "--filteraction")
++ options = self.help_check(options, "--skipsource")
+ options = self.help_check(options, "--fuzzy")
+ options = self.help_check(options, "--nofuzzy")
+ options = self.help_check(options, "-t TEMPLATE, --template=TEMPLATE")
+Index: storage/oo.py
+===================================================================
+--- misc/translate-toolkit-1.8.1/translate/storage/oo.py (revision 17301)
++++ misc/build/translate-toolkit-1.8.1/translate/storage/oo.py (working copy)
+@@ -246,9 +246,18 @@
+ """convert to a string. double check that unicode is handled"""
+ return encode_if_needed_utf8(self.getoutput())
+
+- def getoutput(self):
++ def getoutput(self, skip_source=False, fallback_lang=None):
+ """return the lines in tab-delimited form"""
+- return "\r\n".join([str(line) for line in self.lines])
++ if skip_source:
++ lines = self.lines[1:]
++ if not lines:
++ # Untranslated, so let's do fall-back: (bug 1883)
++ new_line = ooline(self.lines[0].getparts())
++ new_line.languageid = fallback_lang
++ lines = [new_line]
++ else:
++ lines = self.lines
++ return "\r\n".join([str(line) for line in lines])
+
+
+ class oofile:
+@@ -295,11 +304,11 @@
+ thisline = ooline(parts)
+ self.addline(thisline)
+
+- def __str__(self):
++ def __str__(self, skip_source=False, fallback_lang=None):
+ """convert to a string. double check that unicode is handled"""
+- return encode_if_needed_utf8(self.getoutput())
++ return encode_if_needed_utf8(self.getoutput(skip_source, fallback_lang))
+
+- def getoutput(self):
++ def getoutput(self, skip_source=False, fallback_lang=None):
+ """converts all the lines back to tab-delimited form"""
+ lines = []
+ for oe in self.units:
+@@ -307,7 +316,7 @@
+ warnings.warn("contains %d lines (should be 2 at most): languages %r" % (len(oe.lines), oe.languages))
+ oekeys = [line.getkey() for line in oe.lines]
+ warnings.warn("contains %d lines (should be 2 at most): keys %r" % (len(oe.lines), oekeys))
+- oeline = str(oe) + "\r\n"
++ oeline = oe.getoutput(skip_source, fallback_lang) + "\r\n"
+ lines.append(oeline)
+ return "".join(lines)
+