This is a concise summary of changes and recommendations around updating @shopify/react-i18n
in consuming projects. For a more detailed list of changes, see the changelog.
🛑Breaking change - New translation key is needed for future dates formatted with DateStyle.Humanize
. Consumers will need to add the translation key as outlined below.
"date": {
"humanize": {
...
"tomorrow": "Tomorrow at {time}"
}
},
🛑Breaking change - The translation keys for dates formatted with DateStyle.Humanize
have changed. Consumers will need to modify the translation keys as outlined below.
-
The top-level "humanize" key is now nested under a "date" key.
Before
{ "humanize": { ... } }
After
{ "date": { "humanize": { ... } } }
-
The
day
replacement parameter for thelessThanOneWeekAgo
(formerlyweekday
) string has been renamed toweekday
.Before
"weekday": "{day} at {time}",
After
"lessThanOneWeekAgo": "{weekday} at {time}"
-
The individual date string keys have been renamed as shown in the following table.
Original Key New Key now
lessThanOneMinuteAgo
minutes
lessThanOneHourAgo
yesterday
yesterday
weekday
lessThanOneWeekAgo
date
lessThanOneYearAgo
Example before
{ "humanize": { "date": "{date} at {time}", "minutes": "{count} minutes ago", "now": "Just now", "weekday": "{day} at {time}", "yesterday": "Yesterday at {time}" } }
Example after
"date": { "humanize": { "lessThanOneMinuteAgo": "Just now", "lessThanOneHourAgo": "{count} minutes ago", "yesterday": "Yesterday at {time}", "lessThanOneWeekAgo": "{weekday} at {time}", "lessThanOneYearAgo": "{date} at {time}" } },