Interface SharedLocalization
public interface SharedLocalization
Instance can be obtained from
SharedContext.localization()- Since:
- 3.9.0
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionformatDateAndTime(Date date) Formats the givenDateusing the format used by the Polarion UI to show the date and the time.formatDateAndTimeWithTZ(Date date) Formats the givenDatein the format used by the Polarion UI.formatDateOnly(Date date) Formats the givenDateusing the format used by the Polarion UI to show only the date.formatMonthAndYear(Date date) default StringformatNumber(Number number) Formats the number using Polarion'sdefault format.
UsesDecimalFormaton server andNumberFormaton client.formatNumber(Number number, String pattern) UsesDecimalFormaton server andNumberFormaton client.formatTimeOnly(Date date) Formats the givenDateusing 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 withnullvalue are rendered as empty string.booleanparseDateAndTime(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 withnullvalue 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 withnullvalue are rendered as empty string.- Since:
- 3.10.3
-
keyExists
-
formatDateOnly
Formats the givenDateusing the format used by the Polarion UI to show only the date.- See Also:
-
formatDateAndTime
Formats the givenDateusing the format used by the Polarion UI to show the date and the time.- See Also:
-
formatDateAndTimeWithTZ
Formats the givenDatein 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 givenDateusing 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
UsesDecimalFormaton server andNumberFormaton client. Returns empty string when number is null. -
formatNumber
Formats the number using Polarion'sdefault format.
UsesDecimalFormaton server andNumberFormaton 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).
-