i18n.ts

Supported languages and the default language.

config/i18n.ts defines the site's supported languages and default language. The language switcher, page paths, localized text, multilingual SEO links, and the LanguageCode type all use this configuration.

languages

The language list must contain at least one entry, and each code must be unique. Uncommented objects are included in the list. Commented-out objects are alternative languages provided by the template and are included only after you uncomment them.

Prop

Type

The template provides the following language configurations. Only uncommented objects are included in the site's language list:

codenamedirectionLocale file
enEnglishltrlocales/en.json
esEspañolltrlocales/es.json
frFrançaisltrlocales/fr.json
deDeutschltrlocales/de.json
itItalianoltrlocales/it.json
ptPortuguêsltrlocales/pt.json
ruРусскийltrlocales/ru.json
ja日本語ltrlocales/ja.json
ko한국어ltrlocales/ko.json
zh-Hans简体中文ltrlocales/zh-Hans.json
zh-Hant繁體中文ltrlocales/zh-Hant.json
arالعربيةrtllocales/ar.json

The template includes a JSON file for each language in the table, but some files are still empty placeholder objects. A file's existence does not mean its translations are complete. Complete and review the translations before enabling a language. To add another language, you also need to create locales/<code>.json. The LanguageCode type exported at the end of the configuration file includes only uncommented array entries. The template's default configuration produces this type:

type LanguageCode = 'en' | 'zh-Hans' | 'zh-Hant';

defaultLanguage

Prop

Type

defaultLanguage must exactly match an entry in languages[].code. Page paths in the default language have no language prefix. Other languages use their code as the path prefix, such as /zh-Hans/docs.