For localization (l10n) functionality, like localizing messages.
| Type | Name and description |
|---|---|
java.lang.String |
format(java.lang.Object value, java.lang.String format)Format a Number, Timestamp, Date, Time, or Calendar object using the given format string. |
java.lang.String |
format(java.lang.Object value, java.lang.String format, java.util.Locale locale, java.util.TimeZone tz) |
java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId, java.lang.Integer fractionDigits)Format currency amount for user to view. |
java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId) |
java.lang.String |
formatCurrency(java.lang.Object amount, java.lang.String uomId, java.lang.Integer fractionDigits, java.util.Locale locale) |
java.lang.String |
localize(java.lang.String original)Use the current locale (see ec.user.getLocale() method) to localize the message based on data in the moqui.basic.LocalizedMessage entity. |
java.lang.String |
localize(java.lang.String original, java.util.Locale locale)Localize a String using the given Locale instead of the current user's. |
java.sql.Date |
parseDate(java.lang.String input, java.lang.String format) |
java.util.Calendar |
parseDateTime(java.lang.String input, java.lang.String format) |
java.math.BigDecimal |
parseNumber(java.lang.String input, java.lang.String format) |
java.sql.Time |
parseTime(java.lang.String input, java.lang.String format) |
java.sql.Timestamp |
parseTimestamp(java.lang.String input, java.lang.String format) |
Format a Number, Timestamp, Date, Time, or Calendar object using the given format string. If no format string is specified the default for the user's locale and time zone will be used.
value - The value to format. Must be a Number, Timestamp, Date, Time, or Calendar object.format - The format string used to specify how to format the value.Format currency amount for user to view.
amount - An object representing the amount, should be a subclass of Number.uomId - The uomId (ISO currency code), required.fractionDigits - Number of digits after the decimal point to display. If null defaults to number defined
by java.util.Currency.defaultFractionDigits() for the specified currency in uomId.Use the current locale (see ec.user.getLocale() method) to localize the message based on data in the moqui.basic.LocalizedMessage entity. The localized message may have variables inserted using the ${} syntax that when this is called through ec.resource.expand(). The approach here is that original messages are actual messages in the primary language of the application. This reduces issues with duplicated messages compared to the approach of explicit/artificial property keys. Longer messages (over 255 characters) should use an artificial message key with the actual value always coming from the database.
Localize a String using the given Locale instead of the current user's.