comparison dwtx/jface/text/templates/persistence/TemplatePersistenceMessages.d @ 148:b3dec671d1f7

...
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 22:40:25 +0200
parents 000f9136b8f7
children 77b70cbb4c8d
comparison
equal deleted inserted replaced
147:000f9136b8f7 148:b3dec671d1f7
27 /** 27 /**
28 * @since 3.0 28 * @since 3.0
29 */ 29 */
30 class TemplatePersistenceMessages { 30 class TemplatePersistenceMessages {
31 31
32 private static const String RESOURCE_BUNDLE= TemplatePersistenceMessages.class.getName(); 32 // private static const String RESOURCE_BUNDLE= TemplatePersistenceMessages.class.getName();
33 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 33 private static ResourceBundle fgResourceBundle;//= ResourceBundle.getBundle(RESOURCE_BUNDLE);
34
35 static this() {
36 fgResourceBundle = ResourceBundle.getBundle(
37 getImportData!("dwtx.jface.text.templates.persistence.TemplatePersistenceMessages.properties"));
38 }
34 39
35 private this() { 40 private this() {
36 } 41 }
37 42
38 public static String getString(String key) { 43 public static String getString(String key) {
39 try { 44 try {
40 return fgResourceBundle.getString(key); 45 return fgResourceBundle.getString(key);
41 } catch (MissingResourceException e) { 46 } catch (MissingResourceException e) {
42 return '!' + key + '!'; 47 return '!' ~ key ~ '!';
43 } 48 }
44 } 49 }
45 50
46 public static String getFormattedString(String key, Object arg) { 51 public static String getFormattedString(String key, Object[] args...) {
47 return MessageFormat.format(getString(key), new Object[] { arg });
48 }
49
50 public static String getFormattedString(String key, Object[] args) {
51 return MessageFormat.format(getString(key), args); 52 return MessageFormat.format(getString(key), args);
52 } 53 }
53 } 54 }