[Libreoffice-commits] .: l10ntools/inc l10ntools/java l10ntools/prj l10ntools/scripts l10ntools/source
Andras Timar
timar at kemper.freedesktop.org
Wed Jun 1 00:26:27 PDT 2011
dev/null |binary
l10ntools/inc/utf8conv.hxx | 47
l10ntools/java/jpropex/build.xml | 169 -
l10ntools/java/jpropex/java/JPropEx.java | 509 ----
l10ntools/java/jpropex/java/Main.java | 38
l10ntools/java/jpropex/java/NoLocalizeFilter.java | 54
l10ntools/java/jpropex/java/OrderedHashMap.java | 96
l10ntools/java/jpropex/java/SdfData.java | 108 -
l10ntools/java/jpropex/java/SdfEntity.java | 255 --
l10ntools/java/jpropex/jpropex | 12
l10ntools/java/jpropex/jpropex.MF | 1
l10ntools/java/jpropex/jpropex.bat | 13
l10ntools/java/jpropex/makefile.mk | 36
l10ntools/java/l10nconv/build.xml | 229 --
l10ntools/java/l10nconv/converter.MF | 1
l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java | 82
l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java | 249 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java | 246 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java | 307 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java | 550 -----
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java | 520 ----
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java | 76
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java | 146 -
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java | 76
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java | 88
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java | 94
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java | 84
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java | 247 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java | 243 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java | 164 -
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java | 78
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java | 225 --
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java | 68
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java | 95
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java | 632 -----
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java | 172 -
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java | 742 ------
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java | 532 ----
l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd | 391 ---
l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java | 198 -
l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map | 41
l10ntools/java/l10nconv/makefile.mk | 35
l10ntools/java/receditor/build.xml | 169 -
l10ntools/java/receditor/java/transex3/controller/EditorController.java | 334 ---
l10ntools/java/receditor/java/transex3/controller/Main.java | 10
l10ntools/java/receditor/java/transex3/model/ResourceFile.java | 77
l10ntools/java/receditor/java/transex3/model/SdfEntity.java | 211 -
l10ntools/java/receditor/java/transex3/model/SdfString.java | 167 -
l10ntools/java/receditor/java/transex3/view/Editor.java | 97
l10ntools/java/receditor/java/transex3/view/SdfTable.java | 24
l10ntools/java/receditor/makefile.mk | 35
l10ntools/java/receditor/receditor.MF | 1
l10ntools/prj/build.lst | 4
l10ntools/prj/d.lst | 24
l10ntools/scripts/localize_old.pl | 1070 ----------
l10ntools/scripts/makefile.mk | 57
l10ntools/scripts/tool/const.py | 39
l10ntools/scripts/tool/l10ntool.py | 220 --
l10ntools/scripts/tool/pseudo.py | 184 -
l10ntools/scripts/tool/sdf.py | 170 -
l10ntools/scripts/tool/xhtex.py | 136 -
l10ntools/scripts/tool/xtxex.py | 94
l10ntools/scripts/xhtex | 34
l10ntools/scripts/xtxex | 34
l10ntools/source/cfgmerge.cxx | 1
l10ntools/source/export.cxx | 1
l10ntools/source/export2.cxx | 1
l10ntools/source/gsiconv.cxx | 372 ---
l10ntools/source/helpmerge.cxx | 1
l10ntools/source/lngmerge.cxx | 1
l10ntools/source/localize.cxx | 6
l10ntools/source/makefile.mk | 22
l10ntools/source/merge.cxx | 1
l10ntools/source/utf8conv.cxx | 77
l10ntools/source/xgfconv.cxx | 68
l10ntools/source/xrmmerge.cxx | 1
76 files changed, 7 insertions(+), 11685 deletions(-)
New commits:
commit 9fb66701c55915644e147b02d5a01125bc0cf053
Author: Andras Timar <atimar at suse.com>
Date: Tue May 31 16:43:02 2011 +0200
remove unused l10ntools
diff --git a/l10ntools/inc/utf8conv.hxx b/l10ntools/inc/utf8conv.hxx
deleted file mode 100644
index 98f7760..0000000
--- a/l10ntools/inc/utf8conv.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-// global includes
-#include <rtl/textcvt.h>
-#include <tools/string.hxx>
-
-//
-// class UTF8Converter
-//
-
-class UTF8Converter
-{
-private:
- static void Convert( ByteString &rBuffer, rtl_TextEncoding nSourceENC, rtl_TextEncoding nDestENC );
-
-public:
- static ByteString ConvertToUTF8( const ByteString &rASCII, rtl_TextEncoding nEncoding );
- static ByteString ConvertFromUTF8( const ByteString &rUTF8, rtl_TextEncoding nEncoding );
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/java/jpropex/build.xml b/l10ntools/java/jpropex/build.xml
deleted file mode 100755
index 9dd6555..0000000
--- a/l10ntools/java/jpropex/build.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-<?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>
-
diff --git a/l10ntools/java/jpropex/java/JPropEx.java b/l10ntools/java/jpropex/java/JPropEx.java
deleted file mode 100644
index 9ff8bf9..0000000
--- a/l10ntools/java/jpropex/java/JPropEx.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*************************************************************************
- *
- * 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.*;
-import java.io.*;
-
-public class JPropEx
-{
- private String inputFileArg = "";
- private String outputFileArg = "";
- private String pathPrefixArg = "";
- private String pathPostfixArg = "";
- private String projectArg = "";
- private String rootArg = "";
- private Vector forcedLangsArg;
- private Vector langsArg;
- private String inputSdfFileArg = "";
- private boolean isQuiet = false;
- private final String resourceType = "javaproperties";
- private final String sourceLanguage = "en-US";
-
- static final int JAVA_TYPE = 0;
- static final int JAVA_ENUS_TYPE = 1;
- static final int EXTENSION_TYPE = 2;
-
- public JPropEx()
- {
- //data = new SdfData();
- }
-
- public JPropEx( String args[] )
- {
- super();
- parseArguments( args );
- testCL();
- //testArguments();
- if( inputSdfFileArg != null && inputSdfFileArg.length() > 0 )
- merge();
- else
- extract();
- }
-
- private String getSimpleArg( String[] args , int x )
- {
- if( x < args.length ) x++;
- else
- {
- System.err.println("ERROR: Missing arg for "+args[ x ]+"\n");
- help();
- }
- return args[ x ];
- }
- private Vector getComplexArg( String[] args , int x )
- {
- if( x < args.length ) x++;
- else
- {
- System.err.println("ERROR: Missing arg for "+args[ x ]+"\n");
- help();
- }
- String value = args[ x ];
- Vector values = new Vector( Arrays.asList( value.split(",") ) );
- return values;
- }
-
- private void testCL()
- {
- if( inputFileArg.length()>0 && ( ( pathPrefixArg.length()>0 && pathPostfixArg.length()>0 ) || outputFileArg.length()>0 ) && projectArg.length()>0 && rootArg.length()>0 && langsArg.size()>0 )
- if( ( inputSdfFileArg.length()>0 && ( outputFileArg.length()>0 || ( pathPrefixArg.length()>0 && pathPostfixArg.length()>0 ) ) ) || ( inputFileArg.length()>0 && outputFileArg.length()>0 ) )
- return;
- System.out.println("ERROR: Strange parameters!");
- help();
- System.exit( -1 );
- }
- private void help()
- {
- System.out.println("jpropex -> extract / merge java properties files");
- System.out.println("-p <project> -r <project_root> -i <input>|@<input> -o <output> -x <path1> -y <path2> -m <sdf_file> -l <lang>\n");
- System.out.println("Example:\ncd /data/cws/l10ntooling17/DEV300/ooo/reportbuilder/java/com/sun/star/report/function/metadata");
- System.out.println("Extract:\njpropex -p reportbuilder -r ../../../../../../.. -i Title-Function.properties -o new.sdf -l en-US");
- System.out.println("Merge: use either ( -x path -y more_path ) or ( -o ) and ( -i filename ) or ( -i @filename ). @filename contains a list with files");
- System.out.println("jpropex -p reportbuilder -r ../../../../../../.. -x ../../../../../../../unxlngx6.pro/class/com/sun/star/report/function/metadata -y ivo -i @abc -l all -lf en-US,de,fr,pt -m ../../../../../../../common.pro/misc/reportbuilder/java/com/sun/star/report/function/metadata/localize.sdf");
- System.out.println("jpropex -p reportbuilder -r ../../../../../../.. -x ../../../../../../../unxlngx6.pro/class/com/sun/star/report/function/metadata -y ivo -i @abc -l all -lf en-US,de,fr,pt -m ../../../../../../../common.pro/misc/reportbuilder/java/com/sun/star/report/function/metadata/localize.sdf");
- System.out.println("jpropex -p reportbuilder -r ../../../../../../.. -o ../../../../../../../unxlngx6.pro/class/com/sun/star/report/function/metadata/ -i Title-Function.properties -l all -lf en-US,de,fr,pt -m ../../../../../../../common.pro/misc/reportbuilder/java/com/sun/star/report/function/metadata/localize.sdf");
- System.out.println("jpropex -p reportbuilder -r ../../../../../../.. -x ../../../../../../../unxlngx6.pro/class/com/sun/star/report/function/metadata -y ivooo -i Title-Function.properties -l all -lf en-US,de,fr,pt -m ../../../../../../../common.pro/misc/reportbuilder/java/com/sun/star/report/function/metadata/localize.sdf");
- System.exit( -1 );
- }
-
- private void extract()
- {
- SdfData data = new SdfData();
- java.util.Properties prop = loadProp( inputFileArg );
-
- // Get a prototype that already contains the most common settings
- SdfEntity dolly = prepareSdfObj( inputFileArg );
- String key;
- SdfEntity currentStr;
- String value;
- String str;
- for( Enumeration e = prop.propertyNames() ; e.hasMoreElements() ; )
- {
- key = (String) e.nextElement();
- currentStr = (SdfEntity) dolly.clone();
- // Set the new GID and the string text
- currentStr.setGid( key );
- value = prop.getProperty( key , "" );
- //if( value.equals("") ) System.err.println("Warning: in file "+inputFileArg+" the string with the key "+key+" has a empty string!");
- str = (prop.getProperty( key )).replaceAll("\t" , " " ); // remove tab
- str = str.replaceAll("\n"," "); // remove return
- currentStr.setText( str );
- if( str.length() > 0 )
- data.add( currentStr );
- }
- data.write( outputFileArg );
- }
-
- private SdfEntity prepareSdfObj( String filename )
- {
- String path = makeAbs( filename ).trim();
- String myRootArg = makeAbs( rootArg ).trim();
- myRootArg = myRootArg.replace( "\\","/");
- myRootArg += "/";
- path = path.replace("\\","/");
- path = path.replace( myRootArg, "" );
- path = path.replace("/","\\");
- // TODO: Make this static
- java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String date = dateformat.format( new Date() );
- return new SdfEntity( projectArg , path , "0" /* dummy1 */ , resourceType , "", "" , "" , "" , "0" /* dummy2 */ ,
- sourceLanguage , "", "" , "" , "" , date );
- }
-
- private void merge()
- {
- SdfData data = getSdfData();
- if( inputFileArg.startsWith("@") )
- {
- // Read files
- Vector fileList = readFileList( inputFileArg );
- for( Enumeration e = fileList.elements(); e.hasMoreElements(); )
- mergeFile( (String) e.nextElement() , data , false );
- }
- else
- {
- // Single file
- mergeFile( inputFileArg , data , true );
- }
- }
-
- private Vector readFileList( String filename )
- {
- Vector lines = new Vector();
- try
- {
- BufferedReader in = new BufferedReader( new FileReader( filename.substring( 1 ) ) );
- while( in.ready() )
- lines.add( in.readLine().trim() );
- }
- catch( IOException e )
- {
- System.out.println("ERROR: Can't open file '"+filename.substring( 1 )+"'");
- System.exit( -1 );
- }
- return lines;
- }
-
- private void mergeFile( String filename , SdfData data , boolean isSingleFile )
- {
- int type = detectFormat( filename );
- java.util.Properties sourceProp = loadProp( filename );
- Vector langs = getLanguages( data );
- HashMap props = new HashMap();
- // Create a properties object for every language
- for( Enumeration e = langs.elements(); e.hasMoreElements();)
- {
- props.put( (String)e.nextElement() , new java.util.Properties() );
- }
- // Get a prototype that already contains the most common settings
-
- SdfEntity dolly = prepareSdfObj( filename );
- String key;
- String sourceString;
- SdfEntity curStr;
- SdfEntity curEntity;
- SdfEntity mergedEntity;
- String curLang;
- for( Enumeration e = sourceProp.propertyNames() ; e.hasMoreElements() ; ) // For all property keys
- {
- key = (String) e.nextElement();
- sourceString = sourceProp.getProperty( key );
- curStr = (SdfEntity) dolly.clone();
- curStr.setGid( key );
- for( Enumeration lang = langs.elements(); lang.hasMoreElements(); ) // merge in every language
- {
- curEntity = (SdfEntity) curStr.clone();
- curLang = (String) lang.nextElement();
- curEntity.setLangid( curLang );
- mergedEntity = data.get( curEntity );
- if( mergedEntity == null )
- {
- // in case there is no translation then fallback to the en-US source string
- ( (java.util.Properties) props.get( curLang )).setProperty( curEntity.getGid() , sourceString );
- }
- else
- {
- // Set the merged text from the sdf file
- ( (java.util.Properties) props.get( curLang )).setProperty( mergedEntity.getGid() , mergedEntity.getText() ); // TODO: Quoting ???
- }
- }
-
- }
- // Now write them out
- String lang;
- for( Iterator i = props.keySet().iterator() ; i.hasNext() ; )
- {
- lang = (String) i.next();
- writeSinglePropertiesFile( filename , (java.util.Properties) props.get( lang ) , lang , isSingleFile , type );
- }
- }
- private void writeSinglePropertiesFile( String filename , java.util.Properties prop , String lang , boolean isSingleFile , int type )
- {
- // Prepare path to file
- int filenameIdx = filename.lastIndexOf( "/" ) > 0 ? filename.lastIndexOf( "/" )+1 : 0 ;
- String path = new String();
- String name = new String();
- String lcLang = lang.toLowerCase();
- // use of -x <path> -y <more_path>
- // -> <path>/<lang>/<more_path>
- if( pathPrefixArg != null && pathPrefixArg.length()>0 && pathPostfixArg != null && pathPostfixArg.length()>0 )
- {
- path = new StringBuffer().append( pathPrefixArg ).append( "/" ).append( lcLang ).append( "/" ).append( pathPostfixArg ).append( "/" ).toString();
- name += formatFilename( filename , filenameIdx , lang , type );
- }
- //use of -i <one_filename>
- else if( !isSingleFile && outputFileArg != null && outputFileArg.length()>0 )
- {
- //name = outputFileArg;
- path = outputFileArg;
- name += formatFilename( filename , filenameIdx , lang , type );
- }
- //use of -i @<file_containing_many_filenames>
- else if( isSingleFile && outputFileArg != null && outputFileArg.length()>0 )
- {
- //name = outputFileArg;
- path = outputFileArg;
- name += formatFilename( filename , filenameIdx , lang , type );
- }
- else
- {
- System.err.println("ERROR: No outputfile specified .. either -o or -x -y !");
- System.exit( -1 );
- }
-
- File dir = new File( path );
- try
- {
- if( !dir.exists() && path.length()>0 )
- {
- if( !dir.mkdirs() )
- {
- System.out.println("ERROR: Can't create directory '"+path+"' !!!");
- System.exit( -1 );
- }
- }
- }
- catch( SecurityException e )
- {
- System.out.println("ERROR: Can't create directory '"+path+"'!!!Wrong Permissions?");
- System.exit( -1 );
- }
- path += name;
- // Write the properties file
- //System.out.println("DBG: Writing to "+path);
- try{
- BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( path ) );
- if( prop == null )
- System.out.println("DBG: prop == null!!!");
- prop.store( out , "" ); // Legal headers?
- }
- catch( IOException e )
- {
- System.out.println("ERROR: Can't write file '"+path+"' !!!!");
- System.exit( -1 );
- }
- }
-
- // we have different types of properties in the source code
- // each needs a different file nameing scheme
- private int detectFormat( String filename )
- {
- if( filename.endsWith( "_en_US.properties" ) )
- return EXTENSION_TYPE;
- else if( filename.endsWith("_en_us.properties" ) )
- return JAVA_ENUS_TYPE;
- else if( filename.endsWith( ".properties" ) )
- return JAVA_TYPE;
-
- // Can not detect, exit
- System.err.println("ERROR: Invalid file name. Only allowed (case sensitive!) *_en_US.properties , *_en_us.properties or *.properties\n");
- System.exit(-1);
- return JAVA_TYPE; // dummy
- }
-
- private String formatFilename( String filename , int filenameIdx , String lang , int type )
- {
-
- if( !lang.equals( "en-US" ) )
- {
- // Parse iso code
- int pos = lang.indexOf("-");
- String langpart1 = new String();
- String langpart2 = new String();
- if( pos == -1 )
- {
- langpart1 = lang;
- }
- else if( pos > 0 )
- {
- langpart1 = lang.substring( 0 , pos );
- langpart2 = lang.substring( pos+1 , lang.length() );
- }
- // change filename according to the type
- switch( type )
- {
- // -> de_DE
- case EXTENSION_TYPE:
- lang = langpart1.toLowerCase();
- if( langpart2.length() > 0 ) // -> en_US
- lang += "_" + langpart2.toUpperCase();
- else // -> de_DE
- lang += "_" + langpart1.toUpperCase();
- return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( "_en_US.properties" ) ) )
- .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString();
- // -> de
- case JAVA_ENUS_TYPE:
- lang = langpart1.toLowerCase();
- if( langpart2.length() > 0 )
- lang += "_" + langpart2.toLowerCase();
- return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( "_en_us.properties" ) ) )
- .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString();
- // -> de
- case JAVA_TYPE:
- lang = langpart1.toLowerCase();
- if( langpart2.length() > 0 )
- lang += "_" + langpart2.toLowerCase();
- return new StringBuffer().append( filename.substring( filenameIdx , filename.lastIndexOf( ".properties" ) ) )
- .append( "_" ).append( lang.replaceAll("-","_") ).append( ".properties" ).toString();
- default:
- System.err.println("ERROR: Something is really broken here, l10ntools/java/jprop/java/JPropEx.java :: formatFilename()");
- System.exit( -1 );
- break;
- }
- }
- return filename; // don't change en-US source file name
- }
- private SdfData getSdfData()
- {
- SdfData data = new SdfData( inputSdfFileArg );
- data.read();
- return data;
- }
- private Vector getLanguages( SdfData data )
- {
- Vector langs = new Vector();
-
- if( ((String)langsArg.get( 0 )).equalsIgnoreCase( "all" ) ) // for "-l all" use all languages found in the -m sdf file
- langs.addAll( data.getLanguages() );
- else
- langs.addAll( langsArg ); // use the langs giving by -l
-
- if( forcedLangsArg != null )
- langs.addAll( forcedLangsArg );
-
- return removeDupes( langs );
- }
- private Vector removeDupes( Vector vec )
- {
- Collection coll = new LinkedHashSet( vec );
- return new Vector( coll );
- }
- private java.util.Properties loadProp( String filename )
- {
- java.util.Properties prop = new java.util.Properties();
- try
- {
- prop.load( new BufferedInputStream( new NoLocalizeFilter( new FileInputStream( filename ) ) ) );
- }
- catch( IOException e )
- {
- System.err.println("ERROR: Can't read file '"+filename+"'!!!");
- }
- return prop;
- }
- private void parseArguments( String[] args )
- {
-
- if( args.length == 0 )
- {
- System.out.println("ERROR: No args???");
- help();
- System.exit( -1 );
- }
- for( int x = 0; x < args.length ; x++ )
- {
- if( args[ x ].equalsIgnoreCase("-i") )
- {
- // Input resource file
- inputFileArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-o") )
- {
- // Output sdf file
- outputFileArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-x") )
- {
- // path prefix
- pathPrefixArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-y") )
- {
- // path postfix
- pathPostfixArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-p") )
- {
- // project
- projectArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-r") )
- {
- // root
- rootArg = getSimpleArg( args , x );
- rootArg = makeAbs( rootArg );
- }
- else if( args[ x ].equalsIgnoreCase("-lf") )
- {
- // forced langs
- forcedLangsArg = getComplexArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-l") )
- {
- // langs
- langsArg = getComplexArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-m") )
- {
- // input sdf file
- inputSdfFileArg = getSimpleArg( args , x );
- }
- else if( args[ x ].equalsIgnoreCase("-qq") )
- {
- isQuiet = true;
- }
- }
- }
- private String makeAbs( String path )
- {
- File file;
- try
- {
- file = new File( path );
- return file.getCanonicalPath();
- }catch( IOException e )
- {
- e.printStackTrace();
- System.exit( -1 );
- }
- return null;
- }
-/* private boolean testArguments()
- {
- // nice merge
- if( inputSdfFileArg != null && inputSdfFileArg.length()>0 )
- // nice merge
- return projectArg != null && rootArg != null && inputFileArg != null && pathPrefixArg != null && pathPostfixArg != null && langsArg != null &&
- projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && pathPrefixArg.length()>0 && pathPostfixArg.length()>0 && langsArg.size()>0 ;
- else
- // nice extract
- return projectArg != null && rootArg != null && inputFileArg != null && outputFileArg != null && langsArg != null &&
- projectArg.length()>0 && rootArg.length()>0 && inputFileArg.length()>0 && outputFileArg.length()>0 && langsArg.size()>0;
- }
-*/
-}
diff --git a/l10ntools/java/jpropex/java/Main.java b/l10ntools/java/jpropex/java/Main.java
deleted file mode 100644
index d16d04b..0000000
--- a/l10ntools/java/jpropex/java/Main.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-
-class Main
-{
-
- public static void main( String args[] )
- {
- JPropEx jpropex = new JPropEx( args );
- //jpropex.init();
- }
-}
-
diff --git a/l10ntools/java/jpropex/java/NoLocalizeFilter.java b/l10ntools/java/jpropex/java/NoLocalizeFilter.java
deleted file mode 100644
index c6058a4..0000000
--- a/l10ntools/java/jpropex/java/NoLocalizeFilter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * 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.io.*;
-import java.util.regex.*;
-
-// exit if the sequence x-no-localize is found in stream!
-public class NoLocalizeFilter extends FilterInputStream
-{
- InputStream in;
- Pattern p = Pattern.compile("#[\\s]*x-no-translate");
-
- public NoLocalizeFilter( InputStream in ) {
- super(in);
- this.in = in;
- }
- public int read(byte[] b, int off, int len) throws IOException
- {
- String search = new String( b );
- Matcher m = p.matcher( search );
- if( m.find() )
- {
- in.close();
- close();
- System.exit( 0 );
- }
- return in.read( b , off , len );
- }
-}
diff --git a/l10ntools/java/jpropex/java/OrderedHashMap.java b/l10ntools/java/jpropex/java/OrderedHashMap.java
deleted file mode 100644
index dd8c87e..0000000
--- a/l10ntools/java/jpropex/java/OrderedHashMap.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*************************************************************************
- *
- * 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.*;
-
-// LinkedHashMap implrementation
-public class OrderedHashMap
-{
- private HashMap hm = new HashMap();
- private LinkedList list = new LinkedList();
-
- public Iterator iterator() { return list.iterator(); }
-
- public boolean isEmpty() { return hm.isEmpty(); }
- public Object get( Object key ) { return hm.get( key ); }
- public Object get( int index ) { return hm.get( list.get( index ) ); }
- public Iterator keys() { return list.iterator(); }
- public Object add( Object key , Object value )
- {
- list.add( key );
- return hm.put( key, value );
- }
- public Object add( int index , Object key , Object value )
- {
- list.add( index , key );
- return hm.put( key, value );
- }
- public Object remove( Object key )
- {
- list.remove( list.indexOf( key ) );
- return hm.remove( key );
- }
- public void move( int idxFrom , int idxTo )
- {
- Object key = list.get( idxFrom );
- list.remove( idxFrom );
- list.add( idxTo , key );
- }
- public void move( Object key , int idxTo )
- {
- move( list.indexOf( key ) , idxTo );
- }
- public int size()
- {
- return hm.size();
- }
- public Enumeration elements()
- {
- return new OHMenum( this );
- }
-}
-
-final class OHMenum implements Enumeration
-{
- OrderedHashMap ohm;
- int index = 0;
-
- private OHMenum(){};
- public OHMenum( OrderedHashMap ohm ){
- this.ohm = ohm ;
- }
-
- public boolean hasMoreElements()
- {
- return index < ohm.size();
- }
- public Object nextElement()
- {
- return ohm.get( index++ );
- }
-}
diff --git a/l10ntools/java/jpropex/java/SdfData.java b/l10ntools/java/jpropex/java/SdfData.java
deleted file mode 100644
index 53d1e57..0000000
--- a/l10ntools/java/jpropex/java/SdfData.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*************************************************************************
- *
- * 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.*;
-import java.io.*;
-
-public class SdfData
-{
- private String filename;
- private OrderedHashMap ohm;
- private LinkedHashSet languagesFound;
-
- public SdfData()
- {
- languagesFound = new LinkedHashSet();
- ohm = new OrderedHashMap();
- languagesFound = new LinkedHashSet();
- }
- public SdfData( String filename )
- {
- this();
- this.filename = filename;
- }
-
- public LinkedHashSet getLanguages()
- {
- return languagesFound;
- }
- public SdfEntity get( SdfEntity obj )
- {
- return (SdfEntity) ohm.get( (String)obj.getId() );
- }
- public SdfEntity get( String key ){
- return (SdfEntity) ohm.get( key );
- }
- public void add( SdfEntity obj )
- {
- ohm.add( obj.getId() , obj );
- }
-
- public void read()
- {
- BufferedReader in;
- try
- {
- in = new BufferedReader( new InputStreamReader( new FileInputStream( filename ), "UTF-8" ) );
- SdfEntity entity;
- while( in.ready() )
- {
- String line = in.readLine();
- if( line.length() > 0 )
- {
- entity = new SdfEntity( line );
- ohm.add( entity.getId() , entity ); // test if is valid
- languagesFound.add( entity.getLangid() );
- }
- }
- in.close();
- }
- catch( IOException e )
- {
- System.out.println("Warning: can not read file " + filename);
- }
- }
- public void write( String filename )
- {
- FileWriter out;
- try
- {
- out = new FileWriter( filename , true ); // Always append
- for( Enumeration e = ohm.elements(); e.hasMoreElements(); )
- {
- out.write( ( (SdfEntity) e.nextElement() ).toString() + "\n" );
- }
- out.close();
- }
- catch( IOException e )
- {
- System.out.println("Error: Can't write to file " + filename);
- System.exit( -1 );
- }
- }
-}
diff --git a/l10ntools/java/jpropex/java/SdfEntity.java b/l10ntools/java/jpropex/java/SdfEntity.java
deleted file mode 100644
index 26e3cfe..0000000
--- a/l10ntools/java/jpropex/java/SdfEntity.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-
-
-public class SdfEntity implements Cloneable{
- private String project = new String("");
- private String source_file = new String("");
- private String dummy1 = new String("");
- private String resource_type= new String("");
- private String gid = new String("");
- private String lid = new String("");
- private String helpid = new String("");
- private String platform = new String("");
- private String dummy2 = new String("");
- private String langid = new String("");
- private String text = new String("");
- private String helptext = new String("");
- private String quickhelptext= new String("");
- private String title = new String("");
- private String date = new String("");
-
- public static int PROJECT_POS = 0;
- public static int SOURCE_FILE_POS = 1;
- public static int DUMMY1_POS = 2;
- public static int RESOURCE_TYPE_POS = 3;
- public static int GID_POS = 4;
- public static int LID_POS = 5;
- public static int HELPID_POS = 6;
- public static int PLATFORM_POS = 7;
- public static int DUMMY2_POS = 8;
- public static int LANGID_POS = 9;
- public static int TEXT_POS = 10;
- public static int HELPTEXT_POS = 11;
- public static int QUICKHELPTEXT_POS = 12;
- public static int TITLE_POS = 13;
- public static int DATE_POS = 14;
-
- public Object clone()
- {
- try
- {
- return super.clone();
- }
- catch( CloneNotSupportedException e )
- {
- System.out.println("ERROR: Can not clone, something is broken here ....");
- System.exit( -1 );
- }
- return null; // dummy
- }
-
- public SdfEntity( String line ){
- // isValid?
- setProperties( line ) ;
- }
- public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) {
- super();
- this.project = project;
- this.source_file = source_file;
- this.dummy1 = dummy1;
- this.resource_type = resource_type;
- this.gid = gid;
- this.lid = lid;
- this.helpid = helpid;
- this.platform = platform;
- this.dummy2 = dummy2;
- this.langid = langid;
- this.text = text;
- this.helptext = helptext;
- this.quickhelptext = quickhelptext;
- this.title = title;
- this.date = date;
- }
-
- public void setProperties( String line ){
- if( line != null )
- {
- String[] splitted = line.split("\t",15);
- setProject( splitted[ SdfEntity.PROJECT_POS ] );
- setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] );
- setDummy1( splitted[ SdfEntity.DUMMY1_POS ] );
- setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] );
- setGid( splitted[ SdfEntity.GID_POS ] );
- setLid( splitted[ SdfEntity.LID_POS ] );
- setHelpid( splitted[ SdfEntity.HELPID_POS ] );
- setPlatform( splitted[ SdfEntity.PLATFORM_POS ] );
- setDummy2( splitted[ SdfEntity.DUMMY2_POS ] );
- setLangid( splitted[ SdfEntity.LANGID_POS ] );
- setText( splitted[ SdfEntity.TEXT_POS ] );
- setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] );
- setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] );
- setTitle( splitted[ SdfEntity.TITLE_POS ] );
- setDate( splitted[ SdfEntity.DATE_POS ] );
- }
- }
-
- public String getFileId(){
- return project+"\\"+source_file;
- }
- public String getResourcePath(){
- return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 );
- }
- public String toString(){
- return new StringBuffer( project ).append( "\t" ).append( source_file ).append( "\t" ).append( dummy1 ).append( "\t" ).append( resource_type ).append( "\t" ).append( gid ).append( "\t" )
- .append( lid ).append( "\t" ).append( helpid ).append( "\t" ).append( platform ).append( "\t" ).append( dummy2 ).append( "\t" ).append( langid ).append( "\t" )
- .append( text ).append( "\t" ).append( helptext ).append( "\t" ).append( quickhelptext ).append( "\t" ).append( title ).append( "\t" ).append( date ).toString();
- }
- public String getId(){
- return new StringBuffer( project ).append( gid ).append( lid ).append( source_file ).append( resource_type ).append( platform ).append( helpid ).append( langid ).toString();
- }
-
- public String getDummy1() {
- return dummy1;
- }
-
- public void setDummy1(String dummy1) {
- this.dummy1 = dummy1;
- }
-
- public String getPlatform() {
- return platform;
- }
-
- public void setPlatform(String platform) {
- this.platform = platform;
- }
-
- public String getDummy2() {
- return dummy2;
- }
-
- public void setDummy2(String dummy2) {
- this.dummy2 = dummy2;
- }
-
- public String getGid() {
- return gid;
- }
-
- public void setGid(String gid) {
- this.gid = gid;
- }
-
- public String getHelpid() {
- return helpid;
- }
-
- public void setHelpid(String helpid) {
- this.helpid = helpid;
- }
-
- public String getHelptext() {
- return helptext;
- }
-
- public void setHelptext(String helptext) {
- this.helptext = helptext;
- }
-
- public String getLangid() {
- return langid;
- }
-
- public void setLangid(String langid) {
- this.langid = langid;
- }
-
- public String getLid() {
- return lid;
- }
-
- public void setLid(String lid) {
- this.lid = lid;
- }
-
- public String getProject() {
- return project;
- }
-
- public void setProject(String project) {
- this.project = project;
- }
-
- public String getQuickhelptext() {
- return quickhelptext;
- }
-
- public void setQuickhelptext(String quickhelptext) {
- this.quickhelptext = quickhelptext;
- }
-
- public String getResource_type() {
- return resource_type;
- }
-
- public void setResource_type(String resource_type) {
- this.resource_type = resource_type;
- }
-
- public String getSource_file() {
- return source_file;
- }
-
- public void setSource_file(String source_file) {
- this.source_file = source_file;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
- public String getDate() {
- return date;
- }
- public void setDate(String date) {
- this.date = date;
- }
-
-
-}
diff --git a/l10ntools/java/jpropex/jpropex b/l10ntools/java/jpropex/jpropex
deleted file mode 100755
index 69f2972..0000000
--- a/l10ntools/java/jpropex/jpropex
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-if [ x${SOLARENV}x = xx ]; then
- echo No environment found, please use 'configure' or 'setsolar'
- exit 1
-fi
-
-if [ x${JAVA_HOME}x = xx ]; then
- echo ERROR: No java found
- exit 1
-fi
-
-exec java -DSOLARSRC=${SOLARSRC} -DWORK_STAMP=${WORK_STAMP} -DUSE_SHELL= -jar ${SOLARVER}/${INPATH}/bin/jpropex.jar "$@"
diff --git a/l10ntools/java/jpropex/jpropex.MF b/l10ntools/java/jpropex/jpropex.MF
deleted file mode 100755
index 3e22e7e..0000000
--- a/l10ntools/java/jpropex/jpropex.MF
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: Main
diff --git a/l10ntools/java/jpropex/jpropex.bat b/l10ntools/java/jpropex/jpropex.bat
deleted file mode 100755
index 6fad0d4..0000000
--- a/l10ntools/java/jpropex/jpropex.bat
+++ /dev/null
@@ -1,13 +0,0 @@
- at echo off
-
-if "x%SOLARENV%x" EQU "xx" (
- echo No environment found, please use 'configure' or 'setsolar'
- exit
-)
-
-if "x%JAVA_HOME%x" EQU "xx" (
- echo echo ERROR: No java found
- exit
-)
-
-java -DSOLARSRC=%SOLARSRC% -DWORK_STAMP=%WORK_STAMP% -DUSE_SHELL= -jar %SOLARVER%\%INPATH%\bin\jpropex.jar %*
diff --git a/l10ntools/java/jpropex/makefile.mk b/l10ntools/java/jpropex/makefile.mk
deleted file mode 100755
index f86d2c8..0000000
--- a/l10ntools/java/jpropex/makefile.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-#*************************************************************************
-#
-# 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.
-#
-#*************************************************************************
-
-
-PRJ=../..
-PRJNAME=transex3
-TARGET=jpropex
-
-.INCLUDE : ant.mk
-
-ALLTAR : ANTBUILD
-
diff --git a/l10ntools/java/l10nconv/build.xml b/l10ntools/java/l10nconv/build.xml
deleted file mode 100755
index 6667630..0000000
--- a/l10ntools/java/l10nconv/build.xml
+++ /dev/null
@@ -1,229 +0,0 @@
-<?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="l10nconv" default="main" basedir=".">
-
- <!-- ================================================================= -->
- <!-- settings -->
- <!-- ================================================================= -->
-
- <!-- name of this sub target used in recursive builds -->
- <property name="target" value="l10nconv"/>
-
- <!-- name of jar file created, without .jar extension -->
- <property name="jarname" value="converter"/>
-
- <!-- 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/converter"/>
- <property name="build.misc" value="${build.dir}/misc/converter"/>
-
- <!-- 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,javadoc,zipdoc"/>
-
- <!-- prepare output directories -->
- <target name="prepare">
- <mkdir dir="${build.dir}"/>
- <mkdir dir="${build.dir}/doc"/>
- <mkdir dir="${build.dir}/doc/javadoc"/>
- <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>
-
- <!-- check if javadoc is up to date -->
- <target name="javadoc_check" depends="prepare" if="build.dir">
- <uptodate property="javadocBuild.notRequired" value="true"
- targetfile="${build.dir}/doc/converter_javadoc.zip">
- <srcfiles dir="${java.dir}" includes="**/*.java"/>
- </uptodate>
- </target>
-
- <!-- generate java documentation -->
- <target name="javadoc" depends="prepare,javadoc_check,compile"
- unless="javadocBuild.notRequired"
- if="build.dir">
-
- <javadoc destdir="${build.dir}/doc/javadoc"
- verbose="false"
- author="false"
- nodeprecated="true"
- nodeprecatedlist="true"
- use="true"
- Doctitle="${docname}"
- windowtitle="${docname}"
- classpathref="classpath">
-
- <packageset dir="${java.dir}" defaultexcludes="yes">
- <include name="com/**"/>
- </packageset>
-
- <link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api"
- packagelistLoc="${common.doc}/jdk1.4.2"/>
- <link offline="true"
- href="http://java.sun.com/products/servlet/2.3/javadoc"
- packagelistLoc="${common.doc}/servlet2.3"/>
- <link offline="true"
- href="http://logging.apache.org/log4j/docs/api"
- packagelistLoc="${common.doc}/log4j-1.2.8"/>
- <link offline="true"
- href="http://java.sun.com/products/javabeans/glasgow/javadocs"
- packagelistLoc="${common.doc}/jaf-1.0.2"/>
- <link offline="true"
- href="http://java.sun.com/products/javamail/javadocs"
- packagelistLoc="${common.doc}/javamail-1.3.1"/>
- <link offline="true"
- href="http://ws.apache.org/soap/docs"
- packagelistLoc="${common.doc}/soap-2.3.1"/>
-
- <bottom><i>Copyright &#169; 2004 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA</i></bottom>
- <header>${docname}</header>
-
- </javadoc>
- </target>
-
- <!-- zip documentation and store in build/misc -->
- <target name="zipdoc" depends="javadoc" if="build.dir" unless="javadocBuild.notRequired">
- <zip zipfile="${build.dir}/doc/converter_javadoc.zip"
- basedir="${build.dir}/doc/javadoc"
- update="true"/>
- </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>
-
diff --git a/l10ntools/java/l10nconv/converter.MF b/l10ntools/java/l10nconv/converter.MF
deleted file mode 100755
index 843d500..0000000
--- a/l10ntools/java/l10nconv/converter.MF
+++ /dev/null
@@ -1 +0,0 @@
-Main-Class: com.sun.star.tooling.converter.Convert
diff --git a/l10ntools/java/l10nconv/documentation/readmeConverter.sxw b/l10ntools/java/l10nconv/documentation/readmeConverter.sxw
deleted file mode 100644
index f779e10..0000000
Binary files a/l10ntools/java/l10nconv/documentation/readmeConverter.sxw and /dev/null differ
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java
deleted file mode 100755
index 7a9b1fe..0000000
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-/*
- * Created on 2005
- * by Christian Schmidt
- */
-package com.sun.star.tooling.DirtyTags;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-
-
-
-public class DirtyTagWrapCheck {
- static String line="";
- public static void main(String[] args) {
- try {
- File fi = new File("D:\\Testfiles\\KID_helpcontent.sdf");//Copy of
- FileReader fr = new FileReader(fi);
- BufferedReader br = new BufferedReader(fr);
-
- int readCounter=0;
- int missCounter=0;
- int lineErrorCounter=0;
- while((line=br.readLine())!=null){
- readCounter++;
- String [] split = line.split("\t");
- if(split.length<15){
-
- lineErrorCounter++;
- continue;
- }
- String string = split[10];
- String wrapped = DirtyTagWrapper.wrapString(string);
- String unwrapped=DirtyTagWrapper.unwrapString(wrapped);
- if(!string.equals(unwrapped)){
-
- missCounter++;
- System.out.println(""+readCounter+"\n"+string+"\n"+unwrapped+"\n"+wrapped+"\n");
- }
- }
- System.out.println("Fertig "+readCounter+" "+missCounter+" "+lineErrorCounter);
- } catch (FileNotFoundException e) {
- //
- e.printStackTrace();
- } catch (IOException e) {
- //
- e.printStackTrace();
- } catch (DirtyTagWrapper.TagWrapperException e) {
- System.out.println(e.getMessage()+"\n"+line+"\n");
-
- }
-
- }
-}
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java
deleted file mode 100755
index cb64f33..0000000
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-/*
- * Created on 2005
- * by Christian Schmidt
- */
-package com.sun.star.tooling.DirtyTags;
-
-import java.io.IOException;
-import java.util.ArrayList;
-
-/**
- * Solves the problem with translating strings from the
- * Star-Office Help. This Strings contain XML snippets
- * (that means parts of an xml dokument). I call them 'dirty'
- * because the start of a tag (<) and the and of an tag (>)
- * are quoted by a single backslash(\<.....\>). This is done
- * because the text out of th tags should not contain '<' and '>'
- * as Entity references (< or >) but as readable signs.
- * This is for translation purposes.
- * Because translators get mad while find out the really translatable
- * parts between all the markup information, the XLIFF Specification
- * allows to wrap parts of a String that should not be translated by
- * special tags (<ept>, <bpt>).
- * This Class has two static methods that do the wrapping and unwrapping
- * NOTE: this won't work with not 'dirty' Strings.
- *
- * @author Christian Schmidt 2005
- *
- */
-public class DirtyTagWrapper {
-
- private static boolean doWrap=true;
- public static void setWrapping(boolean doWrap){
- DirtyTagWrapper.doWrap=doWrap;
- }
-
- /**
- * Unwraps the 'dirty' parts of a String from ept and bpt tags
- *
- * @param checkString The String to unwrap
- * @return the unwrapped String
- */
- public static String unwrapString(String checkString){
- //remove the ept and bpt tags
- String[] splitted =checkString.split("(<ept ([^<>])*>)|(</ept>)|(<bpt ([^<>])*>)|(</bpt>)|(<sub([^<>])*>)|(</sub>)|(<ex ([^<>])*/>)");
- StringBuffer workBuffer= new StringBuffer();
- for(int i=0;i<splitted.length;i++){
- workBuffer.append(splitted[i]);
- }
- String string = new String(workBuffer);
- //replace Entity references
- string=string.replaceAll( "&","&").replaceAll( "<","<").replaceAll( ">",">").replaceAll( ""","\"").replaceAll( "'","'");
-
- //remove the nsub tags
- splitted =string.split("(<sub([^<>])*>)|(</sub>)");
- StringBuffer returnBuffer= new StringBuffer();
- for(int i=0;i<splitted.length;i++){
- returnBuffer.append(splitted[i]);
- }
- String returnString = new String(returnBuffer);
- return returnString;
- }
-
-
- /**
- * Wrap the dirty parts of a string
- *
- * @param checkString The String to check if there are dirty Parts to wrap
- * @return A String with wrapped dirty parts
- * @throws TagWrapperException
- * @throws IOException
- */
- public static String wrapString(String checkString) throws TagWrapperException, IOException {
- // if no wrapping should be done return the given string
- if(!doWrap) return checkString;
- // let's wrap
- String[] parts=null;
- int idx=0;
- //split the string at tag ends
- String[] parts2 = checkString.split("\\\\>");
-
- ArrayList tagString =new ArrayList();
- // put the while splitting lost parts to the end of the single strings
- for(int j=0;j<parts2.length-1;j++){
- parts2[j]+="\\>";
- }
- // same for the last string
- if (checkString.endsWith("\\>")){
- parts2[parts2.length-1]+="\\>";
- }
- // split the leading text from the real tag string (<...>)
- for(int j=0;j<parts2.length;j++){
-
- //is it just a tag
- if(parts2[j].startsWith("\\<")){
- tagString.add(parts2[j]);
- // or is it a tag with leading text?
- }else if((idx=parts2[j].indexOf("\\<"))>0&&parts2[j].indexOf("\\>")>0){
- //...then split it in two parts
- // the leading text
- tagString.add(parts2[j].substring(0,(parts2[j].indexOf("\\<"))));
- // ...and the tag
- tagString.add(parts2[j].substring(parts2[j].indexOf("\\<")));
-
- }else{
- //no tag...must be text only
- tagString.add(parts2[j]);
- }
-
- }
- ArrayList tagNames=new ArrayList();
- String item="";
- for(int i=0;i<tagString.size();i++){
- item=((String)tagString.get(i));
- int start=item.indexOf("\\<")+2;
- // check if we have an index that is ok
- if(start==1) start=-1;
- int end=item.lastIndexOf("\\>");
- if(start>=0&&end>0){
- boolean isStandalone=false;
- if(item.endsWith("/\\>")){
- // this is a standalone tag
- isStandalone=true;
- }
- item=item.substring(start,end);
-
- if(item.indexOf(" ")>0){
- item=item.substring(0,item.indexOf(" "));
- }
- if(isStandalone){
- item=item+"/";
- }
- tagNames.add(item);
- }else{
- tagNames.add("");
- }
- }
- ArrayList tagType=new ArrayList();
- for(int i=0;i<tagNames.size();i++){
- if(((String)tagNames.get(i)).equals("")){
- tagType.add("Text");
- }else if(((String)tagNames.get(i)).startsWith("/")){
- tagType.add("EndTag");
- }else if(((String)tagNames.get(i)).endsWith("/")){
- tagType.add("StartAndEndTag");
- }else {
- tagType.add("StartTag");
- }
-
- }
-
- ArrayList tagList=new ArrayList();
- for(int i=0;i<tagNames.size();i++){
- tagList.add(new Tag(
- (String)tagType.get(i),
- (String)tagNames.get(i),
- (String)tagString.get(i)));
- }
- tagType=null;
- tagNames=null;
- tagString=null;
-
- TagPair start;
- StringBuffer returnBuffer=new StringBuffer();
- while(tagList.size()>0){
- try{
- start=new TagPair(tagList);
- returnBuffer.append(start.getWrapped());
- }catch(TagPair.TagPairConstructionException e){
- throw (new DirtyTagWrapper()).new TagWrapperException(e);
- }
- }
- TagPair.resetCounter();
- return new String(returnBuffer);
- }
- /**
- * @author Christian Schmidt 2005
- *
- */
- public class TagWrapperException extends Exception {
-
- /**
- * Create a new Instance of TagWrapperException
- *
- *
- */
- public TagWrapperException() {
- super();
- //
- }
-
- /**
- * Create a new Instance of TagWrapperException
- *
- * @param arg0
- */
- public TagWrapperException(String arg0) {
- super(arg0);
- //
- }
-
- /**
- * Create a new Instance of TagWrapperException
- *
- * @param arg0
- * @param arg1
- */
- public TagWrapperException(String arg0, Throwable arg1) {
- super(arg0, arg1);
- //
- }
-
- /**
- * Create a new Instance of TagWrapperException
- *
- * @param arg0
- */
- public TagWrapperException(Throwable arg0) {
- super(arg0);
- //
- }
-
- }
-}
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java
deleted file mode 100755
index b052289..0000000
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-/*
- * Created on 2005
- * by Christian Schmidt
- */
-package com.sun.star.tooling.DirtyTags;
-
-import java.io.IOException;
-import java.util.Map;
-
-import com.sun.star.tooling.converter.ExtMap;
-
-/**
- * @author Christian Schmidt 2005
- *
- */
-public class Tag {
- private static int indent=0;
- Map tagNames;
- private String tagType;
- private String tagName;
- private String tagString;
- public static Tag EMPTYTAG=new Tag("","","");
-
- /**
- * Create a new Instance of Tag
- *
- * @param tagType
- * @param tagName
- * @param tagString
- */
- public Tag(String tagType, String tagName, String tagString) {
-
- this.tagType=tagType;
- this.tagName=tagName;
- this.tagString=tagString;
-
- tagNames=new ExtMap();
- tagNames.put("link","name");
- tagNames.put("caption","xml-lang");
- tagNames.put("alt","xml-lang");
- }
-
- public String getWrappedTagString() throws IOException{
- if(this.canHaveTranslateableContent()){
- return this.wrapTagStringIntern();
- }else{
- return xmlString(this.tagString);
- }
- }
-
- private final String xmlString( final String string) throws java.io.IOException {
- if (string == null)
- return string; // ""
- String str = string;
-
- for(int i=0;i<str.length();i++){
- if(str.charAt(i)=='&'){
- str=str.substring(0, i)+"&"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='<'){
- str=str.substring(0, i)+"<"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='>'){
- str=str.substring(0, i)+">"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='"'){
- str=str.substring(0, i)+"""+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='\''){
- str=str.substring(0, i)+"'"+str.substring(i+1);
- continue;
- }
- }
-
- return str;
- }
- /**
- * @return
- */
- private boolean canHaveTranslateableContent() {
- return (tagNames.containsKey(this.tagName));
-
- }
-
- /**
- * @throws IOException
- *
- */
- private String wrapTagStringIntern() throws IOException {
-
-
- String[] split=this.tagString.split("=");
- int length=split.length;
- // no attribute found;
- if (length==0) return xmlString(tagString);
- else{
- int i=0;
-
- while(i<length-1/*the last part can only contain an attribute value*/){
- String attributeName = split[i].trim();
- if(split[i]. indexOf("</sub>")<0) split[i]=xmlString(split[i]);
- i++;
- String value;
- attributeName=(attributeName.substring(attributeName.lastIndexOf(" ")).trim());
- if((value=translateableAttributeValue(this.tagName)).equals(attributeName)){
- int valueStart=0;
- int valueEnd=0;
-
- // get the value to the found attribute name
- // it must either be surrounded by '"'...
- if((valueStart=split[i].indexOf('"'))>=0){
- valueEnd = split[i].lastIndexOf('"');
- //...or surrounded by "'"
- }else if((valueStart=split[i].indexOf("'"))>=0){
- valueEnd = split[i].lastIndexOf("'");
- }else{
- // there seems to be an error,
- // we found an '=' (we split there) but no '"' or '''
- // but although we don't check the syntax
- // we just continue
- continue;
- }
- //ok we found the border of a value that might be translated
- //now we wrap it with the tags
-
- split[i]=xmlString(split[i].substring(0,valueStart+1))+"<sub>"+xmlString(split[i].substring(valueStart+1,valueEnd))+"</sub>"+xmlString(split[i].substring(valueEnd));
-
- }
- }
- String wrappedString="";
- // we have the wrapped parts, now we put them together
- int j=0;
- for(j=0;j<split.length-1;j++){
- wrappedString+=(split[j]+"=");
- }
- wrappedString+=split[j];
-// System.out.println(this.tagString);
-// System.out.println(wrappedString);
- return wrappedString;
- }
-
- }
-
-
-
- /**
- * @param tagName the name of the tag to check
- * @return the name of the attribute that can contain translateable value
- */
- private String translateableAttributeValue(String tagName) {
-
- return (String)this.tagNames.get(tagName);
- }
-
-
- /**
- * Create a new Instance of Tag
- *
- *
- */
- public Tag(String tagString) {
- this(extractTagType(extractTagName(tagString)),extractTagName(tagString),tagString);
- }
-
- private static String extractTagName(String tagString){
-
- int start=tagString.indexOf('<')+1;
- int end=tagString.lastIndexOf('\\');
- if(start>=0&&end>0){
- tagString=tagString.substring(start,end);
-
- if(tagString.indexOf(" ")>0){
- tagString=tagString.substring(0,tagString.indexOf(" "));
- }
- return tagString;
- }else{
- return "";
- }
- }
- private static String extractTagType(String tagName){
- if(tagName.equals("")){
- return "Text";
- }else if(tagName.startsWith("/")){
- return "EndTag";
- }else if(tagName.endsWith("/")){
- return "StartAndEndTag";
- }else {
- return "StartTag";
- }
- }
-
- /**
- * @return Returns the tagName.
- */
- public String getTagName() {
- return this.tagName;
- }
- /**
- * @return Returns the tagString.
- */
- public String getTagString() {
- return this.tagString;
- }
- /**
- * @return Returns the tagType.
- */
- public String getTagType() {
- return this.tagType;
- }
-
-
-}
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java
deleted file mode 100755
index d823901..0000000
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-/*
- * Created on 2005
- * by Christian Schmidt
- */
-package com.sun.star.tooling.DirtyTags;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-
-/**
- * @author Christian Schmidt 2005
- *
- */
-public class TagPair {
-
-
- private Tag startTag=Tag.EMPTYTAG;
- private Tag endTag=Tag.EMPTYTAG;
- private String startingText="";
- private ArrayList enclosedTags=new ArrayList();
- private long id;
- private static int ElementCounter=1;
- private String endingText="";
-
- /**
- * @author Christian Schmidt 2005
- *
- */
- public class TagPairConstructionException extends Exception {
-
- /**
- * Create a new Instance of TagPairConstructionException
- *
- * @param string
- */
- public TagPairConstructionException(String string) {
-
- }
-
- }
-
- /**
- * Create a new Instance of TagPair
- *
- *
- */
- public TagPair() {
-
- }
-
-
- /**
- * Create a new Instance of TagPair
- *
- * Find matching tags in tagList, create a TagPair of it, create
- * tagPairs from the content in the tagPair and remove all used
- * tags from tagList. The rest of the tagList starts after the
- * endTag of this TagPair.
- *
- * @param tagList a List of the tags to check
- *
- * @throws TagPairConstructionException
- */
- public TagPair(ArrayList tagList) throws TagPairConstructionException {
-
- if(tagList.size()==0){
- return;
- }
- ArrayList contentList=new ArrayList();;
- Tag tag=(Tag)tagList.get(0);
- tagList.remove(0);
-
-
- if("Text".equals(tag.getTagType())){
- // is this Text the only content
- // of this Tag ?
- if(tagList.size()==0){
- //yes...then it is the starting Text of this TagPair
- this.startingText=tag.getTagString();
- return;
- }else{
- //no...the tag is normal content
- contentList.add(tag);
- }
- this.startingText=tag.getTagString();
-
- }else if("EndTag".equals(tag.getTagType())){
- //ERRor throw EXception
- }else if("StartTag".equals(tag.getTagType())){
- // find the matching end tag
- this.startTag=tag;
- Iterator iter=tagList.iterator();
-
- int equivalentTagCounter=0;
- while(iter.hasNext()){
- //is this the end tag?
- if((tag=(Tag)iter.next()).getTagName().equals('/'+this.startTag.getTagName())&&equivalentTagCounter==0){
- //found the corresponding end tag
-
- //this TagPair is complete
- //so it needs an id
- this.id=TagPair.ElementCounter++;
- this.endTag=tag;
- //...remove it from list
- tagList.removeAll(contentList);
- tagList.remove(tag);
- break;
- }else{
- // tag is not the end tag
- // so it is between the start and the end tag
- // and belongs to the content
- // but first check if it has the same name as the current tag
- if(tag.getTagName().equals(this.startTag.getTagName())){
- // if this is a start tag like the current start tag
- // we count it to find out the matching end tag in nested tags
- if(tag.getTagType().equals("StartTag")){
- equivalentTagCounter++;
- }
- }
- if(tag.getTagName().equals("/"+this.startTag.getTagName())){
- if(tag.getTagType().equals("EndTag")){
- equivalentTagCounter--;
- }
- }
-
- contentList.add(tag);
- }
- }
- //found the end tag ?
- //no...
- if (this.endTag.getTagType()==""){
-
- throw new TagPairConstructionException("ERROR: Missing end tag ("+
- this.startTag.getTagString()+").");
- //...yes
- }else{
- //We need to check whether the content is starting or ending with text
- //...check starting with text
- if(contentList.size()>=1&&((String)((Tag)contentList.get(0)).getTagType()).equals("Text")){
- //yes...store it as startingText
- this.startingText=(String)((Tag)contentList.get(0)).getTagString();
- //remove it from list
- contentList.remove(0);
- }
- // ...check ending with text
- if(contentList.size()>=1&&((String)((Tag)contentList.get(contentList.size()-1)).getTagType()).equals("Text")){
- //yes...store it as endingText
- this.endingText=(String)((Tag)contentList.get(contentList.size()-1)).getTagString();
- //remove it from list
- contentList.remove(contentList.size()-1);
- }
- //create the list of tags enclosed by this tagPair
- createEnclosedTags(contentList);
- }
- //if stand AloneTag create own TagObject...give ID...add to List
- }else if("StartAndEndTag".equals(tag.getTagType())){
- this.startTag=tag;
- this.endTag=new Tag("EndOfStandAlone","","");
- createEnclosedTags(contentList);
- }
-
- }
-
- /**
- * @param contentList
- * @throws TagPairConstructionException
- */
- private void createEnclosedTags(ArrayList contentList) throws TagPairConstructionException {
- while(contentList.size()>0){
- //create the inner TagPairs
- this.enclosedTags.add(new TagPair(contentList));
- }
-
- }
-
- public String toString(){
- StringBuffer outString= new StringBuffer(this.startTag.toString());
- TagPair help=new TagPair();
- Iterator iter=enclosedTags.iterator();
- outString.append(this.startingText);
- while(iter.hasNext()){
- if((help=(TagPair)iter.next())==null){
- continue;
- }else{
- outString.append(help.toString());
- }
- }
- outString.append(this.endingText);
- outString.append(this.endTag.toString());
- return new String(outString);
- }
-
- public String getWrapped() throws IOException{
- Iterator iter=enclosedTags.iterator();
- StringBuffer returnBuffer=new StringBuffer();
-
- returnBuffer.append(wrap(this.startTag)+xmlString(this.startingText));
- while(iter.hasNext()){
- returnBuffer.append(((TagPair)iter.next()).getWrapped());
- }
- returnBuffer.append(xmlString(this.endingText)+wrap(this.endTag));
-
-
-
- return new String(returnBuffer);
- }
-
- private String wrap(Tag tag) throws IOException{
- String string="";
- //can be a start tag
- if(tag.getTagType().startsWith("Start")){
- return new String("<bpt id='"+this.id+"'>"+tag.getWrappedTagString()+"</bpt>");
- //...or a end tag
- }else if (tag.getTagType().startsWith("End")){
- //maybe the end tag of a Start and end tag
-// if("EndOfStandAlone".equals(tag.getTagType())){
-// return new String("<ex id='"+this.id+"'/>");
-// }else{
- string=tag.getWrappedTagString();
- return new String("<ept id='"+this.id+"'>"+string+"</ept>");
-// }
-
- //...or text
- }else{
- return xmlString(tag.getTagString());
- }
- }
- /**
- * Replaces all characters that mustn't be in XLIFF PCdata
- *
- * @param string the string to check
- * @return the checked string with all characters replaced
- * @throws java.io.IOException
- */
- private final String xmlString( final String string) throws java.io.IOException {
- if (string == null)
- return string; // ""
- String str = string;
-
- for(int i=0;i<str.length();i++){
- if(str.charAt(i)=='&'){
- str=str.substring(0, i)+"&"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='<'){
- str=str.substring(0, i)+"<"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='>'){
- str=str.substring(0, i)+">"+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='"'){
- str=str.substring(0, i)+"""+str.substring(i+1);
- continue;
- }
-
- if(str.charAt(i)=='\''){
- str=str.substring(0, i)+"'"+str.substring(i+1);
- continue;
- }
- }
-
- return str;
- }
-
- /**
- *
- */
- public static void resetCounter() {
- TagPair.ElementCounter=1;
-
- }
-
-
-}
diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java
deleted file mode 100644
index 38f140a..0000000
--- a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-/*
- * the main Class
- *
- * Command Line arguments are reviewed
- * and a Converter is constructed
- */
-package com.sun.star.tooling.converter;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Calendar;
-
-import com.sun.star.tooling.DirtyTags.DirtyTagWrapper;
-
-/**
- * The main class of the converter tool
- *
- * The converter tool is command line based.
- * Its classes allow the converting between the
- * file formats sdf, gsi and <a href="http://www.oasis-open.org/committees/xliff/documents/cs-xliff-core-1.1-20031031.htm">xliff</a>.
- *
- * Those file formats are used in localization
- * of Star-Office and Open-Office.
- *
- * Information about the whole localization process can be found in
- * <a href="http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf">http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf</a>
- *
- * @author Christian Schmidt 2005
- *
- */
-public class Convert {
-
- private static Calendar cal;
-
- private static final String EMPTY = "";
-
- /**
- * The name of the file containing the debug information
- * that where found while converting (every output goes here too)
- */
- private static String dbgName = EMPTY;
-
- /**
- * the character that separates the extension from the file name
- */
- private static final char extensionSeperator = '.';
-
- /**
- * the log File
- */
- private static File log;
-
- /**
- * the name of the log file
- */
- private static String logString = EMPTY;
-
- /**
- * indicates whether existing sources should be overwritten
- * without asking
- */
- private static boolean overwrite = false;
-
- /**
- * A second Source File needed for GSI Merging
- */
- private static File secondSource;
-
- //private static final char pathSeperator = '\\';
-
- /**
- * The language that should be the source language
- * that means the language to translate from
- */
- private static String sourceLanguage = "en-US";
-
- /**
- * the name of the source file
- */
- private static String sourceName = EMPTY;
-
- /**
- * the type of the source file (sdf,xliff,...)
- */
- private static String sourceType = EMPTY;
-
- /**
- * The time when converting started
- */
- private static String startTime = EMPTY;
- /**
- * The language that should be the target language
- * that means the language to translate to
- */
- private static String TargetLanguage = EMPTY;
-
- /**
- * the name of the target file
- */
- private static String targetName = EMPTY;
-
- /**
- * the type of the target file (sdf,xliff,...)
- */
- private static String targetType = EMPTY;
-
- /**
- * Store the current version ID and number of this tool
- */
- final static String version = " Prod.20050710:1255 ";
-
- /**
- * The name of the (original) sdf file used as second source for gsi->sdf merging
- */
- private static String secondSourceName=EMPTY;
- /**
- * Indicate whether strings in xliff files should
- * be wrapped with ept/bpt or sub tags to enable translation tools
- * to synchronize source language string with there translation
- *
- * @see <a href="http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf">http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf</a>
- */
- private static boolean doWrap=true;
-
-
-
- public static void main(String[] args) throws IOException, Exception {
- try{
-
- //go, parse and check the command line parameters
- ParameterChecker.checkClParameters(args);
- ParameterChecker.createContentOfClParameters();
- //Initialize the tagWrapper
- DirtyTagWrapper.setWrapping(doWrap);
- //create an instance of converter
- Converter conv = new Converter(sourceType, sourceName, sourceLanguage,
- targetType, targetName, TargetLanguage,secondSourceName, overwrite);
- // get aktual time
- cal = Calendar.getInstance();
- startTime = cal.getTime().toString();
- //show infos
- printPreamble();
- //do the job
- conv.convert();
-
- showStatistic();
-
- //close log, debug...
- OutputHandler.closeAll();
-
- } catch(Exception e){
- System.out.print("An EXCEPTION occurred, please check your commad line settings \n"+e.getMessage());
- System.exit(-1);
- }catch(Throwable t){
- System.out.print("A FATAL ERROR occurred, please check your commad line settings \n"+t.getMessage());
- System.exit(-1);
- }
-
- }
-
- /**
- * show the command line help
- */
- private static void printHelp() {
-
- final String ls = System.getProperty("line.separator");
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list