Commits

Anonymous committed f35bc21 Merge

CWS-TOOLING: integrate CWS txtl10n

Comments (0)

Files changed (42)

Add a comment to this file

helpcontent2/source/auxiliary/no_localization

Empty file added.

l10ntools/inc/lngmerge.hxx

                     const ByteString &rPrj , 
                     const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID );
 public:
-	LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in );
+	LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat );
 	~LngParser();
 
 	BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot );
Add a comment to this file

l10ntools/java/jpropex/java/SdfEntity.java

File contents unchanged.

l10ntools/prj/d.lst

 ..\scripts\localize %_DEST%\bin%_EXT%\localize
 ..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl
 ..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl
+..\scripts\tool\const.py %_DEST%\bin%_EXT%\const.py
+..\scripts\tool\l10ntool.py %_DEST%\bin%_EXT%\l10ntool.py
+..\scripts\tool\xtxex.py  %_DEST%\bin%_EXT%\xtxex.py
+..\scripts\tool\sdf.py %_DEST%\bin%_EXT%\sdf.py
+..\scripts\tool\xhtex.py %_DEST%\bin%_EXT%\xhtex.py
+..\scripts\tool\pseudo.py %_DEST%\bin%_EXT%\pseudo.py
+..\scripts\xtxex %_DEST%\bin%_EXT%\xtxex
+..\scripts\xhtex %_DEST%\bin%_EXT%\xhtex
 
 ..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx
 ..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx

l10ntools/scripts/tool/const.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# Pseudo const
+class _const:
+    class ConstError(TypeError): pass
+    def __setattr__(self, name, value):
+        if self.__dict__.has_key(name):
+            raise self.ConstError, "Can't rebind const(%s)"%name
+        self.__dict__[name] = value
+
+import sys
+sys.modules[__name__] = _const()
+
+

l10ntools/scripts/tool/l10ntool.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+from optparse import OptionParser
+from sdf import SdfData
+from pseudo import PseudoSet
+
+import sys
+import os
+import shutil
+
+class AbstractL10nTool:
+    _options            = {}
+    _args               = ""
+    _resource_type      = "" 
+    _source_language    = "en-US"
+   
+    ##### Implement these abstract methods
+
+    ##### Nameing scheme for the output files
+    def get_outputfile_format_str(self):
+        # filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path
+        #return "{path}/{fileNoExt}_{language}.{extension}"
+        return self._options.pattern
+
+    ################################# Merge single files ###########################################
+
+    ##### Merge a single file
+    def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata):
+        pass
+
+    ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here
+    def parse_file(self, filename):
+        return None
+
+    ################### Merge one big file containing all strings in all languages #################
+    def merge_one_big_file(self, inputfile, outputfilename, parsed_file_ref, lang, sdfdata):
+        pass
+
+    ################### Extract a single File ######################################################
+    def extract_file(self, inputfile):
+        pass
+    
+    ################################################################################################
+    
+    def format_outputfile(self, filename, language):
+        extension = filename[filename.rfind('.')+1:]
+        file = filename[:filename.rfind('.')]
+    
+        # Python 2.3.x friendly
+        return self.get_outputfile_format_str().replace('[', '%(').replace(']',')s') % \
+                { 'filename': filename, 'fileNoExt': file, 'language': language, 'extension': extension, 'path_prefix': self._options.path_prefix,
+                  'path_postfix': self._options.path_postfix, 'path': self.get_path() }
+
+        #return self.get_outputfile_format_str().replace('[', '{').replace(']','}').format(
+        #       filename=filename, fileNoExt=file, language=language, extension=extension, path_prefix=self._options.path_prefix,
+        #       path_postfix=self._options.path_postfix, path=self.get_path())
+
+    def get_path(self):
+        if self._options.outputfile.find('/') == -1:
+            return ""
+        else:
+            return self._options.outputfile[:self._options.outputfile.rfind('/')]
+            
+    def merge(self,  sdfdata):
+        langset,forcedset, foundset = PseudoSet(), PseudoSet() , PseudoSet()
+
+        if self._options.languages:       
+            langset = PseudoSet(self._options.languages)  
+        if self._options.forcedlanguages: 
+            forcedset = PseudoSet(self._options.forcedlanguages) 
+        if sdfdata.get_languages_found_in_sdf(): 
+            foundset = sdfdata.get_languages_found_in_sdf() 
+    
+        if self.has_multi_inputfiles(): 
+            filelist = self.read_inputfile_list()
+        else:
+            filelist = self._options.inputfile
+            
+        for inputfile in filelist:
+            ref = self.parse_file(inputfile)
+            # Don't write that files if there is no l10n present
+            if ((langset & foundset) - forcedset):  # all langs given and found in sdf without enforced 
+                [self.merge_file(inputfile,self.format_outputfile(inputfile, lang), ref, lang, False, sdfdata) for lang in ((langset & foundset) - forcedset)]
+            # Always write those files even if there is no l10n available
+            if forcedset: # all enforced langs
+                [self.merge_file(inputfile, self.format_outputfile(inputfile, lang), ref, lang, True, sdfdata)  for lang in forcedset]
+            # In case a big file have to be written
+            if ((langset & foundset) | forcedset): # all langs given ,found in sdf and enforced ones
+                self.merge_one_big_file(inputfile, self.format_outputfile(inputfile, lang), ref, ((langset & foundset) | forcedset), sdfdata)
+    
+    def has_multi_inputfiles(self): 
+        return self._options.inputfile[0] == '@'
+
+    def copy_file(self, inputfilename, outputfilename):
+        try:
+            shutil.copy(inputfilename, outputfilename)
+        except IOError:
+            print "ERROR: Can not copy file '" + inputfilename + "' to " + "'" + outputfilename + "'"
+            sys.exit(-1)
+    
+    def extract(self):
+        try:
+            f = open(self._options.outputfile, "w+")
+            f.write(self.extract_file(self._options.inputfile))
+        except IOError:
+            print "ERROR: Can not write file " + self._options.outputfile
+        else:
+            f.close()
+            
+    # Parse the common options
+    def parse_options(self):
+        parser = OptionParser()
+        parser.add_option("-i", "--inputfile",       dest="inputfile",       metavar="FILE", help="resource file to read"         )
+        parser.add_option("-o", "--outputfile",      dest="outputfile",      metavar="FILE", help="extracted sdf or merged file"  )
+        parser.add_option("-m", "--inputsdffile",    dest="input_sdf_file",  metavar="FILE", help="merge this sdf file"           )
+        parser.add_option("-x", "--pathprefix",      dest="path_prefix",     metavar="PATH", help=""                              )
+        parser.add_option("-y", "--pathpostfix",     dest="path_postfix",    metavar="PATH", help=""                              )
+        parser.add_option("-p", "--projectname",     dest="project_name",    metavar="NAME", help=""                              )
+        parser.add_option("-r", "--projectroot",     dest="project_root",    metavar="PATH", help=""                              )
+        parser.add_option("-f", "--forcedlanguages", dest="forcedlanguages", metavar="ISOCODE[,ISOCODE]", help="Always merge those langs even if no l10n is available for those langs" )
+        parser.add_option("-l", "--languages",       dest="languages",       metavar="ISOCODE[,ISOCODE]", help="Merge those langs if l10n is found for each")
+        parser.add_option("-s", "--pattern",         dest="pattern",         metavar="", help=""                                  )        
+        parser.add_option("-q", "--quiet",           action="store_true",    dest="quietmode", help="",default=False)
+        (self._options, self.args) = parser.parse_args()
+        
+        # -l "de,pr,pt-BR" => [ "de" , "pt" , "pt-BR" ]
+        parse_complex_arg = lambda arg: arg.split(",")
+        
+        if self._options.forcedlanguages: 
+            self._options.forcedlanguages = parse_complex_arg(self._options.forcedlanguages) 
+        if self._options.languages:       
+            self._options.languages = parse_complex_arg(self._options.languages) 
+        self.test_options()
+        
+    def __init__(self):
+        self.parse_options()
+        if self._options.input_sdf_file != None and len(self._options.input_sdf_file):
+            sdfdata = SdfData(self._options.input_sdf_file)
+            sdfdata.read()
+            self.merge(sdfdata)
+        else:
+            self.extract()
+
+    def make_dirs(self, filename):
+        dir = filename[:filename.rfind('/')]
+        if os.path.exists(dir):
+            if os.path.isfile(dir):
+                print "ERROR: There is a file '"+dir+"' where I want create a directory"
+                sys.exit(-1)
+            else:
+                return
+        else:
+            try:
+                os.makedirs(dir)
+            except IOError:
+                print "Error: Can not create dir " + dir
+                sys.exit(-1)
+            
+    def test_options(self):
+        opt = self._options
+        is_valid = lambda x: x != None and len(x) > 0
+        return  is_valid(opt.project_root) and is_valid(opt.project_name) and is_valid(opt.languages) and \
+                ( is_valid(opt.inputfile) and (( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or is_valid(opt.outputfile)) and \
+                ( ( is_valid(opt.input_sdf_file) and ( is_valid(opt.outputfile) or  ( is_valid(opt.path_prefix) and is_valid(opt.path_postfix) ) or \
+                ( is_valid(opt.inputfile) and is_valid(opt.outputFile)) ))))
+        print "Strange options ..."
+        sys.exit( -1 )
+                     
+    def read_inputfile_list(self):
+        if self.has_multi_inputfiles():
+            lines = []
+            try:
+                f = open(self._options.inputfile[1:], "r")
+                lines = [line.strip('\n') for line in f.readlines()]
+            except IOError:
+                print "ERROR: Can not read file list " + self._options.inputfile[2:]
+                sys.exit(-1)
+            else:
+                f.close()
+            return lines
+        
+    def get_filename_string(self, inputfile):
+        absfile = os.path.realpath(os.path.abspath(inputfile))
+        absroot = os.path.realpath(os.path.abspath(self._options.project_root)) 
+        return absfile[len(absroot)+1:].replace('/','\\')
+    

l10ntools/scripts/tool/pseudo.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+# to support macosx baseline machines from Cretaceous period 
+
+# incomplete set() class implementation of Python 2.4
+class PseudoSet:
+    _list = []
+   
+    def __str__(self):
+        return str(self._list)
+
+    def __init__(self, newlist=[]):
+        self._list = self._remove_dupes(newlist)
+
+    def __or__(self, other):
+        tmplist = []
+        if self._list != None and other != None:
+            tmplist.extend(self._list)
+            tmplist.extend(other)
+            return PseudoSet(self._remove_dupes(tmplist))
+        else:
+            print "__or__(None)"
+
+    def __sub__(self,other):
+        tmplist = []
+        if self._list != None and other != None:
+            tmplist.extend(self._list)
+            [tmplist.remove(key) for key in other if key in tmplist]
+        else:
+            print "__sub__(none)"
+        return PseudoSet(tmplist)
+
+    def __and__(self, other):
+        tmplist = []
+        if other != None and self._list != None:
+            [tmplist.append(key) for key in self._list if key in other]
+            return PseudoSet(tmplist)
+        else:
+            print "__and__(None)"
+                    
+    def __iter__(self):
+        return self._list.__iter__()
+    
+    def __items__(self):
+        return self._list.items()
+
+    def __keys__(self):
+        return keys(self._list)
+
+    def _remove_dupes(self, list):
+        tmpdict = {} 
+        for key in list:
+            tmpdict[key] = 1
+        return tmpdict.keys()
+
+# incomplete OrderedDict() class implementation 
+class PseudoOrderedDict(dict):
+    _keylist        = []
+    _valuelist      = []
+    
+    def __init__(self, defaults={}):
+        dict.__init__(self)
+        for n,v in defaults.items():
+            self[n] = v
+
+    def __setitem__(self, key, value):
+        self._keylist.append(key)
+        self._valuelist.append(value)
+        return dict.__setitem__(self, key, value)
+        
+    def __delattr__(self, key):
+        self._keylist.__delattr__(key)
+        self._valuelist.__delattr__(dict[key])
+        return dict.__delattr__(self, key)
+
+    def __delitem__(self, key):
+        self._keylist.__delitem__(key)
+        self._valuelist.__delitem__(dict[key])
+        return dict.__delitem__(self, key)
+        
+    def __iter__(self):
+        raise NotImplementedError("__iter__")
+    
+    def __iterkeys__(self):
+        return self._keylist
+    
+    def iteritems(self):
+        #return self._valuelist
+        return zip(self._keylist, self._valuelist)
+   
+    def items(self):
+        return zip(self._keylist,self._valuelist)
+
+    def __keys__(self):
+        return self._keylist
+
+    def keys(self):
+        return self._keylist
+
+    def __keysattr__(self):
+        return self._keylist
+    
+    def pop(self, key):
+        self._keylist.pop(key)
+        self._valuelist.pop(key)
+        return dict.__pop__(self, key)
+    
+    def popitem(self):
+        raise NotImplementedError("popitem")
+    
+def _testdriver_set():
+    list, list1 = [] ,[]
+    list.append("a")
+    list.append("b")
+    list.append("c")
+
+    list1.append("a")
+    list1.append("b")
+    list1.append("d")
+    list1.append("e")
+    list1.append("e")
+
+    if "a" in list:
+        print "YEAH!"
+
+    a = PseudoSet(list)
+    b = PseudoSet(list1)
+
+    print "a="+str(a)
+    print "b="+str(b)
+    print "a|b=" + str(a|b)
+    print "a="+str(a)
+    print "b="+str(b)
+    print "a&b=" + str(a&b)
+    print "a="+str(a)
+    print "b="+str(b)
+    print "a-b" + str(a-b)
+
+    for key in a:
+        print key
+
+def _testdriver_dict():
+    d = PseudoOrderedDict()
+    d["a"] = 1
+    d["b"] = 2
+    d["c"] = 3
+    d["d"] = 4
+    d["e"] = 5
+    d["f"] = 6
+
+    print "a="+str(d["a"])
+    print "e="+str(d["e"])
+    for key,value in d.iteritems():
+        print "d["+key+"]="+str(d[key])
+        print "key="+str(key)+" value="+str(value)
+
+    print "keys="+str(d.keys())
+
+#_testdriver_dict()

l10ntools/scripts/tool/sdf.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+from pseudo import PseudoSet,PseudoOrderedDict
+
+class SdfData:
+    _filename        = "";
+    _dict            = PseudoOrderedDict()
+    _languages_found = [];
+    
+    def __init__ (self, filename=""):
+        self._filename = filename
+    
+    def __getitem__(self, key):
+        if self._dict.has_key(key):
+            return self._dict[key]
+        else:
+            return None
+    
+    def has_key(self, key):
+        return self._dict.has_key(key)
+    
+    def __setitem__(self, key, value):
+        self._dict[key] = value
+    
+    def get_languages_found_in_sdf(self):
+        return PseudoSet(self._languages_found)
+
+    def read(self):
+        try:
+            f = open(self._filename, "r")
+            lines = [line.rstrip('\n') for line in f.readlines()] 
+        except IOError:
+            print "ERROR: Trying to read "+ self._filename
+            raise
+        else:
+            f.close()
+        for line in lines:        
+            entity = SdfEntity()
+            entity.set_properties(line)
+            self._dict[entity.get_id()] = entity
+            self._languages_found.append(entity.langid)
+
+    def write(self, filename):
+        try:
+            f = open(filename, "w+") 
+            for value in self._dict.itervalues():
+                #f.write( repr(value)+"\n" )
+                f.write(value + "\n")
+        except IOError:
+            print "ERROR: Trying to write " + filename
+            raise
+        else:
+            f.close()
+
+import sys
+class SdfEntity: 
+    # Sdf format columns
+    project         = ""
+    source_file     = ""
+    dummy1          = ""
+    resource_type   = ""
+    gid             = ""
+    lid             = ""
+    helpid          = ""
+    platform        = ""
+    dummy2          = ""
+    langid          = ""
+    text            = ""
+    helptext        = ""
+    quickhelptext   = ""
+    title           = ""
+    date            = ""
+    
+    import const
+    const._PROJECT_POS         = 0
+    const._SOURCE_FILE_POS     = 1
+    const._DUMMY1_POS          = 2
+    const._RESOURCE_TYPE_POS   = 3
+    const._GID_POS             = 4
+    const._LID_POS             = 5
+    const._HELPID_POS          = 6
+    const._PLATFORM_POS        = 7
+    const._DUMMY2_POS          = 8
+    const._LANGID_POS          = 9
+    const._TEXT_POS            = 10
+    const._HELPTEXT_POS        = 11
+    const._QUICKHELPTEXT_POS   = 12
+    const._TITLE_POS           = 13
+    const._DATE_POS            = 14
+        
+    def __init__(self, project="", source_file="", dummy1="", resource_type="", gid="", lid="", helpid="", platform="", dummy2="", langid="", 
+                       text="", helptext="", quickhelptext="", title="", date="2002-02-02 02:02:02"):
+        self.project        = project;
+        self.source_file    = source_file;
+        self.dummy1         = dummy1;
+        self.resource_type  = resource_type;
+        self.gid            = gid;
+        self.lid            = lid;
+        self.helpid         = helpid;
+        self.platform       = platform;
+        self.dummy2         = dummy2;
+        self.langid         = langid;
+        self.text           = text;
+        self.helptext       = helptext;
+        self.quickhelptext  = quickhelptext;
+        self.title          = title;
+        self.date           = date;
+
+    def set_properties(self, line):
+        splitted = line.split("\t")
+        if len(splitted) == 15:
+            self.project        = splitted[ self.const._PROJECT_POS ]             
+            self.source_file    = splitted[ self.const._SOURCE_FILE_POS ]     
+            self.dummy1         = splitted[ self.const._DUMMY1_POS ]         
+            self.resource_type  = splitted[ self.const._RESOURCE_TYPE_POS ] 
+            self.gid            = splitted[ self.const._GID_POS ]             
+            self.lid            = splitted[ self.const._LID_POS ]             
+            self.helpid         = splitted[ self.const._HELPID_POS ]         
+            self.platform       = splitted[ self.const._PLATFORM_POS ]         
+            self.dummy2         = splitted[ self.const._DUMMY2_POS ]         
+            self.langid         = splitted[ self.const._LANGID_POS ]         
+            self.text           = splitted[ self.const._TEXT_POS ]             
+            self.helptext       = splitted[ self.const._HELPTEXT_POS ]         
+            self.quickhelptext  = splitted[ self.const._QUICKHELPTEXT_POS ] 
+            self.title          = splitted[ self.const._TITLE_POS ]         
+            self.date           = splitted[ self.const._DATE_POS ]            
+
+    def get_file_id(self):
+        return self.project + "\\" + self.source_file
+    
+    def get_resource_path(self):
+            return self.source_file[0:self.source_file.rfind( "\\" )-1]
+    
+    def __str__(self):
+        return ''.join([self.project, "\t", self.source_file, "\t", self.dummy1, "\t", self.resource_type, "\t" , 
+            self.gid, "\t", self.lid, "\t", self.helpid, "\t", self.platform, "\t", self.dummy2, "\t" , self.langid, 
+            "\t", self.text, "\t", self.helptext, "\t", self.quickhelptext, "\t" , self.title, "\t", self.date ])
+    
+    def get_id(self):
+        return ''.join([self.project, self.gid, self.lid, self.source_file, self.resource_type, self.platform, self.helpid, self.langid])

l10ntools/scripts/tool/xhtex.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+from l10ntool import AbstractL10nTool
+from sdf import SdfEntity
+import sys
+import xml.dom.minidom
+
+class Xhtex(AbstractL10nTool):
+    _resource_type = "xht" 
+    _sdfdata       = ()
+    _lang          = ""
+   
+    # Extract methods
+    def extract_topic(self, list, inputfile):
+        topics = []
+        for elem in list:                        
+            if elem.childNodes[0].nodeType == elem.TEXT_NODE and len(elem.childNodes[0].data.strip()):
+                topics.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.childNodes[0].data, inputfile=inputfile))            
+        return topics
+            
+    def extract_title(self, list, inputfile):
+        titles = []
+        for elem in list:
+            if len(elem.getAttribute("title").strip()):
+                titles.append(self.prepare_sdf_line(id=elem.getAttribute("id").strip(), text=elem.getAttribute("title").strip(), inputfile=inputfile))
+        return titles
+    
+    # Merge methods
+    def merge_topic(self, list, sdfdata, lang, inputfilename, dom):
+        for elem in list:
+            if elem.childNodes[0].nodeType == elem.TEXT_NODE and elem.getAttribute("id").strip():
+                obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
+                if sdfdata[obj.get_id()]:
+                    elem.childNodes[0].data = str(sdfdata[obj.get_id()].text)  
+                
+    def merge_title(self, list, sdfdata, lang, inputfilename):
+        for elem in list:
+            obj = self.prepare_sdf_line(inputfile=inputfilename, lang=lang, id=elem.getAttribute("id").strip())
+            if elem.getAttribute("id").strip() and sdfdata[obj.get_id()]: 
+                elem.setAttribute("title", str(sdfdata[obj.get_id()].text))
+
+    # L10N tool       
+    def __init__(self):
+        AbstractL10nTool.__init__(self)
+        
+    def parse_file(self, filename):
+        document = ""
+        try:
+            f = open(filename, "r+")
+            document = f.read()
+        except IOError:
+            print "ERROR: Can not read file " + filename
+            sys.exit(-1)
+        else:
+            f.close()
+        return xml.dom.minidom.parseString(document)
+
+        
+    def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang,is_forced_lang, sdfdata):
+        if lang == "en-US":             
+            mod_outputfilename = outputfilename.replace("_en-US",'')            
+            self.make_dirs(mod_outputfilename)
+            self.copy_file(inputfilename, mod_outputfilename)
+            return
+        dom = parsed_file_ref.cloneNode(True)
+        #dom = self.parse_file(inputfilename)    # in case cloneNode is buggy just parse it always
+                
+        self.merge_topic(dom.getElementsByTagName("topic"), sdfdata, lang, inputfilename, dom)
+        self.merge_title(dom.getElementsByTagName("node"), sdfdata, lang, inputfilename)
+        self.merge_title(dom.getElementsByTagName("help_section"), sdfdata, lang, inputfilename)
+        self.make_dirs(outputfilename)
+        try:
+            f = open(outputfilename, "w+")
+            str = dom.toxml()
+            f.write(str)
+        except IOError:
+            print "ERROR: Can not write file " + outputfilename
+            sys.exit(-1)
+        else:
+            f.close()
+    
+    ##### Helper for parse-once-use-often like parsing a xml file is needed implement it here
+    def parse_file(self, filename):
+        document = ""
+        try:
+            f = open(filename,"r+")
+            document = f.read()
+        except IOError:
+            print "ERROR: Can not read file " + filename
+        else:
+            f.close()        
+        return xml.dom.minidom.parseString(document)
+    
+    ##### Extract a single File
+    def extract_file(self, inputfile):
+        sdf_data = []
+        dom = self.parse_file(inputfile)        
+        sdf_data.extend(self.extract_topic(dom.getElementsByTagName("topic"), inputfile))
+        sdf_data.extend(self.extract_title(dom.getElementsByTagName("help_section"), inputfile))
+        sdf_data.extend(self.extract_title(dom.getElementsByTagName("node"), inputfile))        
+        return ''.join([str(line)+"\n" for line in sdf_data])                      
+
+    def prepare_sdf_line(self, inputfile="", lang="" , id="" , text=""):
+        if lang == "":
+            lang = self._source_language
+        return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile),
+                         resource_type=self._resource_type, gid=id, lid="", langid=lang,text=text)
+        
+run = Xhtex()
+ 

l10ntools/scripts/tool/xtxex.py

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+from l10ntool import AbstractL10nTool
+from sdf import SdfEntity
+import sys
+import shutil 
+
+class Xtxex(AbstractL10nTool):
+    _resource_type       = "xtx" 
+       
+    def __init__(self):
+        AbstractL10nTool.__init__(self)
+        
+    def merge_file(self, inputfilename, outputfilename, parsed_file_ref, lang, is_forced_lang, sdfdata): 
+        # Special handling for en-US files
+        if lang == "en-US":             
+            mod_outputfilename = outputfilename.replace("_en-US",'')
+            self.copy_file(inputfilename, mod_outputfilename)
+            return      
+        # merge usual lang
+        sdfline = self.prepare_sdf_line(inputfilename,lang)
+        if sdfdata.has_key(sdfline.get_id()):
+            line = sdfdata[sdfline.get_id()].text.replace("\\n", '\n')
+            self.make_dirs(outputfilename)
+            try:
+                f = open(outputfilename, "w+")
+                f.write(line)
+            except IOError:
+                print "ERROR: Can not write file " + outputfilename
+                sys.exit(-1)
+            else:
+                f.close()
+            return        
+        # no sdf data found then copy en-US source file
+        if is_forced_lang:
+            self.copy_file(inputfilename, outputfilename)
+               
+    ##### Extract a single File
+    def extract_file(self, inputfile):
+        lines = []
+        try:
+            f = open(inputfile, "r")
+            lines = f.readlines()
+        except IOError:
+            print "ERROR: Can not open file " + inputfile
+            sys.exit(-1)
+        else:
+            f.close()
+        # remove legal header
+        lines = [line for line in lines if len(line) > 0 and not line[0] == '#']        
+        # escape all returns
+        lines = [line.replace('\n', "\\n") for line in lines]
+        line = ''.join(lines)
+        test = str(line)
+        if len(test.strip()):
+            sdf_entity = self.prepare_sdf_line(inputfile);
+            sdf_entity.text = line
+            return str(sdf_entity)
+        else:
+            return ""
+
+    def prepare_sdf_line(self, inputfile="", lang=""):
+        if lang == "":
+            lang = self._source_language
+        return SdfEntity(project=self._options.project_name, source_file=self.get_filename_string(inputfile),
+                          resource_type=self._resource_type, gid="none", lid="none", langid=lang,text="")
+         
+run = Xtxex()

l10ntools/scripts/xhtex

+#!/bin/sh
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+if [ x${SOLARENV}x = xx ]; then
+    echo No environment found, please use 'setsolar'
+exit 1
+fi
+
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
+    exec python  $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+else
+    exec python  $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
+fi
+

l10ntools/scripts/xtxex

+#!/bin/sh
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+if [ x${SOLARENV}x = xx ]; then
+    echo No environment found, please use 'setsolar'
+exit 1
+fi
+
+if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
+    exec python  $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+else
+    exec python  $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
+fi
+

l10ntools/source/cfglex.l

 	FILE *pFile;
 
 	pOutput = GetOutputFile( argc, argv );
-	if( !isQuiet() ){
-        fprintf( stdout, "\nCfgEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" );
-	    fprintf( stdout, "===================================================================================\n" );
-    }
 
     if ( !pOutput ) {
 		fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" );
 		fprintf( stdout, " FileIn:   Source files (*.src)\n" );
 		fprintf( stdout, " FileOut:  Destination file (*.*)\n" );
 		fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" );
-		fprintf( stdout, " -QQ: quiet output\n" );
         fprintf( stdout, " -e: Disable writing errorlog\n" );
 		fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" );
 		fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" );
 	nRetValue = GetError();
 	EndCfgExport();
 
-	if( !isQuiet() ){
-        fprintf( stdout, "\n===================================\n\n" );
-    }
     
     removeTempFile();
 /* return error level */
 	return nRetValue;
 }
 
-/*"<!--"[^"-->"]*"-->" {
-	bText = 0;
-	WorkOnTokenSet( COMMEND, yytext );
-}*/
-/*"<!"[^\-].*\>	{
-	bText = 0;
-	WorkOnTokenSet( CFG_TAG, yytext );
-}*/
+

l10ntools/source/cfgmerge.cxx

 BOOL bErrorLog;
 BOOL bForce;
 BOOL bUTF8;
-bool bQuiet;
 ByteString sPrj;
 ByteString sPrjRoot;
 ByteString sInputFileName;
 	bErrorLog       = TRUE;
 	bForce          = FALSE;
 	bUTF8           = TRUE;
-    bQuiet          = false;
     sPrj            = "";
 	sPrjRoot        = "";
 	sInputFileName  = "";
 			nState = STATE_FORCE;
 			bForce = TRUE;
 		}
-		else if ( sSwitch == "-QQ" ) {
-		    bQuiet = true;
-        }
         else if ( sSwitch == "-L" ) {
 			nState = STATE_LANGUAGES;
 		}
 	// command line is not valid
 	return NULL;
 }
-int isQuiet(){
-    if( bQuiet )    return 1;
-    else            return 0;
-}
 /*****************************************************************************/
 int InitCfgExport( char *pOutput , char* pFilename )
 /*****************************************************************************/
 		if ( !pFile ){
 			fprintf( stderr, "Error: Could not open file %s\n",
 				sInputFileName.GetBuffer());
-            exit( 13 );
+            exit( -13 );
         }
 		else {
 			// this is a valid file which can be opened, so
 //			printf("sFullEntry = %s\n",sFullEntry.GetBuffer());
             sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 );
 //            printf("sActFileName = %s\n",sActFileName.GetBuffer());    
-            if( !bQuiet )
-			    fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer());
 
 			sActFileName.SearchAndReplaceAll( "/", "\\" );
 
 		Error( sError );
 		delete pOutputStream;
 		pOutputStream = NULL;
-        exit( 13 );
+        exit( -13 );
 	}
 }
 

l10ntools/source/export.cxx

 BOOL bBreakWhenHelpText;
 BOOL bUnmerge;
 BOOL bUTF8;
-bool bQuiet;
 ByteString sPrj;
 ByteString sPrjRoot;
 ByteString sActFileName;
     Export::sForcedLanguages = "";
 	sTempFile = "";
 	pTempFile = NULL;
-    bQuiet = false;
 	USHORT nState = STATE_NON;
 	BOOL bInput = FALSE;
 
 		else if (sSwitch == "-p"  || sSwitch == "-P" ) {
 			nState = STATE_PRJ; // next token specifies the cur. project
 		}
-		else if (sSwitch == "-qq"  || sSwitch == "-QQ" ) {
-			bQuiet = true;  
-		}
 
 		else if (sSwitch == "-r"  || sSwitch == "-R" ) {
 			nState = STATE_ROOT; // next token specifies path to project root
 	return NULL;
 }
 /*****************************************************************************/
-int isQuiet(){
-/*****************************************************************************/
-   if( bQuiet ) return 1;
-   else         return 0;
-}
-/*****************************************************************************/
 int InitExport( char *pOutput , char* pFilename )
 /*****************************************************************************/
 {
 			// (e.g.: source\ui\src\menue.src)
 			sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 );
 
-			if( !bQuiet ) fprintf( stdout, "\nProcessing File %s ...\n", sOrigFile.GetBuffer());
 
 			sActFileName.SearchAndReplaceAll( "/", "\\" );
             sFile = sActFileName;

l10ntools/source/helpex.cxx

 ByteString sOutputFileX;
 ByteString sOutputFileY;
 ByteString sSDFFile;
-bool bQuiet;
 
 /*****************************************************************************/
 BOOL ParseCommandLine( int argc, char* argv[])
 	bUTF8 = TRUE;
 	sPrj = "";
 	sPrjRoot = "";
-	bQuiet = false;
     Export::sLanguages = "";
     Export::sForcedLanguages = "";
 
 			nState = STATE_ERRORLOG;
 			bErrorLog = FALSE;
 		}
-		else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) {
-            bQuiet = true;
-        }
         else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) {
 			nState = STATE_UTF8;
 			bUTF8 = TRUE;
 void Help()
 /*****************************************************************************/
 {
-	fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...][-QQ] -LF l1,l2 \n" );
+	fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...] -LF l1,l2 \n" );
 	fprintf( stdout, " Prj:      Project\n" );
 	fprintf( stdout, " PrjRoot:  Path to project root (..\\.. etc.)\n" );
 	fprintf( stdout, " FileIn:   Source file (*.lng)\n" );
 	fprintf( stdout, " FileOut:  Destination file (*.*)\n" );
 	fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" );
-	fprintf( stdout, " -QQ: quiet output\n" );
 	fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (en-US,fr,de...)\n" );
 	fprintf( stdout, "     A fallback language can be defined like this: l1=f1.\n" );
 	fprintf( stdout, "     f1, f2,... are also elements of (en-US,fr,de...)\n" );

l10ntools/source/helpmerge.cxx

 
     ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in );
 
-/*    DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US ));
-	aEntry.ToAbs();
-	String sFullEntry = aEntry.GetFull();
-	aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US ));
-	aEntry += DirEntry( rRoot_in );
-	ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding());
-	ByteString sActFileName(
-	sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding());
-
-	sActFileName.SearchAndReplaceAll( "/", "\\" );
-*/
 	XMLHashMap*  aXMLStrHM   = file->GetStrings();
 	LangHashMap* pElem;
 	XMLElement*  pXMLElement  = NULL;

l10ntools/source/lngex.cxx

 BOOL bErrorLog;
 BOOL bUTF8;
 BOOL bULF; // ULF = Unicode Language File
-bool bQuiet;
 ByteString sPrj;
 ByteString sPrjRoot;
 ByteString sOutputFile;
 	bErrorLog = TRUE;
 	bUTF8 = TRUE;
 	bULF = FALSE;
-    bQuiet = false;
 	sPrj = "";
 	sPrjRoot = "";
 	Export::sLanguages = "";
 		else if ( sSwitch == "-R" ) {
 			nState = STATE_ROOT; // next token specifies path to project root
 		}
-		else if ( sSwitch == "-QQ" ) {
-			bQuiet = true;
-		}
 		else if ( sSwitch == "-M" ) {
 			nState = STATE_MERGESRC; // next token specifies the merge database
 		}
 void Help()
 /*****************************************************************************/
 {
-	//fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-e][-b][-u][-NOUTF8][-ULF][-L l1,l2,...]\n" );
     fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-L l1,l2,...]\n" );
 	fprintf( stdout, " Prj:      Project\n" );
 	fprintf( stdout, " PrjRoot:  Path to project root (..\\.. etc.)\n" );
 	fprintf( stdout, " FileIn:   Source file (*.lng)\n" );
 	fprintf( stdout, " FileOut:  Destination file (*.*)\n" );
 	fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" );
-	fprintf( stdout, " -QQ: quite output\n" );
-	//fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" );
-	//fprintf( stdout, " -ULF: enables Unicode Language File format, leads to UTF8 encoded version of lng files" );
 	fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" );
 	fprintf( stdout, "     A fallback language can be defined like this: l1=f1.\n" );
 	fprintf( stdout, "     f1, f2,... are also elements of (de,en-US...)\n" );
 		Help();
 		return 1;
 	}
-	if( !bQuiet ){ 
-        fprintf( stdout, "\nUlfEx 1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" );
-	    fprintf( stdout, "=================================================================================\n" );
-        fprintf( stdout, "\nProcessing File %s ...\n", sInputFile.GetBuffer());
-    }else
-    {
         fprintf(stdout, ".");
         fflush( stdout ); 
-    }
 
 	if ( sOutputFile.Len()) {
-		LngParser aParser( sInputFile, bUTF8, bULF , bQuiet );
+		LngParser aParser( sInputFile, bUTF8, bULF );
 		if ( bMergeMode )
 			aParser.Merge( sMergeSrc, sOutputFile , sPrj );
 		else
 			aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot );
 	}
 
-	if( !bQuiet ) fprintf( stdout, "\n=================================================\n\n" );
-
 	return 0;
 }

l10ntools/source/lngmerge.cxx

 // class LngParser
 //
 /*****************************************************************************/
-LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in )
+LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat )
 /*****************************************************************************/
 				:
 				nError( LNG_OK ),
 				pLines( NULL ),
                 sSource( rLngFile ),
 				bDBIsUTF8( bUTF8 ),
-				bULF( bULFFormat ),
-                bQuiet( bQuiet_in )
+				bULF( bULFFormat )
 {
 	pLines = new LngLineList( 100, 100 );
 	DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US ));

l10ntools/source/localize.cxx

 const char *ExeTable[][5] = {
 	{ "src", "transex3", "  -UTF8 -e", "negative", "noiso" },
 	{ "hrc", "transex3", "  -UTF8 -e", "positive", "noiso" },
-	//{ "src", "transex3", "-UTF8 -e", "negative", "noiso" },
-	//{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" },
-
-	//{ "lng", "lngex", "-UTF8 -e", "negative", "noiso" },
+	{ "tree", "xhtex", "", "negative", "noiso" },
+	{ "xtx", "xtxex", "", "negative", "noiso" },
 	{ "ulf", "ulfex", " -e", "negative", "noiso" },
 	{ "xrb", "xmlex", "-UTF8 -e", "negative", "iso" },
 	{ "xxl", "xmlex", "-UTF8 -e", "negative", "iso" },
 	ByteString sLanguageRestriction;
    
 	ByteString sOutputFile;
-	bool bQuiet2;
 
     int nFileCnt;
     
 	);
 
 public:
-	SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool bQuiet2_in , bool skip_links );
+	SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool skip_links );
 	~SourceTreeLocalizer();
     
     ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand );
 
 /*****************************************************************************/
 SourceTreeLocalizer::SourceTreeLocalizer(
-	const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool bQuiet2_in , bool skip_links )
+	const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool skip_links )
 /*****************************************************************************/
 				: SourceTreeIterator( rRoot, rVersion , bLocal_in ),
 				nMode( LOCALIZE_NONE ),
-                bQuiet2( bQuiet2_in ),
                 nFileCnt( 0 )
 {
         bSkipLinks  = skip_links ;
 		sCommand += getSourceLanguages( sLanguageRestriction , sCommand );
 	    }
             
-	    if( bQuiet2 ){
-                sCommand +=" -QQ ";
-            }
             //printf("DBG: %s\n",sCommand.GetBuffer());
             if (system(sCommand.GetBuffer()) == -1)
                 fprintf(stderr, "%s failed\n", sCommand.GetBuffer());
 {
 	ByteString rDirectory( rtl::OUStringToOString( aDirectory , RTL_TEXTENCODING_UTF8 , aDirectory.getLength() ) ) ;
 	if ( nMode == LOCALIZE_NONE ){
-		if( !bQuiet2 ) fprintf( stdout, "%s\n", rDirectory.GetBuffer());
     }
 	else
 		WorkOnDirectory( rDirectory );
 	ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
 
 	ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US );
-	if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer());
 
 	ULONG nIndex = 0;
 	ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US );
 			sCommand += " -l ";
 			sCommand += sLanguageRestriction;
 		}
-        if( bQuiet2 ){
-            sCommand +=" -QQ ";
-        }
 
 		DirEntry aPath( aEntry.GetPath());
 		DirEntry aOldCWD;
 			fprintf(stderr, "%s failed\n", sCommand.GetBuffer());
         nFileCnt++;
         printf(".");
-        //if( bQuiet2 ){ printf("."); }
         SvFileStream aInStream( aOut.GetFull(), STREAM_READ );
 		if ( !aInStream.IsOpen()) {
 			fprintf( stderr, 
 	fprintf( stdout,
 		"As part of the L10N framework, localize extracts and merges translations\n"
 		"out of and into the whole source tree.\n\n"
-		"Syntax: localize -e -l en-US -f FileName [-QQ]\n"
+		"Syntax: localize -e -l en-US -f FileName \n"
 		"Parameter:\n"
 		"\t-e: Extract mode\n"
 		"\tFileName: Output file when extract mode, input file when merge mode\n"
 		"\tl1...ln: supported languages (\"all\" for all languages).\n"
-        "\tQQ: quiet output)"
 	);
 
 	fprintf( stdout,
 
 	BOOL bExport    = FALSE;
 	BOOL bMerge     = FALSE;
-	bool bQuiet     = false;
-    bool bQuiet2    = false; 
 	bool bSkipLinks = false;
     
 	ByteString sLanguages;
 	ByteString sFileName;
 	ByteString sOutput;
 
-    bQuiet2 = true; 
     bExport = TRUE;
 
 	for( int i = 1; i < argc; i++ ) {
 				return Error();
 			bExport = TRUE;
 		}
-		else if( sSwitch.Equals( "-Q" )) {
-			bQuiet = true;
-		}
 		else if ( sSwitch.Equals( "-I" ) )
 			nState = STATE_ISOCODE;
 		else if ( sSwitch.Equals( "-L" ) )
 			nState = STATE_LANGUAGES;
 		else if ( sSwitch.Equals( "-F" ) )
 			nState = STATE_FILENAME;
-        else if ( sSwitch.Equals( "-QQ" ))
-            bQuiet2 = true;
 		else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) )
 			nState = STATE_OUTPUT;
 		else {
         else
             curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter;
         cout << "Localizing repository " << curRepository << "\n";
-        SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks );
+        SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks );
         aIter.SetLanguageRestriction( sLanguages );	 
         if ( bExport ){
-            if( bQuiet2 ){ /*printf("");*/fflush( stdout );}
+            fflush( stdout );
             if( *iter == "ooo" )
                 aIter.Extract( sFileName );
             else
                 sFileNameWithExt += ByteString( (*iter).c_str() );
                 aIter.Extract( sFileNameWithExt );
             }
-            if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());}
+            printf("\n%d files found!\n",aIter.GetFileCnt());
         }
     }
     if( hasPwd )
         string pwd;
         Export::getCurrentDir( pwd );
         cout << "Localizing repository " << pwd << "\n";
-        SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks );
+        SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bSkipLinks );
         aIter.SetLanguageRestriction( sLanguages );	 
         if ( bExport ){
-            if( bQuiet2 ){ /*printf("");*/fflush( stdout );}
+            fflush( stdout );
             aIter.Extract( sFileName );
-            if( bQuiet2 ){ printf("\n%d files found!\n",aIter.GetFileCnt());}
+            printf("\n%d files found!\n",aIter.GetFileCnt());
         }
  
     }

l10ntools/source/srclex.l

 	FILE *pFile;
     
 	pOutput = GetOutputFile( argc, argv );
-	if( !isQuiet() ){ 
-        fprintf( stdout, "\nTransEx 3.1 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" );
-	    fprintf( stdout, "=====================================================================================\n" );
-    }
 
     if ( !pOutput ) {
 		fprintf( stdout, "Syntax:TRANSEX[-p Prj][-r PrjRoot]-i FileIn...[-o FileOut][-m DataBase][-e][-b][-u][-L l1,l2,...]\n" );
 	nRetValue = GetError();
 	EndExport();
 
-	if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); 
-
 	/* return error level */
 	return nRetValue;
 }

l10ntools/source/xrmlex.l

 	FILE *pFile;
 
 	pOutput = GetOutputFile( argc, argv );
-    if( !isQuiet() ){
-        fprintf( stdout, "\nXrmEx 0.9 Copyright 2000, 2010 Oracle and/or its affiliates. All Rights Reserved.\n" );
-	    fprintf( stdout, "===================================================================================\n" );
-    }
 
 	if ( !pOutput ) {
 		fprintf( stdout, "Syntax: XRMEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-NOUTF8][-L l1,l2,...]\n" );
 	nRetValue = GetError();
 	EndXrmExport();
 
-	if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" );
     removeTempFile();
 	/* return error level */
 	return nRetValue;

l10ntools/source/xrmmerge.cxx

 BOOL bMergeMode;
 BOOL bErrorLog;
 BOOL bUTF8;
-bool bQuiet;
 ByteString sPrj;
 ByteString sPrjRoot;
 ByteString sInputFileName;
 	sInputFileName = "";
 	sActFileName = "";
 	Export::sLanguages = "";
-    bQuiet = false;
 	USHORT nState = STATE_NON;
 	BOOL bInput = FALSE;
 
 		else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-M" ) {
 			nState = STATE_MERGESRC; // next token specifies the merge database
 		}
-		else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) {
-		    bQuiet = true;
-        }
         else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-E" ) {
 			nState = STATE_ERRORLOG;
 			bErrorLog = FALSE;
 	return 1;
 }
 
-int isQuiet(){
-    if( bQuiet )    return 1;
-    else            return 0;
-}
 /*****************************************************************************/
 int EndXrmExport()
 /*****************************************************************************/
 			// (e.g.: source\ui\src\menue.src)
 			sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 );
 
-			if( !bQuiet ) 
-                fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer());
 
 			sActFileName.SearchAndReplaceAll( "/", "\\" );
 

solenv/inc/_tg_srs.mk

 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 
 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 

solenv/inc/rules.mk

 	@echo "Making:   " $(@:f)
     $(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
-	$(COMMAND_ECHO)$(ULFEX) $(ULFEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(ULFEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 

solenv/inc/settings.mk

     .IF "$(VERBOSE)" == "FALSE"
         VERBOSITY=-quiet
         ZIP_VERBOSITY=-q
-        TRANSEX_VERBOSITY=-QQ
-        CFGEX_VERBOSITY=-QQ
-        ULFEX_VERBOSITY=-QQ
     .ENDIF
 .ENDIF # "$(VERBOSE)" == "TRUE"
 COMPILE_ECHO_SWITCH=

solenv/inc/target.mk

 .ENDIF			# "$(LASTRUN_MERGED)"=="TRUE"
     $(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
-	$(COMMAND_ECHO)$(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:b:+"_tmpl")$(@:e) -o $(@:d)/$(@:b:+"_tmpl")$(@:e).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(TRANSEX) -p $(PRJNAME) -i $(@:b:+"_tmpl")$(@:e) -o $(@:d)/$(@:b:+"_tmpl")$(@:e).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $(@:d)$(@:b:+"_tmpl")$(@:e).$(INPATH) $@
 
 .ENDIF			# "$(WITH_LANG)"==""
 
 .INCLUDE : tg_merge.mk
 .INCLUDE : tg_propmerge.mk
+.INCLUDE : tg_xmerge.mk
 
 wordcount:
 	wc *.* >> $(TMP)/wc.lst

solenv/inc/tg_config.mk

 
 $(PROCESSOUT)/merge/$(PACKAGEDIR)/%.xcu : %.xcu
 	@-$(MKDIRHIER) $(@:d)
-	$(COMMAND_ECHO)$(CFGEX) $(CFGEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(CFGEX)  -p $(PRJNAME) -i $(@:f) -o $@ -m $(LOCALIZESDF) -l all
 
 .IF "$(XCU_LANG)" != ""
 $(XCU_LANG) : $(XSLDIR)/alllang.xsl

solenv/inc/tg_help.mk

 
 $(COMMONMISC)$/$(TARGET).done : $(HLANGXHPFILES)
 .IF "$(WITH_LANG)"!=""
-	$(AUGMENT_LIBRARY_PATH) $(HELPEX) -QQ -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(COMMONMISC) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
+	$(AUGMENT_LIBRARY_PATH) $(HELPEX)  -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(COMMONMISC) -y $(SHELL_PACKAGE) -l all -lf $(aux_alllangiso:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
 .ELSE			# "$(WITH_LANG)"!=""
 	cp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES)))) $(COMMONMISC)$/en-US$/$(SHELL_PACKAGE) && $(TOUCH) $@
 .ENDIF			# "$(WITH_LANG)"!=""

solenv/inc/tg_srs.mk

 	$(COMMAND_ECHO)-$(MKDIR) $(@:d)
     $(COMMAND_ECHO)-$(RM) $@
 	$(COMMAND_ECHO)-$(MKDIRHIER)  $(COMMONMISC)$/$(PRJNAME)
-	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) $(TRANSEX_VERBOSITY) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
+	$(COMMAND_ECHO)$(WRAPCMD) $(TRANSEX) -p $(PRJNAME) -i $(@:f) -o $(@).$(INPATH) -m $(LOCALIZESDF) -l all
     $(COMMAND_ECHO)$(RENAME) $@.$(INPATH) $@
     $(COMMAND_ECHO)-$(RM) $@.$(INPATH)
 

solenv/inc/tg_xmerge.mk

+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org 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 Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(XTXFILES)"!=""
+
+ALLTAR : $(MISC)/$(TARGET).xtx.pmerge.mk $(XTXFILES)
+
+.IF "$(L10NEXT)"==""
+L10NEXT:=.txt
+.ENDIF
+
+$(MISC)/$(TARGET).xtx.pmerge.mk :  $(XTXFILES)
+
+$(XTXFILES) : $(LOCALIZESDF)
+
+.INCLUDE .IGNORE : $(MISC)/$(TARGET).xtx.pmerge.mk
+
+.IF "$(alllangiso)"!="$(last_merge)"
+XTXMERGEPHONY:=.PHONY
+.ENDIF          # "$(alllangiso)" != "$(last_merge)"
+
+$(MISC)/$(TARGET)/%$(L10NEXT) $(XTXMERGEPHONY) : %.xtx
+	@@-$(MKDIRHIER) $(@:d)
+.IF "$(WITH_LANG)"==""
+    $(COMMAND_ECHO)$(COPY) $< $@
+.ELSE          # "$(WITH_LANG)"==""
+    @@-$(RM) $@
+    $(COMMAND_ECHO)@noop $(assign XTXMERGELIST+:=$(<:f))
+    $(COMMAND_ECHO)@noop $(assign XTXDESTDIR:=$(@:d))
+.ENDIF          # "$(WITH_LANG)"==""
+
+$(MISC)/$(TARGET).xtx.pmerge.mk : $(XTXMERGELIST)
+.IF "$(WITH_LANG)"!=""
+# xtxex command file requirements:
+# - one file per line
+# - no spaces
+# - no empty lines
+# $(uniq ...) to workaround $assign adding the value twice...
+    @noop $(assign XTXMERGEFILELIST:=$(uniq $(XTXMERGELIST)))
+    $(COMMAND_ECHO) $(SOLARBINDIR)/xtxex -p $(PRJNAME) -r $(PRJ) -o $(XTXDESTDIR) -i @$(mktmp $(XTXMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[fileNoExt]_[language]$(L10NEXT)" 
+.ENDIF          # "$(WITH_LANG)"!=""
+
+	@-$(RM) $@
+    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
+.ENDIF          # "$(XTXFILES)"!=""
+
+.IF "$(TREEFILE)"!=""
+ALLTAR : $(MISC)/$(TARGET).tree.pmerge.mk $(TREEFILE)
+
+$(MISC)/$(TARGET).tree.pmerge.mk :  $(TREEFILE)
+
+$(TREEFILE) : $(LOCALIZESDF)
+
+.INCLUDE .IGNORE : $(MISC)/$(TARGET).tree.pmerge.mk
+
+.IF "$(alllangiso)"!="$(last_merge)"
+TREEMERGEPHONY:=.PHONY
+.ENDIF          # "$(alllangiso)" != "$(last_merge)"
+
+$(OUT_HELP)/en-US/help.tree $(TREEMERGEPHONY) : help.tree
+	@@-$(MKDIRHIER) $(@:d)
+.IF "$(WITH_LANG)"==""
+    $(COMMAND_ECHO)$(COPY) $< $@
+.ELSE          # "$(WITH_LANG)"==""
+    @@-$(RM) $@
+    $(COMMAND_ECHO)@noop $(assign TREEMERGELIST+:=$(<:f))
+    $(COMMAND_ECHO)@noop $(assign TREEDESTDIR:=$(@:d:d:d))
+.ENDIF          # "$(WITH_LANG)"==""
+
+$(MISC)/$(TARGET).tree.pmerge.mk : $(TREEMERGELIST)
+.IF "$(WITH_LANG)"!=""
+# xtxex command file requirements:
+# - one file per line
+# - no spaces
+# - no empty lines
+# $(uniq ...) to workaround $assign adding the value twice...
+    @noop $(assign TREEMERGEFILELIST:=$(uniq $(TREEMERGELIST)))
+# Variables for the pattern filename,fileNoExt,language,extension,pathPrefix,pathPostFix,path
+    $(COMMAND_ECHO) $(SOLARBINDIR)/xhtex -p $(PRJNAME) -r $(PRJ) -o $(TREEDESTDIR) -i @$(mktmp $(TREEMERGEFILELIST:t"\n":s/ //)) -l $(alllangiso:s/ /,/) -f $(alllangiso:s/ /,/) -m $(LOCALIZESDF) -s"[path]/[language]/[fileNoExt].tree" 
+.ENDIF          # "$(WITH_LANG)"!=""
+	@-$(RM) $@
+    $(COMMAND_ECHO)echo last_merge=$(alllangiso) > $@
+.ENDIF          # "$(TREEFILE)"!=""
+
+

swext/mediawiki/help/makefile.mk

 
 
 $(OUT_MEDIAWIKI)$/$(TARGET).done : $(LOCALIZESDF) $(XHPFILES) $(HLANGXHPFILES)
-	@$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(HELPEX) -QQ -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(OUT_HELP) -y $(PACKAGE) -l all -lf $(MEDIAWIKI_LANG:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
+	@$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(HELPEX) -p $(PRJNAME) -r $(PRJ) -i @$(mktmp $(uniq $(foreach,i,$? $(!eq,$(i:f),$(i:f:s/.xhp//) $(i:f) $(XHPFILES))))) -x $(OUT_HELP) -y $(PACKAGE) -l all -lf $(MEDIAWIKI_LANG:t",") -m $(LOCALIZESDF) && $(TOUCH) $@
 .ENDIF
 

transex3/java/jpropex/build.xml

-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-  
-  Copyright 2000, 2010 Oracle and/or its affiliates.
-  
-  OpenOffice.org - a multi-platform office productivity suite
- 
-  This file is part of OpenOffice.org.
- 
-  OpenOffice.org is free software: you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License version 3
-  only, as published by the Free Software Foundation.
- 
-  OpenOffice.org 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 Lesser General Public License version 3 for more details
-  (a copy is included in the LICENSE file that accompanied this code).
-
-  You should have received a copy of the GNU Lesser General Public License
-  version 3 along with OpenOffice.org.  If not, see
-  <http://www.openoffice.org/license.html>
-  for a copy of the LGPLv3 License.
- 
--->
-<project name="jpropex" default="main" basedir=".">
-
-    <!-- ================================================================= -->
-    <!-- settings                                                          -->
-    <!-- ================================================================= -->
-
-    <!-- name of this sub target used in recursive builds -->
-    <property name="target" value="jpropex"/>
-
-    <!-- name of jar file created, without .jar extension -->
-    <property name="jarname" value="jpropex"/>
-
-    <!-- relative path to project directory -->
-    <property name="prj" value="."/>
-
-    <!-- build output directory -->
-    <property name="out" value="build"/>
-
-    <!-- build directories -->
-    <property name="build.dir" value="${out}"/>
-    <property name="build.class" value="${build.dir}/class/jpropex"/>
-    <property name="build.misc"  value="${build.dir}/misc/jpropex"/>
-
-    <!-- start of java source code package structure -->
-    <property name="java.dir" value="java"/>
-
-    <!-- define how to handle CLASSPATH environment -->
-    <property name="build.sysclasspath" value="ignore"/>
-
-    <!-- classpath settings for compile and javadoc tasks -->
-    <path id="classpath">
-        <pathelement location="."/>
-        <pathelement location="${build.class}"/>
-    </path>
-
-    <!-- name to display in documentation -->
-    <!--    <property name="docname" value="l10n converter"/> -->
-
-    <!-- set "modern" java compiler -->
-    <property name="build.compiler" value="modern"/>
-
-    <!-- set wether we want to compile with debug information -->
-    <property name="debug" value="on"/>
-
-    <!-- set wether we want to compile with optimisation -->
-    <property name="optimize" value="off"/>
-
-    <!-- set wether we want to compile with or without deprecation -->
-    <property name="deprecation" value="on"/>
-
-    <target name="info">
-        <echo message="--------------------"/>
-        <echo message="${target}"/>
-        <echo message="--------------------"/>
-    </target>
-
-    <!-- ================================================================= -->
-    <!-- custom targets                                                    -->
-    <!-- ================================================================= -->
-
-    <!-- the main target, called in recursive builds -->
-    <target name="main" depends="info,prepare,compile,jar"/>
-
-    <!-- prepare output directories -->
-    <target name="prepare">
-        <mkdir dir="${build.dir}"/>
-        <mkdir dir="${build.class}"/>
-        <mkdir dir="${build.misc}"/>
-    </target>
-
-
-    <target name="res" depends="prepare">
-        <copy todir="${build.class}">
-             <fileset dir="${java.dir}">
-                 <include name="**/*.properties"/>
-                 <include name="**/*.css"/>
-                 <include name="**/*.dtd"/>
-                 <include name="**/*.form"/>
-                 <include name="**/*.gif "/>
-                 <include name="**/*.htm"/>
-                 <include name="**/*.html"/>
-                 <include name="**/*.js"/>
-                 <include name="**/*.mod"/>
-                 <include name="**/*.sql"/>
-                 <include name="**/*.xml"/>
-                 <include name="**/*.xsl"/>
-                 <include name="**/*.map"/>
-
-             </fileset>
-	    </copy>
-    </target>
-
-
-    <target name="compile" depends="prepare,res">
-	<javac destdir="${build.class}"
-	       debug="${debug}"
-               deprecation="${deprication}"
-	       optimize="${optimize}"
-	       classpathref="classpath">
-            <src path="${java.dir}"/>
-	    <include name="**/*.java"/>
-	</javac>
-    </target>
-
-    <!-- clean up -->
-    <target name="clean" depends="prepare">
-        <delete includeEmptyDirs="true">
-            <fileset dir="${build.class}">
-                <patternset>
-                    <include name="${package}/**/*.class"/>
-                </patternset>
-            </fileset>
-        </delete>
-    </target>
-
-    <!-- create jar file -->
-    <target name="jar" depends="prepare,compile" if="build.class">
-        <jar jarfile="${build.class}/${jarname}.jar"
-             basedir="${build.class}"
-             manifest="${jarname}.MF">
-                 <include name="**/*.class"/>
-                 <include name="**/*.properties"/>
-                 <include name="**/*.css"/>
-                 <include name="**/*.dtd"/>
-                 <include name="**/*.form"/>
-                 <include name="**/*.gif "/>
-                 <include name="**/*.htm"/>
-                 <include name="**/*.html"/>
-                 <include name="**/*.js"/>
-                 <include name="**/*.mod"/>
-                 <include name="**/*.sql"/>
-                 <include name="**/*.xml"/>
-                 <include name="**/*.xsl"/>
-                 <include name="**/*.map"/>
-        </jar>
-    </target>
-
-    <target name="test" depends="prepare">
-    </target>
-
-</project>
-

transex3/java/jpropex/java/JPropEx.java

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-import java.util.*;