When initializing i18next with this package, the default formatters don't appear to be working.
Codesandbox reproduction: https://codesandbox.io/s/i18next-shopify-formatters-not-working-qdt7h4
I'd like to be able to use code like this to use the currency formatter:
import i18next from 'i18next';
import {initReactI18next, useTranslation} from 'react-i18next';
import ShopifyFormat from '@shopify/i18next-shopify';
i18next
.use(initReactI18next)
.use(ShopifyFormat)
.init({
lng: "en",
resources: {
en: {
translation: {
intlNumber: "{{val, currency}}"
}
}
}
});
export default function App() {
const {t} = useTranslation();
return t('intlNumber', {val: 123.45});
}
This doesn't currently work, but removing the .use(ShopifyFormat) line will cause it to work correctly. It seems that the ShopifyFormat plugin is causing the default formatters for currency/date/etc to be removed.
When initializing
i18nextwith this package, the default formatters don't appear to be working.Codesandbox reproduction: https://codesandbox.io/s/i18next-shopify-formatters-not-working-qdt7h4
I'd like to be able to use code like this to use the currency formatter:
This doesn't currently work, but removing the
.use(ShopifyFormat)line will cause it to work correctly. It seems that the ShopifyFormat plugin is causing the default formatters for currency/date/etc to be removed.