Translator Function
t function is returned by the useTranslations hook and the createTranslator function. It is used to translate the messages to the current locale in the given namespace.
See the ICU docs and the following examples for available interpolation patterns.
- Simple: message without any interpolations patterns.
- Plural: You have 3 followers.
- Complex:
NextGlobeGen invites Jon1VK and 4 other people to their party.
- Rich text : bold.
- Escaped: {interpolation} <b>Bold</b> 'quoted'
- String: abc.
- Number: 12.34.
- Integer: 12.
- Currency: $12.34.
- Percent: 1,234%.
- Date: 11/23/2025.
- Short date: 11/23/25.
- Medium date: Nov 23, 2025.
- Long date: November 23, 2025.
- Full date: Sunday, November 23, 2025.
- Time: 4:33:55 PM.
- Short time: 4:33 PM.
- Medium time: 4:33:55 PM.
- Long time: 4:33:55 PM UTC.
- Full time: 4:33:55 PM UTC.