@Service public interface LocalizationService
Modifier and Type | Method and Description |
---|---|
String |
formatCurrencyAmount(String locale,
Number amount)
Format the specified amount in the locale currency.
|
String |
formatCurrencyAmount(String locale,
Number amount,
String currency)
Format the specified amount in the specified locale and currency.
|
String |
formatDate(String locale,
Date date,
String skeleton)
Format a date using the specified locale.
|
String |
formatDate(String locale,
Date date,
String skeleton,
String timezone)
Format a date using the specified locale and the specified timezone.
|
String |
formatNumber(String locale,
Number number)
Format a number according to the specified locale.
|
String |
localize(String locale,
String key)
Return a localized string based on the specified locale and key.
|
String |
localize(String locale,
String key,
Object... args)
Return a localized string based on the specified locale and key.
|
Number |
parseCurrencyAmount(String locale,
String value)
Parse the specified amount in the locale default currency.
|
Number |
parseCurrencyAmount(String locale,
String value,
String currency)
Parse the specified amount in the specified locale and currency.
|
Date |
parseDate(String locale,
String value,
String skeleton)
Parse a date using the specified locale.
|
Date |
parseDate(String locale,
String value,
String skeleton,
String timezone)
Parse a date using the specified locale and the specified timezone.
|
Number |
parseNumber(String locale,
String value)
Parse a number according to the specified locale.
|
String localize(String locale, String key)
locale
- The locale identifier.key
- The i18n key to translate.String localize(String locale, String key, Object... args)
locale
- The locale identifier.key
- The i18n key to translate.args
- The arguments used for message formatting.localize(String, String)
String formatDate(String locale, Date date, String skeleton)
locale
- The locale identifier.date
- The date to format.skeleton
- The pattern elements that will be included in the formatted
string.String formatDate(String locale, Date date, String skeleton, String timezone)
locale
- The locale identifier.date
- The date to format.skeleton
- The pattern elements that will be included in the formatted
string.timezone
- The timezone identifier.Date parseDate(String locale, String value, String skeleton) throws ParseException
locale
- The locale identifier.value
- The string to parse.skeleton
- The pattern elements used to parse the string.ParseException
- if the given string cannot be parsed into a DateDate parseDate(String locale, String value, String skeleton, String timezone) throws ParseException
locale
- The locale identifier.value
- The string to parse.skeleton
- The pattern elements used to parse the string.timezone
- The timezone identifier.ParseException
- if the given string cannot be parsed into a DateString formatCurrencyAmount(String locale, Number amount)
locale
- The locale identifier.amount
- The amount to format.String formatCurrencyAmount(String locale, Number amount, String currency)
locale
- The locale identifier.amount
- The amount to format.currency
- The currency identifier as a 3-letter ISO4217 code.Number parseCurrencyAmount(String locale, String value) throws ParseException
locale
- The locale identifier.value
- The value to parse.ParseException
- if the given value cannot be parsed into an amountNumber parseCurrencyAmount(String locale, String value, String currency) throws ParseException
locale
- The locale identifier.value
- The value to parse.currency
- The currency identifier.ParseException
- if the given value cannot be parsed into an amountString formatNumber(String locale, Number number)
locale
- The locale identifier.number
- The number to format.Number parseNumber(String locale, String value) throws ParseException
locale
- The locale identifier.value
- The string to parse.ParseException
- if the given value cannot be parsed into a numberCopyright © 2013-2018–2019 SeedStack. All rights reserved.