1 /**
2 * Copyright (C) 2007 Joern Krueger surething@users.sourceforge.net
3 *
4 * This program is free software; you can redistribute
5 * it and/or modify it under the terms of the GNU General
6 * Public License version 2 as published by the Free Software
7 * Foundation.
8 *
9 * This program is distributed in the hope that it will be
10 * useful, but WITHOUT ANY WARRANTY; without even the implied
11 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 * PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place,
18 * Suite 330, Boston, MA 02111-1307 USA
19 */
20 package de.surethingies.properties.resources;
21
22 import java.util.MissingResourceException;
23 import java.util.ResourceBundle;
24
25 public class Messages {
26 private static final String BUNDLE_NAME = "sfw_locales";
27
28 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
29
30 private Messages() {
31 }
32
33 public static String getString(String key) {
34 try {
35 return RESOURCE_BUNDLE.getString(key);
36 } catch (MissingResourceException e) {
37 return '!' + key + '!';
38 }
39 }
40 }