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 String
format(Number value)
Format the number value.String
format(Number value, boolean grouping)
Format the number value.String
format(LocalDate value)
Format the date value.String
format(LocalDateTime value)
Format the date time value.String
format(LocalTime value)
Format the time value.String
format(ZonedDateTime value)
Format the date time value.static L10n
getInstance()
Get instance ofL10n
using contextual locale.static L10n
getInstance(Locale locale)
Get instance ofL10n
for the given locale.
-
-
-
Method Detail
-
getInstance
public static L10n getInstance()
Get instance ofL10n
using contextual locale.- Returns:
L10n
instance for the context
-
getInstance
public static L10n getInstance(Locale locale)
Get instance ofL10n
for the given locale.- Parameters:
locale
- the locale instance- Returns:
L10n
instance 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
-
-