Message Templates provide localization support out-of-the-box. Message Templates sent to a user will be localized according to the device locale settings. A business can also optionally specify a fallback locale for displaying the message if a translation does not exist.
This document covers:
Some Message Template parameters (e.g., date/time, prices, etc.) should be displayed differently depending on the client's language/locale. See the Localizable Parameters documentation for more information.
If the device is unsuccessful in localizing a parameter, it should fall back to using the HSMLocalizableParameter
's default
string.
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | Default text if localization fails |
| HSMCurrency | No | Localization spec for currency |
| HSMDateTime | No | Localization spec for date/time |
The currency
and date_time
fields are not required, but only one of them can be present if used.
The Whatsapp Business API Client will attempt to format the currency based on a specified localization.
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | Currency code as defined in ISO 4217 |
| Integer | Yes | Amount multipled by 1000 |
The Whatsapp Business API Client will attempt to format the date/time based on a specified localization. The supported date and time formats include:
Name | Type | Required | Description |
---|---|---|---|
| HSMDateTimeComponent | No | Date/time by component |
| HSMDateTimeUnixEpoch | No | Date/time by Unix epoch |
The component
and unix_epoch
fields are not required, but only one of them can be present if used.
Name | Type | Required | Description |
---|---|---|---|
| String | No | Both strings and numbers are accepted. If different from the value derived from the date (if specified), use the derived value. |
| Integer | No | The year |
| Integer | No | The month |
| Integer | No | The day of month |
| Integer | No | The hour |
| Integer | No | The minute |
| String | No | Type of calendar |
HSMDateTimeUnixEpoch
will be deprecated in May 2020. HSMDateTimeComponent
will be the default going forward. Please make changes to your code to avoid issues.
Name | Type | Required | Description |
---|---|---|---|
| Integer | Yes | Epoch timestamp in seconds |