Пример #1
0
 /**
  * Return a localized string
  *
  * <p>The localized strings are stored in the configuration file (relative to executable:<br>
  * _config/cachewolf.Languages.cfg If the configuration file does not exist or a string cannot be
  * found in the file, the defaultValue is resurned.
  *
  * @param resourceID The unique number of the resource
  * @param defaultValue The default value of the string (if not found in the config file)
  * @return The localized string
  */
 public static String getMsg(int resourceID, String defaultValue) {
   if (l == null) init();
   if (lr != null) {
     String res;
     res = (String) lr.get(resourceID, defaultValue);
     if (res != null) return res;
     // Fallthrough to default value if string does not exist in file
   }
   return defaultValue;
 }
Пример #2
0
 /**
  * Get the three letter (uppercase) ISO country code
  *
  * @return The three letter (uppercase) ISO country code
  */
 public static String getLocaleCountry() {
   if (l == null) init();
   return l.getString(Locale.COUNTRY_SHORT, 0, 0);
 }
Пример #3
0
 /**
  * Get the ISO two letter (lowercase) name of the locale language
  *
  * @return ISO two letter abbreviation of the locale language
  */
 public static String getLocaleLanguage() {
   if (l == null) init();
   return l.getString(Locale.LANGUAGE_SHORT, 0, 0);
 }
Пример #4
0
 /**
  * Formats a Double to a given format specifier
  *
  * @param number A Double containing the number to be formatted
  * @param fmt A string containing the format specification</br>
  * @return The formatted number
  */
 public static String formatDouble(ewe.sys.Double number, String fmt) {
   if (l == null) init();
   return l.format(Locale.FORMAT_PARSE_NUMBER, number, fmt);
 }
Пример #5
0
 /**
  * Formats a Long integer to a given format specifier
  *
  * @param number A Long which contains the number to be formatted
  * @param fmt A string containing the format specification</br> '$' indicates that a currency
  *     symbol should be used. </br> ',' indicates that thousands groupings should be used. </br>
  *     '.' separates formatting before the decimal point and after the decimal point.</br> '0'
  *     before the decimal point indicates the number of digits before the decimal point.</br>
  * @return The formatted number
  */
 public static String formatLong(Long number, String fmt) {
   if (l == null) init();
   return l.format(Locale.FORMAT_PARSE_NUMBER, number, fmt);
 }
Пример #6
0
 /**
  * Get the decimal separator for this machine
  *
  * @return decimal point ("." or ",")
  */
 public static String getDigSeparator() {
   if (digSeparator == null) init();
   return digSeparator;
 }