comparison dwtx/jface/text/templates/JFaceTextTemplateMessages.d @ 145:02cd5f1224d3

...
author Frank Benoit <benoit@tionex.de>
date Sun, 24 Aug 2008 22:31:00 +0200
parents 7d818bd32d63
children 000f9136b8f7
comparison
equal deleted inserted replaced
144:16a71f577815 145:02cd5f1224d3
42 /** 42 /**
43 * @since 3.0 43 * @since 3.0
44 */ 44 */
45 class JFaceTextTemplateMessages { 45 class JFaceTextTemplateMessages {
46 46
47 private static final String RESOURCE_BUNDLE= JFaceTextTemplateMessages.class.getName(); 47 // private static final String RESOURCE_BUNDLE= JFaceTextTemplateMessages.class.getName();
48 private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE); 48 private static ResourceBundle fgResourceBundle;//= ResourceBundle.getBundle(RESOURCE_BUNDLE);
49
50 static this() {
51 fgResourceBundle = ResourceBundle.getBundle(
52 getImportData!("dwtx.jface.text.templates.JFaceTextTemplateMessages.properties"));
53 }
49 54
50 private this() { 55 private this() {
51 } 56 }
52 57
53 public static String getString(String key) { 58 public static String getString(String key) {
54 try { 59 try {
55 return fgResourceBundle.getString(key); 60 return fgResourceBundle.getString(key);
56 } catch (MissingResourceException e) { 61 } catch (MissingResourceException e) {
57 return '!' + key + '!'; 62 return '!' ~ key ~ '!';
58 } 63 }
59 } 64 }
60 65
61 public static String getFormattedString(String key, Object arg) { 66 public static String getFormattedString(String key, Object[] args... ) {
62 return MessageFormat.format(getString(key), new Object[] { arg });
63 }
64
65
66 public static String getFormattedString(String key, Object[] args) {
67 return MessageFormat.format(getString(key), args); 67 return MessageFormat.format(getString(key), args);
68 } 68 }
69 } 69 }