GitHub

Isomorphic Hooks

useI18n

Retrieve and format translation messages.

Client / Server


Usage

Retrieve a message from translations.

import { useI18n } from '@microeinhundert/radonis'


const i18n = useI18n()


console.log(i18n.formatMessage$('auth.signUpTitle')) // => `Some message defined in translations`

Note

This hook also allows formatting via the ICU message format, just like the official package @adonisjs/i18n.

Previous
useHydrated