Package com.axelor.i18n
Class L10n
- java.lang.Object
-
- com.axelor.i18n.L10n
-
public final class L10n extends Object
This class provider methods for localization (L10n) services.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringformat(Number value)Format the number value.Stringformat(Number value, boolean grouping)Format the number value.Stringformat(LocalDate value)Format the date value.Stringformat(LocalDateTime value)Format the date time value.Stringformat(LocalTime value)Format the time value.Stringformat(ZonedDateTime value)Format the date time value.static L10ngetInstance()Get instance ofL10nusing contextual locale.static L10ngetInstance(Locale locale)Get instance ofL10nfor the given locale.
-
-
-
Method Detail
-
getInstance
public static L10n getInstance()
Get instance ofL10nusing contextual locale.- Returns:
L10ninstance for the context
-
getInstance
public static L10n getInstance(Locale locale)
Get instance ofL10nfor the given locale.- Parameters:
locale- the locale instance- Returns:
L10ninstance for the given locale
-
format
public String format(Number value)
Format the number value.- Parameters:
value- the value to format- Returns:
- value as formated string
-
format
public String format(Number value, boolean grouping)
Format the number value.- Parameters:
value- the value to formatgrouping- whether to use grouping in format- Returns:
- value as formated string
-
format
public String format(LocalDate value)
Format the date value.- Parameters:
value- the value to format- Returns:
- value as formated string
-
format
public String format(LocalTime value)
Format the time value.- Parameters:
value- the value to format- Returns:
- value as formated string
-
format
public String format(LocalDateTime value)
Format the date time value.- Parameters:
value- the value to format- Returns:
- value as formated string
-
format
public String format(ZonedDateTime value)
Format the date time value.- Parameters:
value- the value to format- Returns:
- value as formated string
-
-