diff --git a/src/as/com/threerings/util/MessageBundle.as b/src/as/com/threerings/util/MessageBundle.as index 3cd9d4ac1..86504d328 100644 --- a/src/as/com/threerings/util/MessageBundle.as +++ b/src/as/com/threerings/util/MessageBundle.as @@ -21,6 +21,8 @@ package com.threerings.util { +import mx.resources.ResourceBundle; + /** * A message bundle provides an easy mechanism by which to obtain * translated message strings from a resource bundle. It uses the {@link diff --git a/src/as/com/threerings/util/MessageManager.as b/src/as/com/threerings/util/MessageManager.as index 56bf0a86f..75fb19c8c 100644 --- a/src/as/com/threerings/util/MessageManager.as +++ b/src/as/com/threerings/util/MessageManager.as @@ -25,6 +25,8 @@ package com.threerings.util { // //import mx.resources.Locale; +import mx.resources.ResourceBundle; + /** * The message manager provides a thin wrapper around Java's built-in * localization support, supporting a policy of dividing up localization diff --git a/src/as/com/threerings/util/ResourceBundle.as b/src/as/com/threerings/util/ResourceBundle.as deleted file mode 100644 index e89aeb1d8..000000000 --- a/src/as/com/threerings/util/ResourceBundle.as +++ /dev/null @@ -1,82 +0,0 @@ -package com.threerings.util { - -import flash.system.ApplicationDomain; - -/** - * A non-flex version of ResourceBundle. - */ -public /*abstract*/ class ResourceBundle -{ - /** - * Get a resource bundle by name. - */ - public static function getResourceBundle ( - baseName :String, appDom :ApplicationDomain = null) :ResourceBundle - { - if (appDom == null) { - appDom = ApplicationDomain.currentDomain; - } - - var className :String = baseName + "_properties"; - if (appDom.hasDefinition(className)) { - var obj :Object = new (Class(appDom.getDefinition(className)))(); - if (obj is ResourceBundle) { - var rb :ResourceBundle = ResourceBundle(obj); - rb.initialize(baseName); - return rb; - } - } - - throw new Error("Could not find resource bundle " + baseName); - } - - /** - * Get a resource value as a String. - */ - public function getString (key :String) :String - { - return String(getObject(key)); - } - - /** - * Get a resouce value as the raw type contained within the content - * object. - */ - public function getObject (key :String) :Object - { - var val :Object = _content[key]; - if (val != null) { - return val; - } - throw new Error("Key '" + key + "' was not found in resource bundle '" + - _name + "'."); - } - - /** - * Internal initialization method. - */ - private function initialize (name :String) :void - { - _content = getContent(); - if (_content == null) { - throw new Error("No content found in resource bundle '" + name + "'."); - } - _name = name; - } - - /** - * Get the content of this resource bundle. - * You may override this to do custom stuff. - */ - protected function getContent () :Object - { - return null; - } - - /** The name of this bundle. */ - protected var _name :String; - - /** Contains resource bundle values. */ - protected var _content :Object; -} -}