From 8823d592fd774cdd648bc921ddfce7c8007d9357 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Sun, 24 Feb 2008 02:58:26 +0000 Subject: [PATCH] Added getAll(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4946 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/MessageBundle.as | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/as/com/threerings/util/MessageBundle.as b/src/as/com/threerings/util/MessageBundle.as index 06ae102cb..f496f7b40 100644 --- a/src/as/com/threerings/util/MessageBundle.as +++ b/src/as/com/threerings/util/MessageBundle.as @@ -71,23 +71,19 @@ public class MessageBundle * @param includeParent if true, messages from our parent bundle (and its * parent bundle, all the way up the chain will be included). */ - /* COMMENTED OUT: pending proper implementation (and need) - public function getAll ( - prefix :String, messages :Array, includeParent :Boolean = true) :void + public function getAll ( + prefix :String, messages :Array, includeParent :Boolean = true) :void { - var key :String; - // TODO: possibly patch ResourceBundle to have getKeys() - //for (key in _bundle.getKeys()) { - // if (StringUtil.startsWith(key, prefix)) { - // messages.push(get(key)); - // } - //} + for (var key :String in _bundle.content) { + if (StringUtil.startsWith(key, prefix)) { + messages.push(get(key)); + } + } if (includeParent && _parent != null) { _parent.getAll(prefix, messages, includeParent); } } - */ /** * Get a String from the resource bundle, or null if there was an