Skip to content

mrozio13pl/i18n

Repository files navigation

@mrozio/i18n npm bundle

Simple and type-safe i18n for React

🌍 Internalization for React, made simple.

Usage

Define translations:

import { createI18n } from '@mrozio/i18n';

const { useTranslate } = createI18n({
    en: {
        section: {
            title: 'Hello World'
        }
    },
    de: { /* ... */ }
});

Use them inside your component:

function Component() {
    const t = useTranslate();

    return <h1>{t('section.title')}</h1>; 
}

Documentation

https://mrozio13pl.github.io/i18n

About

🌍 Internalization for React, made simple.

Resources

License

Stars

Watchers

Forks

Packages

No packages published