-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
i18next is quite heavyweight and not particularly suitable for our use-cases. I think we could come up with a homegrown solution that would be
- More type safe
- More lightweight
- More suitable for our use-cases
Just a simple TypeScript object like
const translations: Translations {
someTranslationKey: () => 'foo',
otherTranslationKey: (bar: string) => 'foo' + bar
}and an accompanying hook
const t = useTranslation() // Retrieves the proper Translation-object for the current language
const whatever = t.someTranslationKey()
// Alternate API
const whatever = t('someTranslationKey') // take a `keyof Translations` as an argumentmight be an improvement.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels