-
#2785
97f8f6cf5
Thanks @vsumner! - Drop support for node 14 and 16. Support node LTS and up. -
#2787
f50049004
Thanks @vsumner! - Drop support for React 17
- Updated dependencies [
97f8f6cf5
,f50049004
]:- @shopify/dates@2.1.0
- @shopify/function-enhancers@3.1.0
- @shopify/i18n@2.1.0
- @shopify/name@1.1.0
- @shopify/react-effect@5.1.0
- @shopify/react-hooks@3.2.0
- @shopify/useful-types@5.2.0
-
#2718
591e65366
Thanks @dependabot! - Bump @babel/traverse from 7.17.9 to 7.23.2 -
Updated dependencies [
591e65366
]:- @shopify/name@1.0.2
- @shopify/react-hooks@3.1.1
- Updated dependencies [
a4eae7db3
]:- @shopify/react-hooks@3.1.0
- Updated dependencies [
b2cfd3b4d
]:- @shopify/name@1.0.1
- #2711
3d072b067
Thanks @ryanwilsonperkin! - Add absolute option to I18n#translationKeyExists
- #2682
fc90edd83
Thanks @mikegarfinkle! - AddedabbreviateBusinessName
method. Also delegated all name related functions to the @shopify/name repo.
- #2635
983d257a2
Thanks @mikegarfinkle! - Added abbreviateName and identifyScripts methods
- Updated dependencies [
a3b5c3fc0
]:- @shopify/react-hooks@3.0.5
-
#2608
ba4da84d5
Thanks @BPScott! - Useimport type
everywhere that we deal with importing types -
Updated dependencies [
ba4da84d5
]:- @shopify/react-hooks@3.0.4
- @shopify/useful-types@5.1.2
-
#2593
2f731db68
Thanks @BPScott! - Remove unneededvoid 0
class property initializations -
#2595
93ec0a0e5
Thanks @BPScott! - Useimport type
when importing types -
Updated dependencies [
2f731db68
,93ec0a0e5
]:- @shopify/react-effect@5.0.3
- @shopify/dates@2.0.3
- #2586
946be5019
Thanks @kamiro! - Restored React-Native compatability by removing unicode-mode Regex
-
#2581
2781826fa
Thanks @BPScott! - Replace dependency on@shopify/decorators
with@shopify/function-enhancers
-
Updated dependencies [
2781826fa
,2aa32e8b8
]:- @shopify/dates@2.0.2
- @shopify/react-hooks@3.0.3
- #2539
4fe13713a
Thanks @movermeyer! - Allow CLDR explicit "0" and "1" pluralization keys
- #2507
a7afa5f8f
Thanks @trishrempel! - Provide fallback for Intl.Locale functionality in memoizedNumberFormatter()
- #2501
81ceec1a1
Thanks @trishrempel! - Improve currency formatting by enforcing latin number formatting and preserving negative sign and directional control characters.
- #2458
4be4321cc
Thanks @movermeyer! - Add ordinal pluralization lookups ini18n.translate
-
#2456
90c4115a3
Thanks @trishrempel! - UpdateformatCurrency()
to useform: 'auto'
by default whenform
is not provided. -
#2451
4b5aa9448
Thanks @sunical! - Update currency symbol formatting to follow Polaris localized currency formatting guidelines. No longer displays a character or ISO code beside the currency symbol, for certain currencies and locales. The following table summarizes the changes, assuming a locale ofen-US
:Method Previous output New output i18n.formatCurrency(2, {currency: 'AUD', form: 'short'})
A$2.00
$2.00
i18n.formatCurrency(2, {currency: 'AUD', form: 'explicit'})
A$2.00 AUD
$2.00 AUD
i18n.formatCurrency(2, {currency: 'AUD', form: 'auto'})
A$2.00 AUD
$2.00 AUD
i18n.formatCurrency(2, {currency: 'SGD', form: 'explicit'})
SGD 2.00 SGD
$2.00 SGD
i18n.getCurrencySymbol('AUD')
{symbol: 'A$', prefixed: true}
{symbol: '$', prefixed: true}
- #2402
35648c5ef
Thanks @movermeyer! - Add basic support for lateral inheritance (count
lookups will now fall back toother
first)
-
#2389
03c1abc8c
Thanks @BPScott! - Add types field to package.json export maps to support typescript consumers that usemoduleResolution: "node16"
-
Updated dependencies [
03c1abc8c
]:- @shopify/dates@2.0.1
- @shopify/decorators@3.0.1
- @shopify/function-enhancers@3.0.1
- @shopify/i18n@2.0.1
- @shopify/react-effect@5.0.2
- @shopify/react-hooks@3.0.2
- @shopify/useful-types@5.1.1
- #2331
79302260e
Thanks @depl0y! - AddDateStyle.DateTime
. to format dates in the styleJun 12, 2022 at 10:34 pm
- Updated dependencies [
b42a99a7d
]:- @shopify/useful-types@5.1.0
- No updates. Transitive dependency bump.
- Fixed regression where object replacement values were being cast as strings. [#2295]
- Passing a number replacement value was returning an array instead of a string. [#2292]
- Added an
interpolate
option to support custom placeholder formats [#2267]
- Drop support for node 12 and Safari 10, 11 and 12. Remove wildcard export in exports field. [#2277]
- Patch -
generateTranslationIndexes
no longer fails withENOBUFS
errors in projects with tens of thousands of translation files [#2269] - Patch - Updated list of currency decimal places according to ISO 4217 standards [#2260]
- Minor -
generateTranslationIndexes
now parses jsonc files (when they have a.json
extension) [#2239]
- Patch -
generateTranslationIndexes
no longer fails withENOBUFS
errors in projects with many thousands of translation files [#2239] - Patch -
generateTranslationIndexes
now ignores these directories:.git
;build
;node_modules
;public
;tmp
[#2239]
- No updates. Transitive dependency bump.
- Correct wildcard export to
./*
[#2209]
- Export cjs by default for
babel
. [#2193]
- No updates. Transitive dependency bump.
- Use
./*
instead of./
in package.json exports to fix deprecation warning. [#2184]
- Updated list of currency decimal places according to ISO 4217 standards [#2187]
- Fixed
unformatNumber
andunformatCurrency
to return''
when only non-digits are provided in the input string. [#2176]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Rerelease after failed publish. No code changes.
- No updates. Transitive dependency bump.
- Fixed
unformatCurrency
to be callable on its own result for locales likevi
andit
when a period is a thousands separator. [#2139]
- No updates. Transitive dependency bump.
- Fixed
unformatCurrency
to unformat correctly for locales likevi
andit
when a period is a thousands separator. [#2126]
- Transforming the space for a non-breaking space on formatted time. [#2041]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Fixed babel helpers file being generated with incorrect filename in esm build. [#2082]
- Updated regex for humanized timezones to include offsets #2077
- Migrate from
sewing-kit-next
toloom
for building - package build output remains identical. [#2039]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Added
with-explicit-paths
option to babel plugin. #1973
- Enable type checking in tests and fix type errors. [#2011]
- No updates. Transitive dependency bump.
- Fix format currency double negative bug in nordic regions [#2004]
- Updated build tooling, types are now compiled with TypeScript 4.3. [#1997]
- Update dependency on
change-case
. [#1990]
- Update to latest sewing-kit-next for build. Update
types
/typesVersions
fields to point directly into the build folder [#1980]
- Makes humanized short timezones uppercase. #1977
- added back
toLocalLowerCase
to humanized times. #1972 removed it which causedam
andpm
to be capitalized in some cases #1976
- Fixed issue where humanized date options were repeated and not properly capitalized #1972
- Officially supports React
17.x
1969
- No updates. Transitive dependency bump.
- Update
@babel/core
to^7.14.6
#1948
- Update
fs-extra
to^9.1.0
#1946
- Update minimum supported node version to 12.14.0. Add engines field to help enforce usage of this version. #1906
- Updated
currencyDecimalSymbol
to handle mismatched locale/currency #1912
- Added a
none
option to theCurrencyFormatOptions
that returns a currency-formatted string without a currency symbol #1907
- Fixed higher chance of id collision caused by trimming of generated hashes in babel-plugin #1905
- Fixed
currencyDecimalSymbol
function returningDECIMAL_NOT_SUPPORTED
for RSD #1902
- Removed dependency on tslib, as we no-longer compile with
tsc
. #1829
- Error when you don't pass a filename to babel when using the babel plugin. Updated types within babel-plugin so it passes TypeScript's "noImplicitThis" checks. #1814
- Fixed issue where humanized date for today may be reported as tomorrow #1797
- Fixed bug in
unformatNumber
that caused the minus sign to be removed from negative numbers #1758 - Made private method
numberSymbols
public #1758
- Updated multi-build outputs to include mandatory extensions to fix "Module not found" issues reported by ESM supported bundlers #1759
- Add new build outputs (CommonJS, ESM, esnext, Node) for greater tree-shakability #1698
- Fix bug in
getTranslationTree
when having multiple translation dictionaries. #1662 - Remove unused
noop
util helper #1669
- Updated
tslib
dependency to^1.14.1
. #1657
- Fixed
DateStyle.Humanize
's handling of time zones for dates that are yesterday, today, or tomorrow [#1623]
- Fixed (updated) currencies list. [#1632]
-
Adds future date formatting to
formatDate
for dates less than 1 week away and less than 1 year away [#1438]Please see the migration guide for more information.
-
Updated
I18n#humanizeDate
to humanize today's date asToday at {time}
[#1459]Please see the migration guide for more information.
- Fixed
DateStyle.Short
zero-padding days (#1468)
-
Modified
I18n#humanizeDate
to humanize future dates, specificallyTomorrow at {time}
[#1391]Please see the migration guide for more information.
jest.Matchers
type updated to match@types/jest
version25
[#1239]
- updated
memoizedNumberFormatter
to support allIntl.NumberFormat
constructor inputs (#1366)
- adding additional exports:
RegisterOptions
,CurrencyFormatOptions
,NumberFormatOptions
,TranslateOptions
,RootTranslateOptions
,Replacements
(#1365)
- Updated
formatCurrency
to usememoizedNumberFormatter
to eliminate memory leak (#1310)
- Removed the unicode
RegExp
flag ongetCurrencySymbol
in order to support IE11 (#1363)
- Add
defaultLocale
option to Babel plugin (#1225) - Added
form: 'auto'
option toformatCurrency
, to automatically selectshort
orexplicit
based oncurrency
anddefaultCurrency
(#1350)
- Added korean eastern name formatter
- Added
hasEasternNameOrderFormatter
method, to determine whether an Eastern name order formatter exists for the locale/language
-
Fixed memory leaks when server-side rendering for
Intl.DateTimeFormat.format()
andIntl.NumberFormat.format()
(#1287) -
formatCurrency
will now put the minus sign in front of the currency symbol when the amount is negative (#1264)
MissingTranslationError
now uses thenormalizedId
which includes thescope
(#1258)
- Added
Gip
currency code value (#1235)
- Fixed
unformatNumber
for numbers using a period as the thousand separator (#1215)
- Minor - added a
generateTranslationDictionaries
helper, andmode=from-dictionary-index
option for the Babel plugin. This can be used to build many versions of an application, with each version containing a specific locale's translations directly within JavaScript (#1197)
- Added a
generateTranslationIndexes
helper, andmode=from-generated-index
option for the Babel plugin. This can be used to resolve unwanted cache hits when adding new translation files (#1188)
translationKeyExists
on i18n works as expected with onError handler (#1162)
- Added locale to be part of
MissingTranslationError
(#1178)
- Added
memoizedPluralRules
utility function (#1065 - Added
memoizedNumberFormatter
utility function (#1065
- Removed leading zero from hours of time output by
I18n#humanizeDate
method (#1093)
- Removed creation of
Intl.PluralRules
object fromI18n
constructor which caused backwards incompatibility for any platforms needing a polyfill forIntl.Plualrules
support (#1065
- Added displayName to
withI18n
decorator to help with debugging (#1048)
- Fixed babel plugin incompatiblity with jest code coverage
-
Modified translation keys used by
I18n#humanizeDate
method (#1011).Please see the migration guide for more information.
-
Added
ordinal
method to I18n class to translate ordinal numbers (#1003)Consumers will need to add the following translation keys for proper ordinal translation. Note: values are English examples.
{ "ordinal": { "one": "{number}st", "two": "{number}nd", "few": "{number}rd", "other": "{number}th" } }
- Replaced
@shopify/javascript-utilities/dates
functions with those from@shopify/dates
. - Removed
@shopify/javascript-utilities/dates
dependency.
- Fixed translation of weekday in
humanizeDate
for dates less than one week old.
- Updated to
@shopify/dates@^0.2.0
- Added support for pluralization to
getTranslationTree
(#988)
- Added
form:
option (one ofshort
|explicit
) toformatCurrency()
(#916)
- Added
formatName
method to I18n class to format a first name and/or last name based on the locale used. (#834)
- Added an optional replacements argument to
getTranslationTree
(#874)
- Fixed an issue where async translations would sometimes not be shown on the initial mount of a component (#824)
- Added
loading
property to I18n class. This helps to determine loading states when retrieving translations async on apps that are rendered client-side.
- Added
translationKeyExists
method for checking dynamic keys (#766)
- Added missing dependency for memoize function (#746)
- The Babel plugin now fails when multiple components in a single file attempt to import translations, as this can cause build issues in Webpack (#734)
- The Babel plugin now does not attempt to load asynchronous translations for locales do not have dedicated translation files (#738)
- Fixes transpilation for
babel-preset-typescript
when the last import pulls in only type definitions (#699)
- Now exports formerly missing typings for
TranslationDictionary
(#693)
- Added
getTranslationTree
to get the translation tree from a key (#645)
- Fixed a number of performance issues with resolving asynchronous translations (#659)
Weekdays
renamed toWeekday
as part ofshopify/typescript/prefer-singular-enums
eslint rule (#648)
- Added a
useSimpleI18n
hook for performantly sharing an i18n instance within a React subtree (#639)
- Improved the typing of
withI18n
to no longer mark thei18n
prop as required (#639)
This library now requires React 16.8.
- Added a
useI18n
hook as the new first-class API (#547)
- Refactored the way parent/ child translations were stored, which should slightly improve performance (#547)
- Fixed an issue where the Babel plugin would return
Module
objects instead of the actual translation dictionaries #618
- Memoize
Intl.DateTimeFormat
andIntl.NumberFormat
#596
- Expose
currencyDecimalPlaces
andDEFAULT_DECIMAL_PLACES
#590
- Support unexpected usage of decimal symbols in
I18n#unformatCurrency
#577
- Reverted a change that caused
I18n#getCurrencySymbol
to sometimes return an empty string
- Added an optional
onError
field to the options forI18nManager
, which controls how descendantI18n
objects will respond to some types of recoverable errors #550
- Fixed an issue where
I18n
instances would be created with two copies of each translation dictionary when the locale was equal to the fallback locale #553
- Babel plugin now correctly works without
filenameRelative
being passed viaopts
.
- Babel plugin was added to auto-generate the arguments for
withI18n
when an adjacenttranslations
folder exists #505
MissingTranslationError
now prints the missing translation as part of the message #497
- Async translations that do not resolve to a translation dictionary are now serialized correctly #494
- Multiple instances of the same component now reuse an inflight promise for translations #498
- Upgraded to the latest version of
react-effect
. This version has some breaking changes, but this does not actually change any API inreact-i18n
. #477
- Add
unformatCurrency
utility to return the normalized value of formatted currency #486
CurrencyCode
enum types #473
- Format count when handling pluralized translation #447
- Start of Changelog