[Schmitzm-commits] r1259 - in trunk: src/schmitzm/lang src_junit/schmitzm/lang src_junit/schmitzm/lang/resource src_junit/schmitzm/lang/resource/locales

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Nov 10 23:38:10 CET 2010


Author: mojays
Date: 2010-11-10 23:38:08 +0100 (Wed, 10 Nov 2010)
New Revision: 1259

Added:
   trunk/src/schmitzm/lang/ResourceProviderOperator.java
   trunk/src_junit/schmitzm/lang/resource/
   trunk/src_junit/schmitzm/lang/resource/locales/
   trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle.properties
   trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_de.properties
   trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_fr.properties
   trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_it.properties
   trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_ru.properties
Modified:
   trunk/src/schmitzm/lang/ResourceProvider.java
Log:
new ResourceProviderOperator


Modified: trunk/src/schmitzm/lang/ResourceProvider.java
===================================================================
--- trunk/src/schmitzm/lang/ResourceProvider.java	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src/schmitzm/lang/ResourceProvider.java	2010-11-10 22:38:08 UTC (rev 1259)
@@ -774,7 +774,7 @@
 		
 		// determine the exact package URL on the file system
         String newBundleName = bundleName;
-        if ( l != null) 
+        if ( l != null && !"".equals(l.toString()) ) 
           newBundleName += "_" + l.toString();
         newBundleName += ".properties";
         

Added: trunk/src/schmitzm/lang/ResourceProviderOperator.java
===================================================================
--- trunk/src/schmitzm/lang/ResourceProviderOperator.java	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src/schmitzm/lang/ResourceProviderOperator.java	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,394 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Martin O. J. Schmitz.
+ * 
+ * This file is part of the SCHMITZM library - a collection of utility 
+ * classes based on Java 1.6, focusing (not only) on Java Swing 
+ * and the Geotools library.
+ * 
+ * The SCHMITZM project is hosted at:
+ * http://wald.intevation.org/projects/schmitzm/
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License (license.txt)
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * or try this link: http://www.gnu.org/licenses/lgpl.html
+ * 
+ * Contributors:
+ *     Martin O. J. Schmitz - initial API and implementation
+ *     Stefan A. Krüger - additional utility classes
+ ******************************************************************************/
+
+package schmitzm.lang;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+import schmitzm.io.IOUtil;
+
+/**
+ * This class is a main program, that performs several administrative
+ * functions on the bundle files of {@link ResourceProvider}:
+ * <ul>
+ *   <li>remove all keys (from all language files) which are
+ *       marked with "REMOVEME_" prefix in the root bundle.</li>
+ * </ul>
+ * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
+ *
+ */
+public class ResourceProviderOperator  {
+  private static final String CFG_KEY_RESOURCE_BUNDLES_SEP = ";";
+  private static final String CFG_KEY_RESOURCE_BUNDLES = "resource.bundles";
+  private static final String CFG_KEY_RESOURCE_BUNDLES_ROOT_LOCALE = "resource.bundles.root.locale";
+  private static final String CFG_KEY_RESOURCE_BUNDLES_ROOT_FOLDER = "resource.bundles.root.folder";
+  private static final String CFG_KEY_REMOVE_KEYS_INDICATOR_PREFIX = "remove.keys.indicator.prefix";
+
+  
+  
+  protected static final Logger LOGGER = LangUtil.createLogger(ResourceProviderOperator.class);
+
+  protected ResourceProvider[] resourceBundles = new ResourceProvider[0];
+  protected String   removeIndicatorPrefix = "REMOVEME_";
+  protected File     resourceBundlesRootFolder = null;
+  
+  
+  /**
+   * Sets the resource bundles to perform the operations on.
+   */
+  public void setResourceBundles(ResourceProvider[] resourceBundles) {
+    if ( resourceBundles == null )
+      resourceBundles = new ResourceProvider[0];
+    this.resourceBundles = resourceBundles;
+  }
+  
+  /**
+   * Sets the resource bundles to perform the operations on.
+   */
+  public void setResourceBundles(String[] resourceBundleNames, Locale rootLocale) {
+    if ( resourceBundleNames == null ) {
+      setResourceBundles((ResourceProvider[])null);
+      return;
+    }
+    this.resourceBundles = new ResourceProvider[resourceBundleNames.length];
+    for (int i=0; i<resourceBundleNames.length; i++) {
+      this.resourceBundles[i] = ResourceProvider.newInstance(
+          resourceBundleNames[i], rootLocale
+      );
+    }
+  }
+  
+  /**
+   * Returns the resource bundles to perform the operations on.
+   */
+  public ResourceProvider[] getResourceBundles() {
+    return this.resourceBundles;
+  }
+
+  /**
+   * Sets the prefix string the keys, which should be removed, are marked
+   * with.
+   */
+  public void setRemoveIndicatorPrefix(String removeIndicatorPrefix) {
+    this.removeIndicatorPrefix = removeIndicatorPrefix;
+  }
+  
+  /**
+   * Returns the prefix string the keys, which should be removed, are marked
+   * with.
+   */
+  public String getRemoveIndicatorPrefix() {
+    if ( removeIndicatorPrefix == null )
+      return "";
+    return this.removeIndicatorPrefix;
+  }
+
+  /**
+   * Sets the root folder (on the local file system) the resource bundles
+   * are relatively determined from.
+   */
+  public void setResourceBundlesRootFolder(File resourceBundlesRootFolder) {
+    this.resourceBundlesRootFolder = resourceBundlesRootFolder;
+  }
+
+  /**
+   * Returns the root folder (on the local file system) the resource bundles
+   * are relatively determined from.
+   */
+  public File getResourceBundlesRootFolder() {
+    return resourceBundlesRootFolder;
+  }
+  
+  /**
+   * Removes all keys from the resource bundle files, which are marked with the
+   * special prefix. The mark is only needed in the root resource bundle.
+   * The keys are automatically removed from the sub-language bundles, too. 
+   * @see #setRemoveIndicatorPrefix(String)
+   */
+  public void processRemoveUnusedKeys() throws Exception {
+    for (ResourceProvider rp : getResourceBundles())
+      processRemoveUnusedKeys(rp);
+  }
+  
+  /**
+   * 
+   */
+  protected void processRemoveUnusedKeys(ResourceProvider rp) throws Exception {
+    // First: Determine all keys which must be removed, either with
+    //        or without the prefix
+    String removeIndicator = getRemoveIndicatorPrefix();
+    Set<String> keysToRemove = new HashSet<String>();
+    for ( String key : rp.getKeys() )
+      if ( key.startsWith( removeIndicator ) ) {
+        // The keys which are marked explicitly with the
+        // indicator must be removed as well as the
+        // "originals" (in the sub-bundles)
+        // --> so add both to ''eysToRemove
+        keysToRemove.add( key );
+        keysToRemove.add( eliminateRemoveIndicator(key) );
+      }
+
+    // Remove keys from the root bundle
+    processRemoveUnusedKeys(rp,null,keysToRemove);
+    // Remove keys from the language sub-bundles
+    for (Locale locale : rp.getAvailableLocales(false))
+      processRemoveUnusedKeys(rp,locale,keysToRemove);
+  }
+  
+  /**
+   * 
+   */
+  protected void processRemoveUnusedKeys(ResourceProvider rp, Locale locale, Set<String> keysToRemove) throws Exception {
+    if ( locale == null )
+      locale = new Locale("");
+
+    // To check for existing keys in the specified locale, create a new
+    // ResourceProvider explicitly for this locale to avoid fallback!
+    ResourceProvider checkBundle = rp;
+    if ( !"".equals(locale.toString()) )
+      checkBundle = new ResourceProvider(
+          rp.getDefaultBundleName()+"_"+locale.toString(),
+          locale,
+          false,
+          "???",
+          false
+      );
+
+    // split the key/value pairs of the bundle in the removed
+    // pairs and the remaining pairs
+    Properties removedKeys = new Properties();
+    Properties remainingKeys = new Properties();
+    checkBundle.setIgnoreMissingResource(false);
+    for ( String key : checkBundle.getKeys() ) {
+      String value = null;
+      try {
+        value = checkBundle.getString(key, locale);
+      } catch (MissingResourceException err) {
+        // Key not defined in specified explicitly for the locale
+        // --> ignore key
+        continue;
+      }
+      
+      // add key/value to removing or remaining pairs
+      if ( keysToRemove.contains(key) )
+        // ignore the prefix of the removing key
+        removedKeys.put( eliminateRemoveIndicator(key), value);
+      else
+        remainingKeys.put(key, value);
+    }
+
+    // store remaining pairs
+    File bundleFile = ResourceProvider.getPropertyFile(rp, locale, getResourceBundlesRootFolder());
+    String comments = getInitialCommentLines(bundleFile, "#", true);
+//    FileWriter remainingKeysOutput = new FileWriter(bundleFile,false);
+    FileWriter remainingKeysOutput = new FileWriter( IOUtil.changeFileExt(bundleFile, "remainingKeys"), false );
+    remainingKeysOutput.write(comments); // write comments as their were
+    if ( !"".equals(comments) )
+      remainingKeysOutput.write("\n");
+    remainingKeys.store(
+        remainingKeysOutput,
+        "Revised by "+LangUtil.getSimpleClassName(this)+" (Unused keys removed)");
+    remainingKeysOutput.flush();
+    remainingKeysOutput.close();
+      
+    // store removed pairs
+    File removedKeysFile = IOUtil.changeFileExt(bundleFile, "removedKeys");
+    FileWriter removedKeysOutput = new FileWriter(removedKeysFile,true);
+    removedKeys.store(
+        removedKeysOutput,
+        "======================================================\n" +
+        "Removed Keys: "+rp.getDefaultBundleName()
+    );
+    removedKeysOutput.flush();
+    removedKeysOutput.close();
+    
+    LOGGER.info("Removed "+removedKeys.size()+" keys from bundle '"+rp.getDefaultBundleName()+"' ("+locale+") --> "+bundleFile.getAbsolutePath());
+  }
+
+
+  /**
+   * Returns the key without the remove indicator prefix, if the key
+   * starts with it. Otherwise the given key is returned unchanged.
+   */
+  private String eliminateRemoveIndicator(String key) {
+    String removeIndicator = getRemoveIndicatorPrefix();
+    if ( key.startsWith( removeIndicator ) )
+      return key.substring( removeIndicator.length() );
+    return key;
+  }
+  
+  private String getInitialCommentLines(File file, String commentPrefix, boolean includeEmptyLines) throws IOException {
+    StringBuffer commentLines = new StringBuffer();
+    BufferedReader reader = new BufferedReader( new FileReader(file) );
+    String line = null;
+    while ( reader.ready() && (line = reader.readLine()) != null ) {
+      if ( line.startsWith(commentPrefix) ||
+           includeEmptyLines && line.trim().equals("") )
+        commentLines.append( line ).append("\n");
+      else
+        break;
+    }
+    reader.close();
+    return commentLines.toString();
+  }
+  
+  /**
+   * Starts an operation on resource bundle files.
+   * @param args command line arguments
+   */
+  public static void main(String[] args) throws Exception {
+    LangUtil.initializeDefaultLogger(Level.DEBUG,null);
+
+    // TODO: implement complex command line arguments (via CLI)
+    //       currently only a properties file is used
+    if ( args.length < 1 )
+      throw new UnsupportedOperationException("Config file required as only command line parameter!");
+
+    // Configuration from config file
+    ResourceProviderOperator rpo = initResourceOperator(null, args[0]);
+    // Configuration from command line parameters (overwrite config file
+    // configuration)
+    initResourceOperator(rpo, (Object)null);
+    // Perform the operation
+    // TODO: implement several commands
+    //       currently only key removal supported.
+    rpo.processRemoveUnusedKeys();
+  
+    // TODO: when a special command line parameter "-s <file>" is set
+    //       then store the configuration in the specified file
+//    rpo.setResourceBundles( new ResourceProvider[] {SwingUtil.RESOURCE,LangUtil.RESOURCE} );
+//    storeResourceOperator(rpo, new File(args[0]));
+
+  }
+  
+  /**
+   * Configures a {@link ResourceProviderOperator} from configuration property
+   * file.
+   * @param rpo {@link ResourceProviderOperator} to configure (if {@code null} a
+   *            new {@link ResourceProviderOperator} is created and returned)
+   * @param configFile property file with the configuration
+   */
+  public static ResourceProviderOperator initResourceOperator(ResourceProviderOperator rpo, String configFile) {
+    if ( rpo == null )
+      rpo = new ResourceProviderOperator();
+    
+    FileInputStream input = null;
+    try {
+      input = new FileInputStream( new File(configFile) );
+      Properties parameters = new Properties();
+      parameters.load(input);
+      
+      // Configure the ResourceProviderOperator
+      String removeIndicatorPrefix = parameters.getProperty(CFG_KEY_REMOVE_KEYS_INDICATOR_PREFIX);
+      if ( removeIndicatorPrefix != null )
+        rpo.setRemoveIndicatorPrefix(removeIndicatorPrefix);
+      String resourceBundleRootFolder = parameters.getProperty(CFG_KEY_RESOURCE_BUNDLES_ROOT_FOLDER);
+      if ( resourceBundleRootFolder != null )
+        rpo.setResourceBundlesRootFolder(new File(resourceBundleRootFolder));
+      else
+        rpo.setResourceBundlesRootFolder(new File("."));
+      String resourceBundlesList = parameters.getProperty(CFG_KEY_RESOURCE_BUNDLES);
+      if ( resourceBundlesList != null ) {
+        String[] resourceBundles = resourceBundlesList.split(CFG_KEY_RESOURCE_BUNDLES_SEP);
+        String   rootLocale      = parameters.getProperty(CFG_KEY_RESOURCE_BUNDLES_ROOT_LOCALE);
+        rpo.setResourceBundles(
+            resourceBundles,
+            rootLocale != null ? new Locale(rootLocale) : null
+        );
+      }
+    } catch (IOException err) {
+      LOGGER.error(err.getMessage());
+    }
+    
+    return rpo;
+  }
+
+  /**
+   * Configures a {@link ResourceProviderOperator} from command line parameters.
+   * @param rpo {@link ResourceProviderOperator} to configure (if {@code null} a
+   *            new {@link ResourceProviderOperator} is created and returned)
+   * @param cli command line parameters
+   */
+  public static ResourceProviderOperator initResourceOperator(ResourceProviderOperator rpo, Object cli) {
+    if ( rpo == null )
+      rpo = new ResourceProviderOperator();
+
+    // TODO: implement with CLI
+    
+    return rpo;
+  }
+
+  /**
+   * Stores the {@link ResourceProviderOperator} configuration in
+   * a property file.
+   * @param rpo {@link ResourceProviderOperator} to store the configuration for (
+   *            {@code null} not allowed)
+   * @param cli command line parameters
+   */
+  public static void storeResourceOperator(ResourceProviderOperator rpo, File outFile) throws IOException {
+    FileWriter output = null;
+    try {
+      Properties config = new Properties();
+      output = new FileWriter(outFile);
+      if ( rpo.getRemoveIndicatorPrefix() != null )
+        config.put(CFG_KEY_REMOVE_KEYS_INDICATOR_PREFIX, rpo.getRemoveIndicatorPrefix());
+      if ( rpo.getResourceBundlesRootFolder() != null )
+        config.put(CFG_KEY_RESOURCE_BUNDLES_ROOT_FOLDER, rpo.getResourceBundlesRootFolder().getPath());
+      if ( rpo.getResourceBundles().length > 0 ) {
+        config.put(CFG_KEY_RESOURCE_BUNDLES, LangUtil.stringConcatWithSep(CFG_KEY_RESOURCE_BUNDLES_SEP, rpo.getResourceBundles()));
+        ResourceProvider sample = rpo.getResourceBundles()[0];
+        if ( sample.getRootLocale() != null )
+          config.put(CFG_KEY_RESOURCE_BUNDLES_ROOT_LOCALE, sample.getRootLocale().toString());
+        
+        ClassLoader.getSystemResource(sample.getBundlePackage());
+      }
+        
+      config.store(output, "Configuration for ResourceProviderOperator");
+      output.flush();
+    } finally {
+      if ( output != null ) output.close();
+    }
+  }
+
+}
+

Added: trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle.properties
===================================================================
--- trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle.properties	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle.properties	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,48 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+REMOVEME_OperationTree.Integer=Integer
+OperationTree.Number=Number
+OperationTree.err.ParseErrorMess=Parse-Error at "${0}": ${1}
+OperationTree.err.UnexpectedEOR=Unexpected end of rule!
+OperationTree.err.UnexpectedError=Unexpected error!
+OperationTree.err.TokenNotExpected=${0} not expected
+OperationTree.err.MoreParamsExpected=${0} more function parameters expected. Bracket can not close!
+OperationTree.err.UnexpectedBracket=Bracket ${0} can not close ${1}
+OperationTree.err.BracketsNotClosed=Bracket(s) not closed: ${0}
+OperationTree.err.IllegalOperator=Illegal operator ${0}
+OperationTree.err.IllegalOperatorSyntax=Illegal ${0} syntax '${1}'
+REMOVEME_OperationTree.err.ParamSepExpected=Parameter-Separator expected
+OperationTree.err.IllegalCharacter=Illegal character '${0}' (${1} expected)
+
+OperationTree.err.UnknownNode=Unknown operation tree node: ${0}
+OperationTree.err.UnknownOperator=Unknown operator: ${0}
+OperationTree.err.UnknownAliasOperator=Unknown alias operator: ${0}
+REMOVEME_OperationTree.err.LessParams1=At least ${0} function parameters expected: ${1}(..)
+OperationTree.err.LessParams2=${0} function parameters expected: ${1}(..)
+OperationTree.err.IllegalParam=Illegal parameter ${0} for ${1}(..): ${2} expected

Added: trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_de.properties
===================================================================
--- trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_de.properties	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_de.properties	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,81 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focussing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+# ------------------------------------------------
+# ------ German Translations for components ------
+# ------ in Package schmitzm.lang           ------
+# ------------------------------------------------
+
+# --- Translations for OperationTree / OperationTreeParser
+OperationTree.Integer=Ganzzahl
+OperationTree.Number=Numerisch
+OperationTree.err.ParseErrorMess=Parser-Fehler bei "${0}": ${1}
+OperationTree.err.UnexpectedEOR=Unerwartetes Ende der Formel!
+OperationTree.err.UnexpectedError=Unerwarteter Fehler!
+OperationTree.err.TokenNotExpected=${0} nicht erlaubt
+OperationTree.err.MoreParamsExpected=Noch ${0} Funtionsparameter notwendig. Klammer kann nicht schliessen!
+OperationTree.err.UnexpectedBracket=Klammer ${0} kann ${1} nicht schliessen
+OperationTree.err.BracketsNotClosed=Klammer(n) werden nicht geschlossen: ${0}
+OperationTree.err.IllegalOperator=Ung\u00FCltiger Operator ${0}
+OperationTree.err.IllegalOperatorSyntax=Fehlerhafte ${0} Syntax '${1}'
+OperationTree.err.ParamSepExpected=Parameter-Trennzeichen erwartet
+OperationTree.err.IllegalCharacter=Ung\u00FCltiges Zeichen '${0}' (${1} erwartet)
+
+OperationTree.err.UnknownNode=Unbekannter Operator-Knoten: ${0}
+OperationTree.err.UnknownOperator=Unbekannter Operator: ${0}
+OperationTree.err.UnknownAliasOperator=Unbekannter Alias-Operator: ${0}
+OperationTree.err.LessParams1=Mindestens ${0} Funktionsparameter ben\u00F6tigt\: ${1}(..)
+OperationTree.err.LessParams2=${0} Funktionsparameter ben\u00F6tigt\: ${1}(..)
+OperationTree.err.IllegalParam=Illegaler Funktionsparameter ${0} f\u00FCr ${1}(..)\: ${2} erwartet

Added: trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_fr.properties
===================================================================
--- trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_fr.properties	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_fr.properties	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,78 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focussing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Martin O. J. Schmitz - initial API and implementation
+#    Stefan A. Tzeggai - additional utility classes
+##########
+# -----------------------------------------------------------
+# ------ Default Translations (english) for components ------
+# ------ in Package schmitzm.lang                      ------
+# -----------------------------------------------------------
+OperationTree.Integer=Entier
+OperationTree.Number=Num\u00E9rique
+OperationTree.err.BracketsNotClosed=Parenth\u00E8se(s) n'est ou ne sont pas ferm\u00E9e(s)\: ${0}
+OperationTree.err.IllegalCharacter=Symbole invalide '${0}' (${1} attendu)");
+OperationTree.err.IllegalOperator=Operateur non valide ${0}
+OperationTree.err.IllegalOperatorSyntax=Syntaxe ${0} erron\u00E9e'${1}'
+OperationTree.err.IllegalParam=Faux param\u00E8tres de fonction ${0} attendu pour ${1}(..)\: ${2}
+OperationTree.err.LessParams1=Aumoins ${0} param\u00E8tres de fonction n\u00E9cessaires\: ${1}(..)
+OperationTree.err.LessParams2=${0} param\u00E8tres de fonction n\u00E9cessaires\: ${1}(..)
+OperationTree.err.MoreParamsExpected=Encore ${0} param\u00E8tre(s) de fonction n\u00E9cessaire(s).Parenth\u00E8se ne peut pas se fermer\!
+OperationTree.err.ParamSepExpected= S\u00E9parateur de param\u00E8tres attendu
+OperationTree.err.ParseErrorMess=Erreur d'analyse chez "${0}": ${1}
+OperationTree.err.TokenNotExpected= ${0} pas autoris\u00E9
+OperationTree.err.UnexpectedBracket=Parenth\u00E8se ne ${0} peut ${1} pas se fermer
+OperationTree.err.UnexpectedEOR=Fin de formule inattendue!
+OperationTree.err.UnexpectedError=Erreur inattendue!
+OperationTree.err.UnknownAliasOperator=Alias d'op\u00E9rateur inconnu\: ${0}
+OperationTree.err.UnknownNode=Noeuds d'op\u00E9rateurs inconnus\: ${0}
+OperationTree.err.UnknownOperator=Op\u00E9rateur inconnu\: ${0}

Added: trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_it.properties
===================================================================
--- trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_it.properties	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_it.properties	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,55 @@
+##########
+#Copyright (c) 2009 Martin O. J. Schmitz.
+#
+#This file is part of the SCHMITZM library - a collection of utility 
+#classes based on Java 1.6, focusing (not only) on Java Swing 
+#and the Geotools library.
+#
+#The SCHMITZM project is hosted at:
+#http://wald.intevation.org/projects/schmitzm/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Annica Sahlin
+##########
+
+# -------------------------------------------------
+# ------ Italian Translations for components ------
+# ------ in Package schmitzm.lang            ------
+# -------------------------------------------------
+
+# --- Translations for OperationTree / OperationTreeParser
+OperationTree.Integer=Integro
+OperationTree.Number=Numero
+OperationTree.err.BracketsNotClosed=Parentesi(s) non \u00e8 chiusa: ${0}
+OperationTree.err.IllegalCharacter=Carattere non accettato '${0}' (${1} expected)");
+OperationTree.err.IllegalOperator=Operatore non accettato ${0}
+OperationTree.err.IllegalOperatorSyntax=Sintassi non accettato ${0} '${1}'
+OperationTree.err.IllegalParam=Parametro non accettato ${0} per ${1}(..): ${2} expected
+OperationTree.err.LessParams1=Almeno ${0} parametri di funzione sono richiesti: ${1}(..)
+OperationTree.err.LessParams2=${0} parametri di funzione richiesti: ${1}(..)
+OperationTree.err.MoreParamsExpected= ${0} ulteriori parametri di funzione richiesti. Parentesi non pu\u00f2 essere chiusa!
+OperationTree.err.ParamSepExpected=Separatore di parametro richiesto
+OperationTree.err.ParseErrorMess=Errore di analisi in "${0}": ${1}
+OperationTree.err.TokenNotExpected=${0} non richiesto
+OperationTree.err.UnexpectedBracket=Parentesi ${0} non pu\u00f2 essere chiusa ${1}
+OperationTree.err.UnexpectedEOR=Inaspettata chiusura di rule!
+OperationTree.err.UnexpectedError=Errore inaspettato!
+OperationTree.err.UnknownAliasOperator=Operatore alias non conosciuto: ${0}
+OperationTree.err.UnknownNode=Operazione sconosciuta tree node: ${0}
+OperationTree.err.UnknownOperator=Operatore non conosciuto: ${0}
+

Added: trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_ru.properties
===================================================================
--- trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_ru.properties	2010-11-10 12:31:14 UTC (rev 1258)
+++ trunk/src_junit/schmitzm/lang/resource/locales/TestLangResourceBundle_ru.properties	2010-11-10 22:38:08 UTC (rev 1259)
@@ -0,0 +1,57 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2010 Stefan A. Tzeggai.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the GNU Lesser Public License v2.1
+# which accompanies this distribution, and is available at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
+# 
+# Contributors:
+#     Stefan A. Tzeggai - initial API and implementation
+#-------------------------------------------------------------------------------
+##########
+#Copyright (c) 2009 Stefan A. Tzeggai.
+#
+#This file is part of the AtlasViewer application - A GIS viewer application targeting at end-users with no GIS-experience. Its main purpose is to present the atlases created with the Geopublisher application.
+#http://www.geopublishing.org
+#
+#AtlasViewer is part of the Geopublishing Framework hosted at:
+#http://wald.intevation.org/projects/atlas-framework/
+#
+#This program is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public License
+#as published by the Free Software Foundation; either version 3
+#of the License, or (at your option) any later version.
+#
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#GNU General Public License for more details.
+#
+#You should have received a copy of the GNU Lesser General Public License (license.txt)
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#or try this link: http://www.gnu.org/licenses/lgpl.html
+#
+#Contributors:
+#    Lazarev Evgeny, FGUP UralGeoInform
+##########
+
+OperationTree.err.BracketsNotClosed=\u0421\u043A\u043E\u0431\u043A\u0430(\u0438) \u043D\u0435 \u0437\u0430\u043A\u0440\u044B\u0442\u0430(\u044B)\: ${0}
+OperationTree.err.IllegalCharacter=\u041D\u0435 \u0432\u0435\u0440\u043D\u044B\u0439 \u0441\u0438\u043C\u0432\u043E\u043B '${0}' (\u043E\u0436\u0438\u0434\u0430\u043B\u0441\u044F ${1})");
+OperationTree.err.IllegalOperatorSyntax=\u041D\u0435 \u0432\u0435\u0440\u043D\u044B\u0439 ${0} \u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441 '${1}'
+OperationTree.err.IllegalOperator=\u041D\u0435 \u0432\u0435\u0440\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 ${0}
+OperationTree.err.IllegalParam=\u041D\u0435 \u0432\u0435\u0440\u043D\u044B\u0439 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 ${0} \u0434\u043B\u044F ${1}(..)\: \u043E\u0436\u0438\u0434\u0430\u043B\u0441\u044F ${2}
+OperationTree.err.LessParams1=\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043A\u0430\u043A \u043C\u0438\u043D\u0438\u043C\u0443\u043C ${0} \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0444\u0443\u043D\u043A\u0446\u0438\u0438\: ${1}(..)
+OperationTree.err.LessParams2=\u041E\u0436\u0430\u0434\u0430\u043B\u043E\u0441\u044C ${0} \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0444\u0443\u043D\u043A\u0446\u0438\u0438\: ${1}(..)
+OperationTree.err.MoreParamsExpected=\u041E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u0431\u043E\u043B\u0435\u0435 ${0} \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0444\u0443\u043D\u043A\u0446\u0438\u0438. \u0421\u043A\u043E\u0431\u043A\u0430 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0431\u044B\u0442\u044C \u0437\u0430\u043A\u0440\u044B\u0442\u0430\!
+OperationTree.err.ParamSepExpected=\u041E\u0436\u0438\u0434\u0430\u043B\u0441\u044F \u0440\u0430\u0437\u0434\u0435\u043B\u0438\u0442\u0435\u043B\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432
+OperationTree.err.ParseErrorMess=\u041E\u0448\u0438\u0431\u043A\u0430 \u0440\u0430\u0437\u043E\u0431\u0440\u0430 \u0432 "${0}"\: ${1}
+OperationTree.err.TokenNotExpected=\u041D\u0435 \u043E\u0436\u0438\u0434\u0430\u043B\u0441\u044F ${0}
+OperationTree.err.UnexpectedBracket=\u0421\u043A\u043E\u0431\u043A\u0430 ${0} \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0437\u0430\u043A\u0440\u044B\u0432\u0430\u0442\u044C ${1}
+OperationTree.err.UnexpectedEOR=\u041D\u0435\u043E\u0436\u0438\u0434\u0430\u043D\u043D\u044B\u0439 \u043A\u043E\u043D\u0435\u0446 \u043F\u0440\u0430\u0432\u0438\u043B\u0430\!
+OperationTree.err.UnexpectedError=\u041D\u0435\u043E\u0436\u0438\u0434\u0430\u043D\u043D\u0430\u044F \u043E\u0448\u0438\u0431\u043A\u0430\!
+OperationTree.err.UnknownAliasOperator=\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440 \u043C\u0435\u0442\u043A\u0438\: ${0}
+OperationTree.err.UnknownNode=\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044F \u043D\u0430 \u0432\u0435\u0442\u043A\u0435\: ${0}
+OperationTree.err.UnknownOperator=\u041D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0439 \u043E\u043F\u0435\u0440\u0430\u0442\u043E\u0440\: ${0}
+OperationTree.Integer=\u0426\u0435\u043B\u043E\u0435
+OperationTree.Number=\u0427\u0438\u0441\u043B\u043E



More information about the Schmitzm-commits mailing list