Apps Language Rules
Use when
- Adding new UI strings to
apps/web(must add toen.json+tr.jsonstubs) - Writing new documentation pages (English first; Turkish stub in
docs/tr/recommended) - Adding a new locale beyond
en/tr - Checking consistency of translations across JSON catalogs
- Setting up
hreflangSEO for multilingual pages - Reviewing React components for hardcoded strings that bypass i18next
Supported languages
| Code | Name | Default? | App locale files | Docs status |
|---|---|---|---|---|
en |
English | ✅ Yes | en.json |
Complete |
tr |
Türkçe | No | tr.json |
WIP |
es |
Español | No | not yet | Stub |
fr |
Français | No | not yet | Stub |
de |
Deutsch | No | not yet | Stub |
zh |
中文 | No | not yet | Stub |
ja |
日本語 | No | not yet | Stub |
ko |
한국어 | No | not yet | Stub |
ru |
Русский | No | not yet | Stub |
pt |
Português | No | not yet | Stub |
it |
Italiano | No | not yet | Stub |
All codes are registered in supabase/seeds/01_core_languages.sql and configured as VitePress locales in apps/docs/.vitepress/config.ts. Adding app locale JSON files is the primary contribution needed.
Forum i18n (apps/web — React + i18next)
Setup
- i18next initialised in
apps/web/src/i18n.ts - Locale files:
apps/web/src/locales/en.jsonandapps/web/src/locales/tr.json - Imported at app entry (
apps/web/src/index.tsx) before<App /> - Language detection order:
localStorage(lf-languagekey) → browser navigator → html tag - Fallback: English
Rules for adding strings
- Add key to
en.json(English, authoritative). - Add same key to
tr.jsonwith Turkish translation or""placeholder. - Use
useTranslation()hook in React components:const { t } = useTranslation(). - Never hardcode user-facing strings in JSX — always use
t('namespace.key'). - Use interpolation for dynamic values:
t('prompts.usedTimes', { count: n }).
Key naming convention
<feature>.<subkey>
nav.home → "Home" / "Ana Sayfa"
actions.copy → "Copy" / "Kopyala"
prompts.title → "Prompts" / "Promptlar"
errors.generic → "Something went wrong." / "Bir hata oluştu."
Language switcher
- Component:
libs/features/shell/src/lib/LanguageSwitcher.tsx - Placed in the forum
Header(top-right action area) - Calls
i18n.changeLanguage(code)and updatesdocument.documentElement.lang - Language is persisted in
localStorageunder keylf-language
SEO for forum (multilingual)
SEOHead.tsxrenders<link rel="canonical">,og:locale, and JSON-LD automaticallyhreflangalternates: include?lang=trquery param in alternates (no URL-prefix routing)<html lang="">is updated on language change byLanguageSwitcherapps/web/public/sitemap.xmlincludesxhtml:linkhreflang alternates for static routes
Docs i18n (apps/docs — VitePress locales)
Setup
- VitePress
localesconfig inapps/docs/.vitepress/config.ts - Root locale:
en(English) at/ - Turkish locale:
trat/tr/ - Language switcher is rendered automatically by VitePress in the top nav
Rules for adding doc pages
- Create English page at
docs/<section>/<slug>.md. - Add it to
themeConfig.sidebarinconfig.ts(English section). - Create Turkish stub at
docs/tr/<section>/<slug>.mdwith frontmatterlang: trand translation-pending notice. - Add Turkish sidebar entry to
locales.tr.themeConfig.sidebarinconfig.ts.
Turkish stub template
---
lang: tr
title: <Turkish Title>
---
# <Turkish Title>
> Bu sayfa henüz tam olarak Türkçeye çevrilmemiştir. [İngilizce sürümünü görüntüle.](/<english-path>)
Bu belge yakında Türkçe olarak tam içerikle güncellenecektir.
SEO for docs (multilingual)
hreflangalternates are in the globalheadarray inconfig.ts- VitePress
cleanUrls: trueensures canonical URLs without.html - VitePress
sitemapconfig auto-generatessitemap.xmlat build time robots.txtatapps/docs/public/robots.txtreferences the sitemap
Adding a new locale (beyond existing 11)
- Seed: Add
('code', 'Name', 'NativeName', 'ltr', true)tosupabase/seeds/01_core_languages.sql. - Arena: Add
apps/landing/src/locales/<code>.jsonmirroringen.json. Register inapps/landing/src/i18n.ts. - Web: Add
apps/web/src/locales/<code>.jsonmirroringen.json. Register inapps/web/src/i18n.ts. - Docs: Add
<code>entry tolocales{}inconfig.ts. Createdocs/<code>/index.mdanddocs/<code>/tutorials/getting-started/overview.md. Addhreflangtohead[]. UpdateinLanguagein JSON-LD. - Full step-by-step: see
docs/how-to/contributors/i18n-guide.mdand.claude/skills/language-integrator/SKILL.md.
Load only when needed
- i18n and hreflang reference