1 24 25 package org.objectweb.cjdbc.common.i18n; 26 27 import java.text.MessageFormat ; 28 import java.util.ResourceBundle ; 29 30 36 public abstract class I18N 37 { 38 45 public static String get(ResourceBundle bundle, String key) 46 { 47 try 48 { 49 return bundle.getString(key); 50 } 51 catch (Exception e) 52 { 53 return key; 54 } 55 } 56 57 65 public static String get(ResourceBundle bundle, String key, boolean parameter) 66 { 67 return MessageFormat.format(get(bundle, key), new Object []{String 68 .valueOf(parameter)}); 69 } 70 71 79 public static String get(ResourceBundle bundle, String key, int parameter) 80 { 81 return MessageFormat.format(get(bundle, key), new Object []{String 82 .valueOf(parameter)}); 83 } 84 85 93 public static String get(ResourceBundle bundle, String key, long parameter) 94 { 95 return MessageFormat.format(get(bundle, key), new Object []{String 96 .valueOf(parameter)}); 97 } 98 99 110 public static String get(ResourceBundle bundle, String key, 111 Object [] parameters) 112 { 113 return MessageFormat.format(get(bundle, key), parameters); 114 } 115 116 124 public static String get(ResourceBundle bundle, String key, Object parameter) 125 { 126 return MessageFormat.format(get(bundle, key), new Object []{parameter}); 127 } 128 129 } | Popular Tags |