- #2844
c294df9Thanks @trishrempel! - Update formatName and abbreviateName to return a string or undefined
- Updated dependencies [
c294df9]:- @shopify/name@1.3.0
- Updated dependencies [
d2c9fae]:- @shopify/dates@2.1.1
- #2821
8c53994Thanks @alex-page! - Update NumberFortmatOptions to use typescript 5.5 values 'currency' | 'decimal' | 'percent'
- Updated dependencies [
1171b00]:- @shopify/react-hooks@4.1.2
- Updated dependencies [
2b70145]:- @shopify/react-hooks@4.1.1
- Updated dependencies [
0fc2d54]:- @shopify/react-hooks@4.1.0
- Updated dependencies [
5546b1d,d691952]:- @shopify/react-hooks@4.0.0
- @shopify/react-effect@5.2.0
- @shopify/useful-types@5.3.0
- @shopify/name@1.2.0
-
#2785
97f8f6cf5Thanks @vsumner! - Drop support for node 14 and 16. Support node LTS and up. -
#2787
f50049004Thanks @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
591e65366Thanks @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
3d072b067Thanks @ryanwilsonperkin! - Add absolute option to I18n#translationKeyExists
- #2682
fc90edd83Thanks @mikegarfinkle! - AddedabbreviateBusinessNamemethod. Also delegated all name related functions to the @shopify/name repo.
- #2635
983d257a2Thanks @mikegarfinkle! - Added abbreviateName and identifyScripts methods
- Updated dependencies [
a3b5c3fc0]:- @shopify/react-hooks@3.0.5
-
#2608
ba4da84d5Thanks @BPScott! - Useimport typeeverywhere that we deal with importing types -
Updated dependencies [
ba4da84d5]:- @shopify/react-hooks@3.0.4
- @shopify/useful-types@5.1.2
-
#2593
2f731db68Thanks @BPScott! - Remove unneededvoid 0class property initializations -
#2595
93ec0a0e5Thanks @BPScott! - Useimport typewhen importing types -
Updated dependencies [
2f731db68,93ec0a0e5]:- @shopify/react-effect@5.0.3
- @shopify/dates@2.0.3
- #2586
946be5019Thanks @kamiro! - Restored React-Native compatability by removing unicode-mode Regex
-
#2581
2781826faThanks @BPScott! - Replace dependency on@shopify/decoratorswith@shopify/function-enhancers -
Updated dependencies [
2781826fa,2aa32e8b8]:- @shopify/dates@2.0.2
- @shopify/react-hooks@3.0.3
- #2539
4fe13713aThanks @movermeyer! - Allow CLDR explicit "0" and "1" pluralization keys
- #2507
a7afa5f8fThanks @trishrempel! - Provide fallback for Intl.Locale functionality in memoizedNumberFormatter()
- #2501
81ceec1a1Thanks @trishrempel! - Improve currency formatting by enforcing latin number formatting and preserving negative sign and directional control characters.
- #2458
4be4321ccThanks @movermeyer! - Add ordinal pluralization lookups ini18n.translate
-
#2456
90c4115a3Thanks @trishrempel! - UpdateformatCurrency()to useform: 'auto'by default whenformis not provided. -
#2451
4b5aa9448Thanks @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.00i18n.formatCurrency(2, {currency: 'AUD', form: 'explicit'})A$2.00 AUD$2.00 AUDi18n.formatCurrency(2, {currency: 'AUD', form: 'auto'})A$2.00 AUD$2.00 AUDi18n.formatCurrency(2, {currency: 'SGD', form: 'explicit'})SGD 2.00 SGD$2.00 SGDi18n.getCurrencySymbol('AUD'){symbol: 'A$', prefixed: true}{symbol: '$', prefixed: true}
- #2402
35648c5efThanks @movermeyer! - Add basic support for lateral inheritance (countlookups will now fall back tootherfirst)
-
#2389
03c1abc8cThanks @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
79302260eThanks @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
interpolateoption 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 -
generateTranslationIndexesno longer fails withENOBUFSerrors in projects with tens of thousands of translation files [#2269] - Patch - Updated list of currency decimal places according to ISO 4217 standards [#2260]
- Minor -
generateTranslationIndexesnow parses jsonc files (when they have a.jsonextension) [#2239]
- Patch -
generateTranslationIndexesno longer fails withENOBUFSerrors in projects with many thousands of translation files [#2239] - Patch -
generateTranslationIndexesnow 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
unformatNumberandunformatCurrencyto 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
unformatCurrencyto be callable on its own result for locales likevianditwhen a period is a thousands separator. [#2139]
- No updates. Transitive dependency bump.
- Fixed
unformatCurrencyto unformat correctly for locales likevianditwhen 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-nexttoloomfor building - package build output remains identical. [#2039]
- No updates. Transitive dependency bump.
- No updates. Transitive dependency bump.
- Added
with-explicit-pathsoption 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/typesVersionsfields to point directly into the build folder [#1980]
- Makes humanized short timezones uppercase. #1977
- added back
toLocalLowerCaseto humanized times. #1972 removed it which causedamandpmto be capitalized in some cases #1976
- Fixed issue where humanized date options were repeated and not properly capitalized #1972
- Officially supports React
17.x1969
- No updates. Transitive dependency bump.
- Update
@babel/coreto^7.14.6#1948
- Update
fs-extrato^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
currencyDecimalSymbolto handle mismatched locale/currency #1912
- Added a
noneoption to theCurrencyFormatOptionsthat 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
currencyDecimalSymbolfunction returningDECIMAL_NOT_SUPPORTEDfor 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
unformatNumberthat caused the minus sign to be removed from negative numbers #1758 - Made private method
numberSymbolspublic #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
getTranslationTreewhen having multiple translation dictionaries. #1662 - Remove unused
nooputil helper #1669
- Updated
tslibdependency 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
formatDatefor dates less than 1 week away and less than 1 year away [#1438]Please see the migration guide for more information.
-
Updated
I18n#humanizeDateto humanize today's date asToday at {time}[#1459]Please see the migration guide for more information.
- Fixed
DateStyle.Shortzero-padding days (#1468)
-
Modified
I18n#humanizeDateto humanize future dates, specificallyTomorrow at {time}[#1391]Please see the migration guide for more information.
jest.Matcherstype updated to match@types/jestversion25[#1239]
- updated
memoizedNumberFormatterto support allIntl.NumberFormatconstructor inputs (#1366)
- adding additional exports:
RegisterOptions,CurrencyFormatOptions,NumberFormatOptions,TranslateOptions,RootTranslateOptions,Replacements(#1365)
- Updated
formatCurrencyto usememoizedNumberFormatterto eliminate memory leak (#1310)
- Removed the unicode
RegExpflag ongetCurrencySymbolin order to support IE11 (#1363)
- Add
defaultLocaleoption to Babel plugin (#1225) - Added
form: 'auto'option toformatCurrency, to automatically selectshortorexplicitbased oncurrencyanddefaultCurrency(#1350)
- Added korean eastern name formatter
- Added
hasEasternNameOrderFormattermethod, 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) -
formatCurrencywill now put the minus sign in front of the currency symbol when the amount is negative (#1264)
MissingTranslationErrornow uses thenormalizedIdwhich includes thescope(#1258)
- Added
Gipcurrency code value (#1235)
- Fixed
unformatNumberfor numbers using a period as the thousand separator (#1215)
- Minor - added a
generateTranslationDictionarieshelper, andmode=from-dictionary-indexoption 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
generateTranslationIndexeshelper, andmode=from-generated-indexoption for the Babel plugin. This can be used to resolve unwanted cache hits when adding new translation files (#1188)
translationKeyExistson i18n works as expected with onError handler (#1162)
- Added locale to be part of
MissingTranslationError(#1178)
- Added
memoizedPluralRulesutility function (#1065 - Added
memoizedNumberFormatterutility function (#1065
- Removed leading zero from hours of time output by
I18n#humanizeDatemethod (#1093)
- Removed creation of
Intl.PluralRulesobject fromI18nconstructor which caused backwards incompatibility for any platforms needing a polyfill forIntl.Plualrulessupport (#1065
- Added displayName to
withI18ndecorator to help with debugging (#1048)
- Fixed babel plugin incompatiblity with jest code coverage
-
Modified translation keys used by
I18n#humanizeDatemethod (#1011).Please see the migration guide for more information.
-
Added
ordinalmethod 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/datesfunctions with those from@shopify/dates. - Removed
@shopify/javascript-utilities/datesdependency.
- Fixed translation of weekday in
humanizeDatefor 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
formatNamemethod 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
loadingproperty to I18n class. This helps to determine loading states when retrieving translations async on apps that are rendered client-side.
- Added
translationKeyExistsmethod 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-typescriptwhen the last import pulls in only type definitions (#699)
- Now exports formerly missing typings for
TranslationDictionary(#693)
- Added
getTranslationTreeto get the translation tree from a key (#645)
- Fixed a number of performance issues with resolving asynchronous translations (#659)
Weekdaysrenamed toWeekdayas part ofshopify/typescript/prefer-singular-enumseslint rule (#648)
- Added a
useSimpleI18nhook for performantly sharing an i18n instance within a React subtree (#639)
- Improved the typing of
withI18nto no longer mark thei18nprop as required (#639)
This library now requires React 16.8.
- Added a
useI18nhook 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
Moduleobjects instead of the actual translation dictionaries #618
- Memoize
Intl.DateTimeFormatandIntl.NumberFormat#596
- Expose
currencyDecimalPlacesandDEFAULT_DECIMAL_PLACES#590
- Support unexpected usage of decimal symbols in
I18n#unformatCurrency#577
- Reverted a change that caused
I18n#getCurrencySymbolto sometimes return an empty string
- Added an optional
onErrorfield to the options forI18nManager, which controls how descendantI18nobjects will respond to some types of recoverable errors #550
- Fixed an issue where
I18ninstances 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
filenameRelativebeing passed viaopts.
- Babel plugin was added to auto-generate the arguments for
withI18nwhen an adjacenttranslationsfolder exists #505
MissingTranslationErrornow 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
unformatCurrencyutility to return the normalized value of formatted currency #486
CurrencyCodeenum types #473
- Format count when handling pluralized translation #447
- Start of Changelog