Interface SharedLocalization
public interface SharedLocalization
Instance can be obtained from
SharedContext.localization()
- Since:
- 3.9.0
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionformatDateAndTime
(Date date) Formats the givenDate
using the format used by the Polarion UI to show the date and the time.formatDateAndTimeWithTZ
(Date date) Formats the givenDate
in the format used by the Polarion UI.formatDateOnly
(Date date) Formats the givenDate
using the format used by the Polarion UI to show only the date.formatMonthAndYear
(Date date) default String
formatNumber
(Number number) Formats the number using Polarion'sdefault format
.
UsesDecimalFormat
on server andNumberFormat
on client.formatNumber
(Number number, String pattern) UsesDecimalFormat
on server andNumberFormat
on client.formatTimeOnly
(Date date) Formats the givenDate
using the format used by the Polarion UI to show only the time.getFieldLabel
(String prototype, String fieldId) Returns label for specific field in given prototype.getFieldTooltip
(String prototype, String fieldId) Returns tooltip for specific field in given prototype.Returns label of the platform specific control key (Cmd on Mac, otherwise Ctrl).Gets the localized value for given key.Parameters withnull
value are rendered as empty string.boolean
parseDateAndTime
(String string) Parses the input string using the format used by the Polarion UI to show the date and the time.parseDateOnly
(String string) Parses the input string using the format used by the Polarion UI to show only the date.parseTimeOnly
(String string) Parses the input string using the format used by the Polarion UI to show only the time.
-
Field Details
-
DEFAULT_NUMBER_FORMAT
- Since:
- 3.20.2
- See Also:
-
-
Method Details
-
getFieldLabel
Returns label for specific field in given prototype.For the label of the prototype use the
PrototypeEnum.label(SharedLocalization)
. -
getFieldTooltip
Returns tooltip for specific field in given prototype. -
getString
-
getString
Parameters withnull
value are rendered as empty string. -
getString
Gets the localized value for given key. Accepts objects as parameters and will use the object'stoString()
method to render the string representation of the given objects.
Parameters withnull
value are rendered as empty string.- Since:
- 3.10.3
-
keyExists
-
formatDateOnly
Formats the givenDate
using the format used by the Polarion UI to show only the date.- See Also:
-
formatDateAndTime
Formats the givenDate
using the format used by the Polarion UI to show the date and the time.- See Also:
-
formatDateAndTimeWithTZ
Formats the givenDate
in the format used by the Polarion UI. (Displays the date, time, and time zone difference.) e.g. 2021-09-23 00:00 UTC+2 Primarily used to display the time and time zone in a readable format, especially when date and time are essential. (For example, in an access token.)- Since:
- 3.22.1
- See Also:
-
formatTimeOnly
Formats the givenDate
using the format used by the Polarion UI to show only the time.- See Also:
-
parseDateOnly
Parses the input string using the format used by the Polarion UI to show only the date. Returns null when the value cannot be parsed.- See Also:
-
parseDateAndTime
Parses the input string using the format used by the Polarion UI to show the date and the time. Returns null when the value cannot be parsed.- Since:
- 3.20.1
- See Also:
-
parseTimeOnly
Parses the input string using the format used by the Polarion UI to show only the time. Returns null when the value cannot be parsed.- Since:
- 3.20.1
- See Also:
-
formatMonthAndYear
-
formatNumber
UsesDecimalFormat
on server andNumberFormat
on client. Returns empty string when number is null. -
formatNumber
Formats the number using Polarion'sdefault format
.
UsesDecimalFormat
on server andNumberFormat
on client. Returns empty string when number is null.- Since:
- 3.20.2
-
getPlatformCtrlLabel
String getPlatformCtrlLabel()Returns label of the platform specific control key (Cmd on Mac, otherwise Ctrl).
-