agentleFS
conectlensconectlens/lenserfight/.agents/skills/apps-language-rules/SKILL.md

apps-language-rules

Skill18 starsChanged 6 months agoMITView on GitHub

Define i18n and internalization rules for forum (React/i18next) and docs (VitePress locales) apps. Use when adding new UI strings, translating docs, adding new locales, checking language consistency, or setting up hreflang SEO for multilingual pages.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 0 are distinctive, and 14 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All codes are registered in supabase/seeds/01_core_languages.sql and configured as VitePress locales in apps/docs/.vitepress/config.ts.

    line 31
  2. Very specific:

    Add key to en.json (English, authoritative).

    line 45
  3. Very specific:

    Add same key to tr.json with Turkish translation or "" placeholder.

    line 46
  4. Very specific:

    Use useTranslation() hook in React components: const { t } = useTranslation().

    line 47
  5. Very specific:

    Never hardcode user-facing strings in JSX — always use t('namespace.key').

    line 48
  6. Very specific:

    Use interpolation for dynamic values: t('prompts.usedTimes', { count: n }).

    line 49
  7. Very specific:

    Create English page at docs/<section>/<slug>.md.

    line 83
  8. Very specific:

    Add it to themeConfig.sidebar in config.ts (English section).

    line 84
  9. Very specific:

    Create Turkish stub at docs/tr/<section>/<slug>.md with frontmatter lang: tr and translation-pending notice.

    line 85
  10. Very specific:

    Add Turkish sidebar entry to locales.tr.themeConfig.sidebar in config.ts.

    line 86
  11. Very specific:

    Seed: Add ('code', 'Name', 'NativeName', 'ltr', true) to supabase/seeds/01_core_languages.sql.

    line 112
  12. Very specific:

    Arena: Add apps/landing/src/locales/<code>.json mirroring en.json.

    line 113
  13. Very specific:

    Web: Add apps/web/src/locales/<code>.json mirroring en.json.

    line 114
  14. Very specific:

    Docs: Add <code> entry to locales{} in config.ts.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Apps Language Rules

Use when

  • Adding new UI strings to apps/web (must add to en.json + tr.json stubs)
  • 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 hreflang SEO for multilingual pages
  • Reviewing React components for hardcoded strings that bypass i18next

Supported languages

CodeNameDefault?App locale filesDocs status
enEnglish✅ Yesen.jsonComplete
trTürkçeNotr.jsonWIP
esEspañolNonot yetStub
frFrançaisNonot yetStub
deDeutschNonot yetStub
zh中文Nonot yetStub
ja日本語Nonot yetStub
ko한국어Nonot yetStub
ruРусскийNonot yetStub
ptPortuguêsNonot yetStub
itItalianoNonot yetStub

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.json and apps/web/src/locales/tr.json
  • Imported at app entry (apps/web/src/index.tsx) before <App />
  • Language detection order: localStorage (lf-language key) → browser navigator → html tag
  • Fallback: English

Rules for adding strings

  1. Add key to en.json (English, authoritative).
  2. Add same key to tr.json with Turkish translation or "" placeholder.
  3. Use useTranslation() hook in React components: const { t } = useTranslation().
  4. Never hardcode user-facing strings in JSX — always use t('namespace.key').
  5. 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 updates document.documentElement.lang
  • Language is persisted in localStorage under key lf-language

SEO for forum (multilingual)

  • SEOHead.tsx renders <link rel="canonical">, og:locale, and JSON-LD automatically
  • hreflang alternates: include ?lang=tr query param in alternates (no URL-prefix routing)
  • <html lang=""> is updated on language change by LanguageSwitcher
  • apps/web/public/sitemap.xml includes xhtml:link hreflang alternates for static routes

Docs i18n (apps/docs — VitePress locales)

Setup

  • VitePress locales config in apps/docs/.vitepress/config.ts
  • Root locale: en (English) at /
  • Turkish locale: tr at /tr/
  • Language switcher is rendered automatically by VitePress in the top nav

Rules for adding doc pages

  1. Create English page at docs/<section>/<slug>.md.
  2. Add it to themeConfig.sidebar in config.ts (English section).
  3. Create Turkish stub at docs/tr/<section>/<slug>.md with frontmatter lang: tr and translation-pending notice.
  4. Add Turkish sidebar entry to locales.tr.themeConfig.sidebar in config.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)

  • hreflang alternates are in the global head array in config.ts
  • VitePress cleanUrls: true ensures canonical URLs without .html
  • VitePress sitemap config auto-generates sitemap.xml at build time
  • robots.txt at apps/docs/public/robots.txt references the sitemap

Adding a new locale (beyond existing 11)

  1. Seed: Add ('code', 'Name', 'NativeName', 'ltr', true) to supabase/seeds/01_core_languages.sql.
  2. Arena: Add apps/landing/src/locales/<code>.json mirroring en.json. Register in apps/landing/src/i18n.ts.
  3. Web: Add apps/web/src/locales/<code>.json mirroring en.json. Register in apps/web/src/i18n.ts.
  4. Docs: Add <code> entry to locales{} in config.ts. Create docs/<code>/index.md and docs/<code>/tutorials/getting-started/overview.md. Add hreflang to head[]. Update inLanguage in JSON-LD.
  5. Full step-by-step: see docs/how-to/contributors/i18n-guide.md and .claude/skills/language-integrator/SKILL.md.

Load only when needed

  • i18n and hreflang reference

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.