net.sf.zekr.common.util
Class I18N

java.lang.Object
  extended by net.sf.zekr.common.util.I18N

public class I18N
extends java.lang.Object


Field Summary
static char LRE
          Left to right embedding
static char LRM
          Left to right mark
static char LRO
          Left to right override
static char RLE
          Right to left embedding
static char RLM
          Right to left mark
static char RLO
          Right to left override
 
Constructor Summary
I18N()
           
I18N(java.util.Locale locale)
           
 
Method Summary
 java.util.Locale getLocale()
           
 java.lang.String localize(java.lang.Number number)
          This method makes a localized number based on the input number and selected or default locale.
 java.lang.String localize(java.lang.Number number, java.lang.String langCode)
          This method makes a localized number based on the input number and the locale parameter.
 java.lang.String localize(java.lang.String str)
          Replaces all occurrences of digits in str with corresponding localized digits.
 java.lang.String localize(java.lang.String str, java.lang.String langCode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LRM

public static char LRM
Left to right mark


RLM

public static char RLM
Right to left mark


LRE

public static char LRE
Left to right embedding


RLE

public static char RLE
Right to left embedding


LRO

public static char LRO
Left to right override


RLO

public static char RLO
Right to left override

Constructor Detail

I18N

public I18N(java.util.Locale locale)

I18N

public I18N()
Method Detail

localize

public java.lang.String localize(java.lang.Number number)
This method makes a localized number based on the input number and selected or default locale.

Parameters:
number - the input number
Returns:
localized number as String

localize

public java.lang.String localize(java.lang.Number number,
                                 java.lang.String langCode)
This method makes a localized number based on the input number and the locale parameter.

Parameters:
number - the input number
langCode - target language code (e.g. en, fr, ar, ...) to be used for making numbers
Returns:
localized number as String

localize

public java.lang.String localize(java.lang.String str)
Replaces all occurrences of digits in str with corresponding localized digits.

Parameters:
str -
Returns:
localized string

localize

public java.lang.String localize(java.lang.String str,
                                 java.lang.String langCode)

getLocale

public java.util.Locale getLocale()
Returns:
the java.util.Locale instance used for encoding withing this object.