Line | |
---|
1 | /* Copyright 2014 Malcolm Herring
|
---|
2 | *
|
---|
3 | * This is free software: you can redistribute it and/or modify
|
---|
4 | * it under the terms of the GNU General Public License as published by
|
---|
5 | * the Free Software Foundation, version 3 of the License.
|
---|
6 | *
|
---|
7 | * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
|
---|
8 | */
|
---|
9 |
|
---|
10 | package messages;
|
---|
11 |
|
---|
12 | import java.util.MissingResourceException;
|
---|
13 | import java.util.ResourceBundle;
|
---|
14 |
|
---|
15 | public class Messages {
|
---|
16 | private static final String BUNDLE_NAME = "resources/msg.messages";
|
---|
17 |
|
---|
18 | private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
|
---|
19 |
|
---|
20 | private Messages() {
|
---|
21 | }
|
---|
22 |
|
---|
23 | public static String getString(String key) {
|
---|
24 | try {
|
---|
25 | return RESOURCE_BUNDLE.getString(key);
|
---|
26 | } catch (MissingResourceException e) {
|
---|
27 | return '!' + key + '!';
|
---|
28 | }
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.