/* import { useTranslation } from 'react-i18next' *//* import { initializeI18n } from '@octanner/prism-core/TranslationLoader' */() => {const translationUri = "https://www.culturecloud.com/t/prism-header"const namespace = "digitalyearbook"const defaultStrings = {back: 'Put fallback/default strings here',foobar: 'blah'}// put this outside of a componentinitializeI18n({namespace, defaultStrings})const SomeComponent = () => {const { t } = useTranslation()return <div>{t('back')}</div>}return (<TranslationLoader translationUri={translationUri} namespace={namespace}><SomeComponent /></TranslationLoader>)}
Prop | Type | Default | Description |
---|---|---|---|
translationUri | string | Uri to fetch and gather the translations from (required). | |
namespace | string | Namespace used inside of i18n, must match app in translation api (required). | |
defaultStrings | { [key: string]: string } | Default translations to be loaded into i18n (required). |