Skip to content

Add Turkish (tr) locale - #36

Open
SafraNako wants to merge 1 commit into
theQRL:mainfrom
SafraNako:feat/turkish-tr-locale
Open

SafraNako wants to merge 1 commit into
theQRL:mainfrom
SafraNako:feat/turkish-tr-locale

Conversation

@SafraNako

Copy link
Copy Markdown

What

Scaffolds Docusaurus i18n for Turkish and translates the two pages every
visitor lands on first.

  • docusaurus.config.js: 'tr' added to i18n.locales with
    localeConfigs (label Türkçe, htmlLang: 'tr'), plus a
    localeDropdown navbar item so visitors can actually switch language
    — without it the locale would build but nothing in the UI would let
    anyone reach it.
  • i18n/tr/code.json, docusaurus-theme-classic/{navbar,footer}.json,
    docusaurus-plugin-content-docs/current.json,
    docusaurus-plugin-content-blog/options.json: generated via
    docusaurus write-translations --locale tr, then translated.
    Docusaurus ships a bundled Turkish theme pack, so most of code.json
    (404 page, admonition labels, pagination, copy-code button, etc.) came
    through already translated — I filled in the handful it left in
    English, and translated everything specific to this site's own
    navbar/sidebar structure (every Use/Build/API/Tutorials section and
    category label, plus their generated-index titles and descriptions).
  • i18n/tr/docusaurus-plugin-content-docs/current/getting-started.md
    and .../Learn/what-is-qrl.md: full translations of the two doc pages
    linked from the sidebar root — the site's landing page and its "What
    Is The QRL" primer.

Everything else in docs/ is untranslated for now and simply falls back
to English — Docusaurus's locale fallback is per-page, so this is
additive and doesn't leave any route blank. Happy to follow up with more
pages in separate, smaller PRs.

Note on copyright

footer.json's copyright message drops the year instead of
translating the config's `Copyright © ${new Date().getFullYear()}...`
— a locale JSON freezes whatever string is in it, so translating the
already-evaluated 2026 would leave the Turkish footer stuck on that year
forever while English keeps ticking over via the live template.

Note on write-translations

Running write-translations --locale tr as-is crashes on this
Docusaurus 2.4.1 + @cmfcmf/docusaurus-search-local combination — it
tries to Babel-parse the search plugin's generated.d.ts as source and
hits a real parse error (Missing initializer in const declaration) on
that plugin's TypeScript declaration file. I extracted with
plugins: [] temporarily to get a clean run, then restored the real
config; the resulting JSON is otherwise exactly what the command would
produce. Flagging this in case it's worth an upstream report against the
search plugin — not something to fix in this repo.

Verification

npm run build builds both locales clean end to end (the site has
onBrokenLinks: 'throw', so any bad link in the translated Markdown
would fail the build):

[INFO] Website will be built for all these locales:
- en
- tr
✔ Client: Compiled successfully
✔ Server: Compiled successfully
[SUCCESS] Generated static files in "build".
✔ Client: Compiled successfully
✔ Server: Compiled successfully
[SUCCESS] Generated static files in "build/tr".

Spot-checked build/tr/index.html — sidebar renders "Başlarken" /
"QRL Nedir" etc.

🤖 Generated with Claude Code

Scaffolds Docusaurus i18n for Turkish:

- docusaurus.config.js: add 'tr' to i18n.locales with localeConfigs
  (label 'Türkçe', htmlLang 'tr'), and a localeDropdown navbar item so
  visitors can actually switch language.
- i18n/tr/code.json, docusaurus-theme-classic/{navbar,footer}.json,
  docusaurus-plugin-content-docs/current.json, docusaurus-plugin-content-blog/options.json:
  generated via `docusaurus write-translations --locale tr` and
  translated. Docusaurus's bundled Turkish theme pack already covered
  most of code.json (404 page, admonition labels, pagination, copy
  button, etc.) — the handful of strings it left in English, and every
  string specific to this site's own navbar/sidebar structure (all
  Use/Build/API/Tutorials section and category labels + generated-index
  titles/descriptions), are translated here.
- i18n/tr/docusaurus-plugin-content-docs/current/getting-started.md and
  .../Learn/what-is-qrl.md: full Turkish translations of the two doc
  pages linked directly from the sidebar root (the site's landing page
  and its "What Is The QRL" primer) — the two pages every new visitor
  hits first.

footer.json's copyright message drops the year rather than translating
the config's dynamically-templated `${new Date().getFullYear()}` value,
since a locale JSON file freezes it as a static string; English keeps
the live year via the untranslated default.

Everything else in docs/ stays English for now and falls back to it
automatically — Docusaurus locale fallback is per-page, so this is
additive and doesn't leave any page blank.

Note: `write-translations` itself crashes on this Docusaurus 2.4.1 +
@cmfcmf/docusaurus-search-local combination (it tries to Babel-parse the
search plugin's generated.d.ts as source and hits a real syntax error
under TS's `isolatedDeclarations`-style const-without-initializer). Ran
it with `plugins: []` temporarily to get a clean extraction, then
restored the real config — the generated JSON is otherwise exactly what
the command would have produced.

Verified: `npm run build` builds both locales clean (onBrokenLinks:
'throw' catches any bad link in the translated markdown) — confirmed
Turkish content renders in build/tr/ (sidebar shows "Başlarken" / "QRL
Nedir", etc.).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Deploy Preview for stalwart-palmier-0ab66c ready!

Name Link
🔨 Latest commit cb70217
🔍 Latest deploy log https://app.netlify.com/projects/stalwart-palmier-0ab66c/deploys/6aa3f3a4625380000717adb0
😎 Deploy Preview https://deploy-preview-36--stalwart-palmier-0ab66c.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant