directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r721126 - in /directory/studio/trunk/schemaeditor/src/main: java/org/apache/directory/studio/schemaeditor/view/wrappers/ resources/org/apache/directory/studio/schemaeditor/view/wrappers/
Date Thu, 27 Nov 2008 09:09:41 GMT
Author: felixk
Date: Thu Nov 27 01:09:40 2008
New Revision: 721126

URL: http://svn.apache.org/viewvc?rev=721126&view=rev
Log:
- Externalize Strings
- Add German translation

Added:
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
  (with props)
    directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/
    directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
  (with props)
    directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
  (with props)
Modified:
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java?rev=721126&r1=721125&r2=721126&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/AttributeTypeWrapper.java
Thu Nov 27 01:09:40 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
+import org.eclipse.osgi.util.NLS;
 
 
 /**
@@ -121,6 +122,7 @@
      */
     public String toString()
     {
-        return "AttributeTypeWrapper: " + attributeType + " - parent: " + fParent;
+        return NLS.bind(
+            Messages.getString( "AttributeTypeWrapper.AttributeTypeWrapper" ), new Object[]
{ attributeType, fParent } ); //$NON-NLS-1$
     }
 }

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java?rev=721126&r1=721125&r2=721126&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Folder.java
Thu Nov 27 01:09:40 2008
@@ -20,6 +20,9 @@
 package org.apache.directory.studio.schemaeditor.view.wrappers;
 
 
+import org.eclipse.osgi.util.NLS;
+
+
 /**
  * This used to represent a folder in a TreeViewer.
  *
@@ -43,12 +46,7 @@
     private FolderType type = FolderType.NONE;
 
     /** The name of the Folder */
-    private String name = "";
-
-    private static final String NAME_AT = "Attribute Types";
-    private static final String NAME_OC = "Object Classes";
-    private static final String NAME_ERROR = "Errors";
-    private static final String NAME_WARNING = "Warnings";
+    private String name = ""; //$NON-NLS-1$
 
 
     /**
@@ -67,16 +65,16 @@
         switch ( type )
         {
             case ATTRIBUTE_TYPE:
-                name = NAME_AT;
+                name = Messages.getString( "Folder.AttributeTypes" ); //$NON-NLS-1$
                 break;
             case OBJECT_CLASS:
-                name = NAME_OC;
+                name = Messages.getString( "Folder.ObjectClasses" ); //$NON-NLS-1$
                 break;
             case ERROR:
-                name = NAME_ERROR;
+                name = Messages.getString( "Folder.Errors" ); //$NON-NLS-1$
                 break;
             case WARNING:
-                name = NAME_WARNING;
+                name = Messages.getString( "Folder.Warnings" ); //$NON-NLS-1$
                 break;
         }
     }
@@ -174,7 +172,6 @@
 
         return result;
     }
-    
 
 
     /* (non-Javadoc)
@@ -182,6 +179,6 @@
      */
     public String toString()
     {
-        return "Folder: " + type + " - parent: " + fParent;
+        return NLS.bind( Messages.getString( "Folder.Folder" ), new Object[] { type, fParent
} ); //$NON-NLS-1$
     }
 }

Added: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java?rev=721126&view=auto
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
(added)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
Thu Nov 27 01:09:40 2008
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.schemaeditor.view.wrappers;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public class Messages
+{
+    private static final String BUNDLE_NAME = "org.apache.directory.studio.schemaeditor.view.wrappers.messages";
//$NON-NLS-1$
+
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME
);
+
+
+    private Messages()
+    {
+    }
+
+
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+}

Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/Messages.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java?rev=721126&r1=721125&r2=721126&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/ObjectClassWrapper.java
Thu Nov 27 01:09:40 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.studio.schemaeditor.model.ObjectClassImpl;
+import org.eclipse.osgi.util.NLS;
 
 
 /**
@@ -121,6 +122,7 @@
      */
     public String toString()
     {
-        return "ObjectClassWrapper: " + objectClass + " - parent: " + fParent;
+        return NLS.bind(
+            Messages.getString( "ObjectClassWrapper.ObjectWrapperClass" ), new Object[] {
objectClass, fParent } ); //$NON-NLS-1$
     }
 }

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java?rev=721126&r1=721125&r2=721126&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wrappers/SchemaWrapper.java
Thu Nov 27 01:09:40 2008
@@ -21,6 +21,7 @@
 
 
 import org.apache.directory.studio.schemaeditor.model.Schema;
+import org.eclipse.osgi.util.NLS;
 
 
 /**
@@ -121,6 +122,6 @@
      */
     public String toString()
     {
-        return "SchemaWrapper: " + schema + " - parent: " + fParent;
+        return NLS.bind( Messages.getString( "SchemaWrapper.SchemaWrapper" ), new Object[]
{ schema, fParent } ); //$NON-NLS-1$
     }
 }

Added: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties?rev=721126&view=auto
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
(added)
+++ directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
Thu Nov 27 01:09:40 2008
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+AttributeTypeWrapper.AttributeTypeWrapper=AttributeTypeWrapper: {0} - parent: {1}
+Folder.AttributeTypes=Attribute Types
+Folder.Errors=Errors
+Folder.Folder=Folder: {0} - parent: {1}
+Folder.ObjectClasses=Object Classes
+Folder.Warnings=Warnings
+ObjectClassWrapper.ObjectWrapperClass=ObjectClassWrapper: {0} - parent: {1}
+SchemaWrapper.SchemaWrapper=SchemaWrapper: {0} - parent: {1}

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Added: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties?rev=721126&view=auto
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
(added)
+++ directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
Thu Nov 27 01:09:40 2008
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+AttributeTypeWrapper.AttributeTypeWrapper=AttributeTypeWrapper: {0} - Vater: {1}
+Folder.AttributeTypes=Attribut Typen
+Folder.Errors=Fehler
+Folder.Folder=Verzeichnis: {0} - Vater: {1}
+Folder.ObjectClasses=Objekt-Klassen
+Folder.Warnings=Warnungen
+ObjectClassWrapper.ObjectWrapperClass=ObjectClassWrapper: {0} - Vater: {1}
+SchemaWrapper.SchemaWrapper=SchemaWrapper: {0} - Vater: {1}

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/schemaeditor/src/main/resources/org/apache/directory/studio/schemaeditor/view/wrappers/messages_de.properties
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message