From 80c58327faaa4873369f6bb949e62792c2f708e0 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.

---
 opends/src/quicksetup/org/opends/quicksetup/CliUserInteraction.java |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/CliUserInteraction.java b/opends/src/quicksetup/org/opends/quicksetup/CliUserInteraction.java
index 06774c8..544b0a0 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/CliUserInteraction.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/CliUserInteraction.java
@@ -27,6 +27,9 @@
 
 package org.opends.quicksetup;
 
+import org.opends.messages.Message;
+import static org.opends.messages.QuickSetupMessages.*;
+
 import org.opends.quicksetup.util.Utils;
 import org.opends.server.util.StaticUtils;
 
@@ -69,44 +72,47 @@
   /**
    * {@inheritDoc}
    */
-  public Object confirm(String summary, String details,
-                        String title, MessageType type, String[] options,
-                        String def) {
+  public Object confirm(Message summary, Message details,
+                        Message title, MessageType type, Message[] options,
+                        Message def) {
     return confirm(summary, details, null, title, type, options, def, null);
   }
 
   /**
    * {@inheritDoc}
    */
-  public Object confirm(String summary, String details, String fineDetails,
-                        String title, MessageType type, String[] options,
-                        String def, String viewDetailsOption) {
+  public Object confirm(Message summary, Message details, Message fineDetails,
+                        Message title, MessageType type, Message[] options,
+                        Message def, Message viewDetailsOption) {
     List<String> sOptions = new ArrayList<String>();
     int defInt = -1;
     for (int i = 0; i < options.length; i++) {
-      sOptions.add(createOption(i + 1, options[i]));
+      sOptions.add(createOption(i + 1, options[i].toString()));
       if (options[i].equals(def)) {
         defInt = i + 1;
       }
     }
     if (fineDetails != null) {
       sOptions.add(createOption(options.length + 1,
-              viewDetailsOption != null ? viewDetailsOption : "View Details"));
+              viewDetailsOption != null ?
+                      viewDetailsOption.toString() :
+                      "View Details")); // TODO: i18n
     }
 
-    println(summary);
+    println(String.valueOf(summary));
     println();
-    println(details);
+    println(String.valueOf(details));
 
-    String returnValue = null;
+    Object returnValue = null;
     while (returnValue == null) {
       println();
       for (String o : sOptions) {
         println(o);
       }
-      System.out.print(getMsg("cli-uninstall-confirm-prompt",
-              "Enter a number or press Enter to accept the default",
-              Integer.toString(defInt)));
+      System.out.print( // TODO: i18n
+              Message.raw(CliUserInteraction.PROMPT_FORMAT,
+                      "Enter a number or press Enter to accept the default",
+                      Integer.toString(defInt)));
 
       System.out.flush();
 
@@ -122,11 +128,11 @@
         }
       }
       if (fineDetails != null && respInt == options.length + 1) {
-        println(fineDetails);
+        println(String.valueOf(fineDetails));
       } else if (respInt > 0 && respInt <= options.length) {
         returnValue = options[respInt - 1];
       } else {
-        println("Illegal response " + response);
+        println("Illegal response " + response); // TODO: i18n
       }
     }
     return returnValue;

--
Gitblit v1.10.0