Interface SharedLocalization


public interface SharedLocalization
Instance can be obtained from SharedContext.localization()
Since:
3.9.0
  • Field Details

  • Method Details

    • getFieldLabel

      @NotNull String getFieldLabel(@NotNull String prototype, @NotNull String fieldId)
      Returns label for specific field in given prototype.

      For the label of the prototype use the PrototypeEnum.label(SharedLocalization).

    • getFieldTooltip

      @NotNull String getFieldTooltip(@NotNull String prototype, @NotNull String fieldId)
      Returns tooltip for specific field in given prototype.
    • getString

      @NotNull String getString(@NotNull String key)
    • getString

      @NotNull String getString(@NotNull String key, @NotNull String... params)
      Parameters with null value are rendered as empty string.
    • getString

      @NotNull String getString(@NotNull String key, @NotNull Object... params)
      Gets the localized value for given key. Accepts objects as parameters and will use the object's toString() method to render the string representation of the given objects.

      Parameters with null value are rendered as empty string.
      Since:
      3.10.3
    • keyExists

      boolean keyExists(@NotNull String key)
    • formatDateOnly

      @NotNull String formatDateOnly(@Nullable Date date)
      Formats the given Date using the format used by the Polarion UI to show only the date.
      See Also:
    • formatDateAndTime

      @NotNull String formatDateAndTime(@Nullable Date date)
      Formats the given Date using the format used by the Polarion UI to show the date and the time.
      See Also:
    • formatDateAndTimeWithTZ

      @NotNull String formatDateAndTimeWithTZ(@Nullable Date date)
      Formats the given Date 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

      @NotNull String formatTimeOnly(@Nullable Date date)
      Formats the given Date using the format used by the Polarion UI to show only the time.
      See Also:
    • parseDateOnly

      @Nullable Date parseDateOnly(@Nullable String string)
      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

      @Nullable Date parseDateAndTime(@Nullable String string)
      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

      @Nullable Date parseTimeOnly(@Nullable String string)
      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

      @NotNull String formatMonthAndYear(@Nullable Date date)
    • formatNumber

      @NotNull String formatNumber(@Nullable Number number, @NotNull String pattern)
      Uses DecimalFormat on server and NumberFormat on client. Returns empty string when number is null.
    • formatNumber

      @NotNull default String formatNumber(@Nullable Number number)
      Formats the number using Polarion's default format.
      Uses DecimalFormat on server and NumberFormat 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).