I’m trying out the <s-date-picker> component, document here:
I’m using the component in JSX (well, TSX to be precise) and it works, I can see it in my admin pages just fine, except I don’t understand how to translate it.
In contrast, with Polaris for React I can do something like:
import enTranslations from '@shopify/polaris/locales/en.json';
import frTranslations from '@shopify/polaris/locales/fr.json';
import { AppProvider as PolarisProvider } from '@shopify/polaris';
import { useTranslation } from '../hooks/useTranslation';
// ...snip...
const polarisTranslations = {
en: enTranslations,
fr: frTranslations,
};
// ...snip...
const { locale } = useTranslation();
const i18n = polarisTranslations[locale] || polarisTranslations.en;
<PolarisProvider i18n={i18n}>
/// ...snip...
Therafter, all child components would be in french if I wanted them to be.
But, with <s-date-picker> I don’t know how.
The “wrapper” is Outlet from react-router-dom, I tried changing <html lang="fr"> (ie. hot swapping document.documentElement.lang) but that doesn’t do anything.
Help?