Skip to content

Replace i18next with something more suitable #720

@sluukkonen

Description

@sluukkonen

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

  1. More type safe
  2. More lightweight
  3. 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 argument

might be an improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions