From cfc513043c5830b5a967733066068c7097b42e3c Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java |   49 +++++++++++++++++++------------------------------
 1 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index 6c7a61e..d806213 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
@@ -27,13 +27,16 @@
 
 package org.opends.quicksetup;
 
+import org.opends.messages.Message;
+import org.opends.messages.MessageBuilder;
+import static org.opends.messages.QuickSetupMessages.*;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import org.opends.quicksetup.i18n.ResourceProvider;
 import org.opends.quicksetup.util.Utils;
 
 /**
@@ -55,7 +58,7 @@
 
   private boolean canOverwriteCurrentInstall;
 
-  private String installationMsg;
+  private Message installationMsg;
 
   /**
    * The constructor of a CurrentInstallStatus object.
@@ -70,47 +73,48 @@
     {
       Installation installation = Installation.getLocal();
       boolean dbFileExists = false;
-      ArrayList<String> msgs = new ArrayList<String>();
+      ArrayList<Message> msgs = new ArrayList<Message>();
 
       if (installation.getStatus().isServerRunning())
       {
-        msgs.add(getMsg("installstatus-serverrunning", new String[]
-            { String.valueOf(getPort()) }));
+        msgs.add(INFO_INSTALLSTATUS_SERVERRUNNING.get(
+                String.valueOf(getPort())));
       }
 
       if (dbFilesExist())
       {
         dbFileExists = true;
-        msgs.add(getMsg("installstatus-dbfileexist"));
+        msgs.add(INFO_INSTALLSTATUS_DBFILEEXIST.get());
       }
 
       if (isConfigFileModified())
       {
-        msgs.add(getMsg("installstatus-configfilemodified"));
+        msgs.add(INFO_INSTALLSTATUS_CONFIGFILEMODIFIED.get());
       }
       canOverwriteCurrentInstall = (msgs.size() == 1) && dbFileExists;
       isInstalled = msgs.size() > 0;
       if (canOverwriteCurrentInstall)
       {
         installationMsg =
-          getMsg("installstatus-canoverwritecurrentinstall-msg");
+          INFO_INSTALLSTATUS_CANOVERWRITECURRENTINSTALL_MSG.get();
       }
       else if (isInstalled)
       {
-        StringBuilder buf = new StringBuilder();
+        MessageBuilder buf = new MessageBuilder();
         buf.append("<ul>");
-        for (String msg : msgs)
+        for (Message msg : msgs)
         {
-          buf.append("\n<li>").append(msg).append("</li>");
+          buf.append("\n<li>");
+          buf.append(msg);
+          buf.append("</li>");
         }
         buf.append("</ul>");
-        installationMsg = getMsg("installstatus-installed", new String[]
-          { buf.toString() });
+        installationMsg = INFO_INSTALLSTATUS_INSTALLED.get( buf.toString() );
       }
     }
     if (!isInstalled)
     {
-      installationMsg = getMsg("installstatus-not-installed");
+      installationMsg = INFO_INSTALLSTATUS_NOT_INSTALLED.get();
     }
   }
 
@@ -143,7 +147,7 @@
    *
    * @return an String in HTML format describing the status of the installation.
    */
-  public String getInstallationMsg()
+  public Message getInstallationMsg()
   {
     return installationMsg;
   }
@@ -199,19 +203,4 @@
     return mod;
   }
 
-  private String getMsg(String key)
-  {
-    return getI18n().getMsg(key);
-  }
-
-  private String getMsg(String key, String[] args)
-  {
-    return getI18n().getMsg(key, args);
-  }
-
-  private ResourceProvider getI18n()
-  {
-    return ResourceProvider.getInstance();
-  }
-
 }

--
Gitblit v1.10.0