Interface I18n


  • @ServerSide
    @ComputeEngineSide
    @Deprecated
    public interface I18n
    Deprecated.
    since 7.8 as plugins have no reason to use it anymore
    Main component that provides translation facilities.
    Since:
    2.10
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String age​(java.util.Locale locale, long durationInMillis)
      Deprecated.
      Return the distance in time for a duration in milliseconds.
      java.lang.String age​(java.util.Locale locale, java.util.Date fromDate, java.util.Date toDate)
      Deprecated.
      Return the distance in time between two dates.
      java.lang.String ageFromNow​(java.util.Locale locale, java.util.Date date)
      Deprecated.
      Reports the distance in time a date and now.
      java.lang.String formatDate​(java.util.Locale locale, java.util.Date date)
      Deprecated.
      Return the formatted date.
      java.lang.String formatDateTime​(java.util.Locale locale, java.util.Date date)
      Deprecated.
      Return the formatted datetime.
      java.lang.String formatDouble​(java.util.Locale locale, java.lang.Double value)
      Deprecated.
      Return the formatted decimal, with always one fraction digit.
      java.lang.String formatInteger​(java.util.Locale locale, java.lang.Integer value)
      Deprecated.
      Return the formatted integer.
      java.lang.String message​(java.util.Locale locale, java.lang.String key, java.lang.String defaultValue, java.lang.Object... parameters)
      Deprecated.
      Searches the message of the key for the locale in the list of available bundles.
    • Method Detail

      • message

        java.lang.String message​(java.util.Locale locale,
                                 java.lang.String key,
                                 @Nullable
                                 java.lang.String defaultValue,
                                 java.lang.Object... parameters)
        Deprecated.
        Searches the message of the key for the locale in the list of available bundles.
        If not found in any bundle, defaultValue is returned.
        If additional parameters are given (in the objects list), the result is used as a message pattern to use in a MessageFormat object along with the given parameters.
        Parameters:
        locale - the locale to translate into
        key - the key of the pattern to translate
        defaultValue - the default pattern returned when the key is not found in any bundle
        parameters - the parameters used to format the message from the translated pattern.
        Returns:
        the message formatted with the translated pattern and the given parameters
      • age

        java.lang.String age​(java.util.Locale locale,
                             long durationInMillis)
        Deprecated.
        Return the distance in time for a duration in milliseconds.
        Examples :
        • age(Locale.ENGLISH, 1000) -> less than a minute
        • age(Locale.ENGLISH, 60000) -> about a minute
        • age(Locale.ENGLISH, 120000) -> 2 minutes
        • age(Locale.ENGLISH, 3600000) -> about an hour
        • age(Locale.ENGLISH, 7200000) -> 2 hours
        • age(Locale.ENGLISH, 86400000) -> a day
        • age(Locale.ENGLISH, 172800000) -> 2 days
        Since:
        4.2
      • age

        java.lang.String age​(java.util.Locale locale,
                             java.util.Date fromDate,
                             java.util.Date toDate)
        Deprecated.
        Return the distance in time between two dates.
        Since:
        4.2
        See Also:
        age(Locale, long durationInMillis)
      • ageFromNow

        java.lang.String ageFromNow​(java.util.Locale locale,
                                    java.util.Date date)
        Deprecated.
        Reports the distance in time a date and now.
        Since:
        4.2
        See Also:
        age(Locale, Date, Date)
      • formatDateTime

        java.lang.String formatDateTime​(java.util.Locale locale,
                                        java.util.Date date)
        Deprecated.
        Return the formatted datetime.

        Example: formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22T19:10:03+0100")) returns "Jan 22, 2014 7:10 PM".

        Since:
        4.2
      • formatDate

        java.lang.String formatDate​(java.util.Locale locale,
                                    java.util.Date date)
        Deprecated.
        Return the formatted date.
        Example: formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22")) returns "Jan 22, 2014".
        Since:
        4.2
      • formatDouble

        java.lang.String formatDouble​(java.util.Locale locale,
                                      java.lang.Double value)
        Deprecated.
        Return the formatted decimal, with always one fraction digit.
        Example: formatDouble(Locale.FRENCH, 10.56) returns "10,6".
        Since:
        4.4
      • formatInteger

        java.lang.String formatInteger​(java.util.Locale locale,
                                       java.lang.Integer value)
        Deprecated.
        Return the formatted integer.
        Example: formatInteger(Locale.ENGLISH, 100000) returns "100,000".
        Since:
        4.4