You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be useful to extract the base i18n logic from react-i18n, possibly to the quilt i18n library, in order to allow straightforward integration with non-React TS/JS projects.
a number of the files in react-i18n are .ts vs .tsx files, including i18n.ts, implying that they do not depend on react for their functionality and could be extracted
react-i18n already has i18n as a dependency, so it would only need to switch to importing certain things like the I18n object from that package rather than having it in the react-i18n repo
Motivation
What inspired this enhancement? What makes you think this should be in quilt?
Our particular use case is adding i18n support to ShopifyQL, which is a Typescript package.
Currently our options are to use an external non-Shopify library, implement our own i18n logic or use the react-i18n I18n object directly, forcing us to require react in our dependencies even though we do not use it, leading to unnecessary bloat. We would like to be able to stay within the Shopify ecosystem to more easily stay in line with Shopify I18n guidelines, and would prefer not to have to import a library that is not used directly by our package.
Checklist
Please delete the labels section before submitting your issue
I have described this issue in a way that is actionable (if possible)
The text was updated successfully, but these errors were encountered:
react-i18n is designed for translation work in applications. Usage in packages that are published to npm was not part of its original design consideration. It probably works but the ergonomics and runtime behaviour are probably somewhat clunky especially around "what if you ship this package in an app that has per-locale build"s. There's a gap here for a simpler version of i18n that is designed for usage in libraries but this is not a priority given the current goals of this team right now.
If you want a simple translations with one file for the whole package, it might be interesting to copy polaris's i18n approach.
Overview
It would be useful to extract the base i18n logic from react-i18n, possibly to the quilt i18n library, in order to allow straightforward integration with non-React TS/JS projects.
Motivation
Our particular use case is adding i18n support to ShopifyQL, which is a Typescript package.
Currently our options are to use an external non-Shopify library, implement our own i18n logic or use the react-i18n I18n object directly, forcing us to require react in our dependencies even though we do not use it, leading to unnecessary bloat. We would like to be able to stay within the Shopify ecosystem to more easily stay in line with Shopify I18n guidelines, and would prefer not to have to import a library that is not used directly by our package.
Checklist
The text was updated successfully, but these errors were encountered: