Let's make these work correctly...

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4266 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-07-14 02:11:06 +00:00
parent 947db5851d
commit a9d0c5d285
2 changed files with 14 additions and 49 deletions
+8 -12
View File
@@ -23,6 +23,8 @@ package com.threerings.util {
import mx.resources.ResourceBundle;
import mx.utils.StringUtil;
/**
* A message bundle provides an easy mechanism by which to obtain
* translated message strings from a resource bundle. It uses the {@link
@@ -77,6 +79,8 @@ public class MessageBundle
// if we have a parent, try getting the string from them
if (_parent != null) {
trace("Trying to retrieve " + key + " from parent bundle: " +
_parent);
var value :String = _parent.getResourceString(key, false);
if (value != null) {
return value;
@@ -148,11 +152,12 @@ public class MessageBundle
if (msg == null) {
Log.getLog(this).warning("Missing translation message " +
"[bundle=" + _path + ", key=" + key + "].");
// return something bogus
return (key + args);
}
return (msg != null) ?
MessageFormat.format(escape(msg), args)
: (key + args);
return mx.utils.StringUtil.substitute(escape(msg), args);
}
/**
@@ -384,12 +389,3 @@ public class MessageBundle
protected static const QUAL_SEP :String = ":";
}
}
// TODO: figure out what we're going to do here
class MessageFormat
{
public static function format (msg :String, ... rest) :String
{
return msg + rest;
}
}