From 072606b23a1cbd9aabcbf14158f065a85c8f701d Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 5 Feb 2004 17:39:03 +0000 Subject: [PATCH] Added exists(). git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2949 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/java/com/threerings/util/MessageBundle.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/util/MessageBundle.java b/src/java/com/threerings/util/MessageBundle.java index f5036dfdc..3e48797f5 100644 --- a/src/java/com/threerings/util/MessageBundle.java +++ b/src/java/com/threerings/util/MessageBundle.java @@ -1,5 +1,5 @@ // -// $Id: MessageBundle.java,v 1.23 2004/01/25 13:23:09 mdb Exp $ +// $Id: MessageBundle.java,v 1.24 2004/02/05 17:39:03 mdb Exp $ package com.threerings.util; @@ -52,6 +52,15 @@ public class MessageBundle return (msg != null) ? msg : key; } + /** + * Returns true if we have a translation mapping for the supplied key, + * false if not. + */ + public boolean exists (String key) + { + return getResourceString(key, false) != null; + } + /** * Get a String from the resource bundle, or null if there was an error. */