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/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java b/opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
index dc36db0..4615588 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
@@ -26,6 +26,7 @@
  */
 
 package org.opends.server.admin;
+import org.opends.messages.Message;
 
 
 
@@ -127,7 +128,7 @@
    * @throws MissingResourceException
    *           If the key was not found.
    */
-  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
+  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
       String key) throws MissingResourceException {
     return getMessage(d, key, Locale.getDefault(), (String[]) null);
   }
@@ -149,7 +150,7 @@
    * @throws MissingResourceException
    *           If the key was not found.
    */
-  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
+  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
       String key, Locale locale) throws MissingResourceException {
     return getMessage(d, key, locale, (String[]) null);
   }
@@ -174,16 +175,17 @@
    * @throws MissingResourceException
    *           If the key was not found.
    */
-  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
+  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
       String key, Locale locale, String... args)
       throws MissingResourceException {
     ResourceBundle resource = getResourceBundle(d, locale);
 
+    // TODO: use message framework directly
     if (args == null) {
-      return resource.getString(key);
+      return Message.raw(resource.getString(key));
     } else {
       MessageFormat mf = new MessageFormat(resource.getString(key));
-      return mf.format(args);
+      return Message.raw(mf.format(args));
     }
   }
 
@@ -205,7 +207,7 @@
    * @throws MissingResourceException
    *           If the key was not found.
    */
-  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
+  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
       String key, String... args) throws MissingResourceException {
     return getMessage(d, key, Locale.getDefault(), args);
   }

--
Gitblit v1.10.0