01: /*
02: * Copyright 2007 Paul Hinds
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.tp23.antinstaller.renderer;
17:
18: import java.util.MissingResourceException;
19: import java.util.ResourceBundle;
20:
21: /**
22: * LanguagePacks for internationalized builds
23: * @author teknopaul
24: *
25: */
26: public class AILanguagePack {
27:
28: private static ResourceBundle res;
29: private static boolean i18n = false;
30: static {
31: try {
32: res = ResourceBundle.getBundle("resources.LanguagePack");
33: i18n = true;
34: } catch (MissingResourceException e) {
35: // i18n is optional
36: }
37: }
38:
39: public String getString(String key) {
40: return res.getString(key);
41: }
42:
43: public static void reInitLocale() {
44: res = ResourceBundle.getBundle("resources.LanguagePack");
45: }
46:
47: public static boolean isI18n() {
48: return i18n;
49: }
50:
51: }
|