@ScannerSide @ServerSide @ComputeEngineSide public interface I18n
Modifier and Type | Method and Description |
---|---|
String |
age(Locale locale,
Date fromDate,
Date toDate)
Return the distance in time between two dates.
|
String |
age(Locale locale,
long durationInMillis)
Return the distance in time for a duration in milliseconds.
|
String |
ageFromNow(Locale locale,
Date date)
Reports the distance in time a date and now.
|
String |
formatDate(Locale locale,
Date date)
Return the formatted date.
|
String |
formatDateTime(Locale locale,
Date date)
Return the formatted datetime.
|
String |
formatDouble(Locale locale,
Double value)
Return the formatted decimal, with always one fraction digit.
|
String |
formatInteger(Locale locale,
Integer value)
Return the formatted integer.
|
String |
message(Locale locale,
String key,
String defaultValue,
Object... parameters)
Searches the message of the
key for the locale in the list of available bundles. |
String message(Locale locale, String key, @Nullable String defaultValue, Object... parameters)
key
for the locale
in the list of available bundles.
defaultValue
is returned.
locale
- the locale to translate intokey
- the key of the pattern to translatedefaultValue
- the default pattern returned when the key is not found in any bundleparameters
- the parameters used to format the message from the translated pattern.String age(Locale locale, long durationInMillis)
String age(Locale locale, Date fromDate, Date toDate)
age(java.util.Locale, long durationInMillis)
String ageFromNow(Locale locale, Date date)
age(java.util.Locale, java.util.Date, java.util.Date)
String formatDateTime(Locale locale, Date date)
Example: formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22T19:10:03+0100"))
returns "Jan 22, 2014 7:10 PM"
.
String formatDate(Locale locale, Date date)
formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22"))
returns "Jan 22, 2014"
.String formatDouble(Locale locale, Double value)
formatDouble(Locale.FRENCH, 10.56)
returns "10,6"
.String formatInteger(Locale locale, Integer value)
formatInteger(Locale.ENGLISH, 100000)
returns "100,000"
.Copyright © 2009–2018 SonarSource. All rights reserved.