Simple i18n NextSimple i18n Next

StringKeys

Every key in the messages.json files and other JSON files is turned into a camel case type and make it available as StringKeys type. For example, if you have the following key in your messages.json file:

{
  "hello": "Hello",
  "greeting": "Hello {name}",
  "home": "Home",
  "apple_one": "1 apple",
  "apple_other": "{count} apples",
  "cat_one": "1 cat",
  "cat_other": "{count} cats"
}

Then the StringKeys type will be:

export type StringKeys =
  | 'hello'
  | 'greeting'
  | 'home'
  | 'appleWithCount'
  | 'catWithOrdinalCount';

These keys are used for strongly typing the useStrings hook.