directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r721382 - in /directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs: ColorsAndFontsPage.java MainPage.java Messages.java ServerLogsPage.java messages.properties messages_de.properties
Date Fri, 28 Nov 2008 08:42:24 GMT
Author: felixk
Date: Fri Nov 28 00:42:24 2008
New Revision: 721382

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

Added:
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
  (with props)
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
  (with props)
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
  (with props)
Modified:
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ColorsAndFontsPage.java
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/MainPage.java
    directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ServerLogsPage.java

Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ColorsAndFontsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ColorsAndFontsPage.java?rev=721382&r1=721381&r2=721382&view=diff
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ColorsAndFontsPage.java
(original)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ColorsAndFontsPage.java
Fri Nov 28 00:42:24 2008
@@ -71,7 +71,7 @@
      */
     public ColorsAndFontsPage()
     {
-        super( "Colors and Fonts" );
+        super( Messages.getString( "ColorsAndFontsPage.ColorsAndFonts" ) ); //$NON-NLS-1$
         setPreferenceStore( ApacheDsPlugin.getDefault().getPreferenceStore() );
     }
 
@@ -88,60 +88,60 @@
 
         // Console Group
         Group consoleGroup = new Group( composite, SWT.NONE );
-        consoleGroup.setText( "Console" );
+        consoleGroup.setText( Messages.getString( "ColorsAndFontsPage.Console" ) ); //$NON-NLS-1$
         GridLayout consoleGroupLayout = new GridLayout( 4, false );
         consoleGroup.setLayout( consoleGroupLayout );
         consoleGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Debug
         Label debugLabel = new Label( consoleGroup, SWT.NONE );
-        debugLabel.setText( "Debug:" );
+        debugLabel.setText( Messages.getString( "ColorsAndFontsPage.Debug" ) ); //$NON-NLS-1$
         debugColorButton = new ColorSelector( consoleGroup );
         debugColorButton.getButton().setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, true,
false ) );
         debugBoldCheckbox = new Button( consoleGroup, SWT.CHECK );
-        debugBoldCheckbox.setText( "Bold" );
+        debugBoldCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Bold" ) ); //$NON-NLS-1$
         debugItalicCheckbox = new Button( consoleGroup, SWT.CHECK );
-        debugItalicCheckbox.setText( "Italic" );
+        debugItalicCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Italic" ) );
//$NON-NLS-1$
 
         // Info
         Label infoLabel = new Label( consoleGroup, SWT.NONE );
-        infoLabel.setText( "Info:" );
+        infoLabel.setText( Messages.getString( "ColorsAndFontsPage.Info" ) ); //$NON-NLS-1$
         infoColorButton = new ColorSelector( consoleGroup );
         infoColorButton.getButton().setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, true,
false ) );
         infoBoldCheckbox = new Button( consoleGroup, SWT.CHECK );
-        infoBoldCheckbox.setText( "Bold" );
+        infoBoldCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Bold" ) ); //$NON-NLS-1$
         infoItalicCheckbox = new Button( consoleGroup, SWT.CHECK );
-        infoItalicCheckbox.setText( "Italic" );
+        infoItalicCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Italic" ) );
//$NON-NLS-1$
 
         // Warn
         Label warnLabel = new Label( consoleGroup, SWT.NONE );
-        warnLabel.setText( "Warn:" );
+        warnLabel.setText( Messages.getString( "ColorsAndFontsPage.Warn" ) ); //$NON-NLS-1$
         warnColorButton = new ColorSelector( consoleGroup );
         warnColorButton.getButton().setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, true,
false ) );
         warnBoldCheckbox = new Button( consoleGroup, SWT.CHECK );
-        warnBoldCheckbox.setText( "Bold" );
+        warnBoldCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Bold" ) ); //$NON-NLS-1$
         warnItalicCheckbox = new Button( consoleGroup, SWT.CHECK );
-        warnItalicCheckbox.setText( "Italic" );
+        warnItalicCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Italic" ) );
//$NON-NLS-1$
 
         // Error
         Label errorLabel = new Label( consoleGroup, SWT.NONE );
-        errorLabel.setText( "Error:" );
+        errorLabel.setText( Messages.getString( "ColorsAndFontsPage.Error" ) ); //$NON-NLS-1$
         errorColorButton = new ColorSelector( consoleGroup );
         errorColorButton.getButton().setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, true,
false ) );
         errorBoldCheckbox = new Button( consoleGroup, SWT.CHECK );
-        errorBoldCheckbox.setText( "Bold" );
+        errorBoldCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Bold" ) ); //$NON-NLS-1$
         errorItalicCheckbox = new Button( consoleGroup, SWT.CHECK );
-        errorItalicCheckbox.setText( "Italic" );
+        errorItalicCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Italic" ) );
//$NON-NLS-1$
 
         // Fatal
         Label fatalLabel = new Label( consoleGroup, SWT.NONE );
-        fatalLabel.setText( "Fatal:" );
+        fatalLabel.setText( Messages.getString( "ColorsAndFontsPage.Fatal" ) ); //$NON-NLS-1$
         fatalColorButton = new ColorSelector( consoleGroup );
         fatalColorButton.getButton().setLayoutData( new GridData( SWT.RIGHT, SWT.NONE, true,
false ) );
         fatalBoldCheckbox = new Button( consoleGroup, SWT.CHECK );
-        fatalBoldCheckbox.setText( "Bold" );
+        fatalBoldCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Bold" ) ); //$NON-NLS-1$
         fatalItalicCheckbox = new Button( consoleGroup, SWT.CHECK );
-        fatalItalicCheckbox.setText( "Italic" );
+        fatalItalicCheckbox.setText( Messages.getString( "ColorsAndFontsPage.Italic" ) );
//$NON-NLS-1$
 
         initFromPreferences();
 

Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/MainPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/MainPage.java?rev=721382&r1=721381&r2=721382&view=diff
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/MainPage.java
(original)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/MainPage.java
Fri Nov 28 00:42:24 2008
@@ -44,9 +44,9 @@
      */
     public MainPage()
     {
-        super( "Apache DS" );
+        super( Messages.getString( "MainPage.ApacheDS" ) ); //$NON-NLS-1$
         setPreferenceStore( ApacheDsPlugin.getDefault().getPreferenceStore() );
-        setDescription( "General settings for the Apache DS Plugin" );
+        setDescription( Messages.getString( "MainPage.GeneralSettingsPlugin" ) ); //$NON-NLS-1$
     }
 
 

Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java?rev=721382&view=auto
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
(added)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
Fri Nov 28 00:42:24 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.apacheds.prefs;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public class Messages
+{
+    private static final String BUNDLE_NAME = "org.apache.directory.studio.apacheds.prefs.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/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/Messages.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ServerLogsPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ServerLogsPage.java?rev=721382&r1=721381&r2=721382&view=diff
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ServerLogsPage.java
(original)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/ServerLogsPage.java
Fri Nov 28 00:42:24 2008
@@ -67,7 +67,7 @@
      */
     public ServerLogsPage()
     {
-        super( "Server Logs" );
+        super( Messages.getString( "ServerLogsPage.ServerLogs" ) ); //$NON-NLS-1$
         setPreferenceStore( ApacheDsPlugin.getDefault().getPreferenceStore() );
     }
 
@@ -87,8 +87,7 @@
         GridData gd = new GridData( SWT.FILL, SWT.BEGINNING, true, false );
         gd.widthHint = 150;
         colorsAndFontsLink.setLayoutData( gd );
-        colorsAndFontsLink
-            .setText( "Default colors and fonts settings can be configured on the <a>Colors
and Fonts</a> preference page." );
+        colorsAndFontsLink.setText( Messages.getString( "ServerLogsPage.DefaultColorsAndFontsSettings"
) ); //$NON-NLS-1$
         colorsAndFontsLink.addSelectionListener( new SelectionAdapter()
         {
             public void widgetSelected( SelectionEvent e )
@@ -100,38 +99,37 @@
 
         // Log Level Group
         Group logLevelGroup = new Group( composite, SWT.NONE );
-        logLevelGroup.setText( "Log Level" );
+        logLevelGroup.setText( Messages.getString( "ServerLogsPage.LogLevel" ) ); //$NON-NLS-1$
         logLevelGroup.setLayout( new GridLayout( 2, false ) );
         logLevelGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Level Label
         Label levelLabel = new Label( logLevelGroup, SWT.NONE );
-        levelLabel.setText( "Level:" );
+        levelLabel.setText( Messages.getString( "ServerLogsPage.Level" ) ); //$NON-NLS-1$
 
         //  Level Combo
         levelCombo = new Combo( logLevelGroup, SWT.DROP_DOWN | SWT.READ_ONLY | SWT.SIMPLE
);
-        levelCombo.add( "Debug", 0 );
-        levelCombo.add( "Info", 1 );
-        levelCombo.add( "Warning", 2 );
-        levelCombo.add( "Error", 3 );
-        levelCombo.add( "Fatal", 4 );
+        levelCombo.add( Messages.getString( "ServerLogsPage.Debug" ), 0 ); //$NON-NLS-1$
+        levelCombo.add( Messages.getString( "ServerLogsPage.Info" ), 1 ); //$NON-NLS-1$
+        levelCombo.add( Messages.getString( "ServerLogsPage.Warning" ), 2 ); //$NON-NLS-1$
+        levelCombo.add( Messages.getString( "ServerLogsPage.Error" ), 3 ); //$NON-NLS-1$
+        levelCombo.add( Messages.getString( "ServerLogsPage.Fatal" ), 4 ); //$NON-NLS-1$
 
         // Warning Label
         new Label( logLevelGroup, SWT.NONE ); // Filler
         Label warningLabel = new Label( logLevelGroup, SWT.WRAP );
-        warningLabel
-            .setText( "Warning: Setting the log level to 'Debug' or 'Info' can cause issues
and slow down the server." );
+        warningLabel.setText( Messages.getString( "ServerLogsPage.WarnLogLevel" ) ); //$NON-NLS-1$
         warningLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
         // Conversion Pattern Group
         conversionPatternGroup = new Group( composite, SWT.NONE );
-        conversionPatternGroup.setText( "Conversion Pattern" );
+        conversionPatternGroup.setText( Messages.getString( "ServerLogsPage.ConverstionPattern"
) ); //$NON-NLS-1$
         conversionPatternGroup.setLayout( new GridLayout( 2, false ) );
         conversionPatternGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false
) );
 
         // Pattern Label
         Label patternLabel = new Label( conversionPatternGroup, SWT.NONE );
-        patternLabel.setText( "Pattern:" );
+        patternLabel.setText( Messages.getString( "ServerLogsPage.Pattern" ) ); //$NON-NLS-1$
 
         // Pattern Text
         patternText = new Text( conversionPatternGroup, SWT.BORDER );
@@ -146,7 +144,7 @@
 
         // Preview
         Label label = new Label( conversionPatternGroup, SWT.NONE );
-        label.setText( "Preview:" );
+        label.setText( Messages.getString( "ServerLogsPage.Preview" ) ); //$NON-NLS-1$
         previewLabel = new Label( conversionPatternGroup, SWT.NONE );
         previewLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
 
@@ -162,8 +160,9 @@
      */
     private void updatePreviewLabel()
     {
-        LoggingEvent loggingEvent = new LoggingEvent( "CategoryClass", Logger.getLogger(
"logger" ), Level.INFO,
-            "Logging message", new Exception( "AnException" ) );
+        LoggingEvent loggingEvent = new LoggingEvent(
+            Messages.getString( "ServerLogsPage.CategoryClass" ), Logger.getLogger( "logger"
), Level.INFO, //$NON-NLS-1$ //$NON-NLS-2$
+            Messages.getString( "ServerLogsPage.LoggingMessage" ), new Exception( Messages.getString(
"ServerLogsPage.AnException" ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
         previewLabel.setText( new PatternLayout( patternText.getText() ).format( loggingEvent
) );
     }
 

Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties?rev=721382&view=auto
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
(added)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
Fri Nov 28 00:42:24 2008
@@ -0,0 +1,44 @@
+#  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.
+
+ColorsAndFontsPage.Bold=Bold
+ColorsAndFontsPage.ColorsAndFonts=Colors and Fonts
+ColorsAndFontsPage.Console=Console
+ColorsAndFontsPage.Debug=Debug:
+ColorsAndFontsPage.Error=Error:
+ColorsAndFontsPage.Fatal=Fatal:
+ColorsAndFontsPage.Info=Info:
+ColorsAndFontsPage.Italic=Italic
+ColorsAndFontsPage.Warn=Warn:
+MainPage.ApacheDS=Apache DS
+MainPage.GeneralSettingsPlugin=General settings for the Apache DS Plugin
+ServerLogsPage.AnException=AnException
+ServerLogsPage.CategoryClass=CategoryClass
+ServerLogsPage.ConverstionPattern=Conversion Pattern
+ServerLogsPage.Debug=Debug
+ServerLogsPage.DefaultColorsAndFontsSettings=Default colors and fonts settings can be configured
on the <a>Colors and Fonts</a> preference page.
+ServerLogsPage.Error=Error
+ServerLogsPage.Fatal=Fatal
+ServerLogsPage.Info=Info
+ServerLogsPage.Level=Level:
+ServerLogsPage.LoggingMessage=Logging message
+ServerLogsPage.LogLevel=Log Level
+ServerLogsPage.Pattern=Pattern:
+ServerLogsPage.Preview=Preview:
+ServerLogsPage.ServerLogs=Server Logs
+ServerLogsPage.Warning=Warning
+ServerLogsPage.WarnLogLevel=Warning: Setting the log level to 'Debug' or 'Info' can cause
issues and slow down the server.

Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Added: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties?rev=721382&view=auto
==============================================================================
--- directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
(added)
+++ directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
Fri Nov 28 00:42:24 2008
@@ -0,0 +1,36 @@
+#  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.
+
+ColorsAndFontsPage.Bold=Fett
+ColorsAndFontsPage.ColorsAndFonts=Farben und Schriften
+ColorsAndFontsPage.Console=Konsole
+ColorsAndFontsPage.Error=Fehler\:
+ColorsAndFontsPage.Italic=Kursiv
+ColorsAndFontsPage.Warn=Warnung\:
+MainPage.GeneralSettingsPlugin=Allgemeine Einstellungen des Apache DS Plugins
+ServerLogsPage.AnException=Eine Ausnahme
+ServerLogsPage.ConverstionPattern=Umwandlungs Muster
+ServerLogsPage.DefaultColorsAndFontsSettings=Standard Einstellungen f\u00FCr Farben und Schriften
k\u00F6nnen auf der Pr\u00E4ferenzseite <a>Colors and Fonts</a> konfiguriert werden.
+ServerLogsPage.Error=Fehler
+ServerLogsPage.Level=Ebene\:
+ServerLogsPage.LoggingMessage=Aufzeichnungs-Nachricht
+ServerLogsPage.LogLevel=Log Ebene
+ServerLogsPage.Pattern=Muster\:
+ServerLogsPage.Preview=Vorschau\:
+ServerLogsPage.ServerLogs=Server Logs
+ServerLogsPage.Warning=Warnung
+ServerLogsPage.WarnLogLevel=Warnung\: Setzten der Log-Ebenen auf 'Debug' or 'Info' k\u00F6nnen
Probleme verursachen und den Server verlangsamen.

Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/studio/trunk/apacheds/src/main/java/org/apache/directory/studio/apacheds/prefs/messages_de.properties
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message