comparison dwtx/text/undo/UndoMessages.d @ 150:5cf141e43417

...
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 23:05:26 +0200
parents 000f9136b8f7
children 77b70cbb4c8d
comparison
equal deleted inserted replaced
149:b411f1c62131 150:5cf141e43417
31 * 31 *
32 * @since 3.2 32 * @since 3.2
33 */ 33 */
34 final class UndoMessages { 34 final class UndoMessages {
35 35
36 private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$ 36 // private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$
37 37
38 private static const ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME); 38 private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME);
39
40 static this() {
41 RESOURCE_BUNDLE = ResourceBundle.getBundle(
42 getImportData!("dwtx.text.undo.UndoMessages.properties"));
43 }
39 44
40 private this() { 45 private this() {
41 } 46 }
42 47
43 public static String getString(String key) { 48 public static String getString(String key) {
44 try { 49 try {
45 return RESOURCE_BUNDLE.getString(key); 50 return RESOURCE_BUNDLE.getString(key);
46 } catch (MissingResourceException e) { 51 } catch (MissingResourceException e) {
47 return '!' + key + '!'; 52 return '!' ~ key ~ '!';
48 } 53 }
49 } 54 }
50 55
51 public static String getFormattedString(String key, Object arg) { 56 public static String getFormattedString(String key, Object[] args...) {
52 return getFormattedString(key, new Object[] { arg });
53 }
54
55 public static String getFormattedString(String key, Object[] args) {
56 return MessageFormat.format(getString(key), args); 57 return MessageFormat.format(getString(key), args);
57 } 58 }
58 } 59 }