Files
youtube-generator/CONTRIBUTING.md
T
poli0981andClaude Opus 5 b920d3567e chore(release): v0.38.0 — Portuguese (Brazil) and Indonesian
Two new locales, 1,562 strings each, complete: titles, every description
block, all 248 content warnings, tech notes, playthrough notes, pinned
comments, playlist copy, and the whole interface.

Brazil is a top-three market for gameplay viewing and Indonesia the largest in
Southeast Asia. Both use Latin script, so neither needed font or layout work.

**docs/I18N.md was wrong about what registering a locale takes**, and this
release is where that bit. It claimed `SUPPORTED_LANGUAGES` was "the only
registration step". It is one of four, and they fail differently:

  SupportedLanguage union        compile error
  CORE_TAGS_BY_LANG              compile error  (there are TWO such records,
  MULTILINGUAL_TAGS              compile error   not one — the doc mentioned one)
  detectBrowserLanguage          SILENT

The silent one matters most: the language works perfectly and simply never
auto-selects for a visitor whose browser is set to it. `SUPPORTED_LANGUAGES`
also wasn't type-bound to the union, and every consumer casts, so a mismatch
between the first two compiled cleanly — it now carries a `satisfies` clause.

`tests/i18n/locale-registration.test.ts` exists to close those gaps: it checks
the picker list against the locale directories on disk in BOTH directions, plus
namespace files, flags, native names and tag pools.

Browser-language detection now matches the full BCP-47 tag before the bare
language, or `pt-BR` would be reduced to `pt` and never found. Any other
Portuguese variant resolves to pt-BR rather than falling through to English.

115 UI keys were not hand-translated at all: their English text is
byte-identical to a string already translated in templates.json (graphics
presets, ray-tracing modes, difficulty names, content-warning labels), so they
are copied across. Translating those twice risks a checkbox and the rendered
description disagreeing about what the same option is called.

Deliberately left in English, matching what the Spanish locale already does:
vendor product names (NVIDIA DLSS, AMD FSR, Intel XeSS, Fluid Motion Frames),
platform brands, hardware acronyms, genre terms that are loanwords in both
languages, and example URLs/emails in placeholders. So pt-BR reads 1,344/1,562
and id 1,308/1,562 "differing from English" — the remainder are those
pass-throughs, not gaps.

Both are AI-translated and NOT native-reviewed. Recorded in DISCLAIMER.md
alongside JA/ES/KO/ZH.

Also replaces `__dirname` in the Vite and Vitest configs with
`import.meta.dirname` — Vite 8's native config loader doesn't provide the CJS
global and warned on every run.

v0.36.0 is skipped: the dependency release shipped first and took 0.37.0.

Tests 692 → 698. Validator now 1,562 keys x 8 locales.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 12:46:54 +07:00

3.9 KiB

Contributing to YTDescGen

Thanks for taking the time to contribute. Read this once before opening your first PR — it saves time on both sides.

Code of Conduct

Participation is governed by the Code of Conduct. By contributing, you agree to its terms.

Getting Started

  1. Read the Development Guide — also available in Vietnamese.
  2. Install dependencies: npm install.
  3. Start the dev server: npm run dev.
  4. Before opening a PR run all gates:
    npm run typecheck
    npm run lint
    npm run validate:locales
    npm run test:run
    

How to Contribute

Issues

Use the templates in .github/ISSUE_TEMPLATE/:

  • Bug report — only if you can reproduce on the latest release.
  • Feature request — only with a concrete use case, not abstract requests.

Pull Requests

  • Branch from dev, not main.
  • Commit format: type(scope): message — e.g. feat(engine): add Spanish template support. Types: feat, fix, refactor, docs, test, ci, chore.
  • One logical change per PR. Don't bundle unrelated refactors.
  • All locale files must stay in lock-step — see the i18n section below.
  • AI-assisted contributions are welcome but must be disclosed in the PR description.

i18n Contributions

If your change adds or removes any user-facing string:

  1. Update the locale schema at src/i18n/locales/_schema.json first.
  2. Add the key to all 8 locales (en / vi / ja / es / ko / zh / pt-BR / id).
  3. npm run validate:locales must pass.

Native-speaker corrections to AI-translated locales (JA / ES / KO / ZH) are especially welcome — see DISCLAIMER.md for the current translation-quality status.

Auto-ignored Contributions

The following are closed without review and may result in a contributor ban — no exceptions:

  • Suspected malicious code. If a PR contains code we suspect may be a supply-chain attack, obfuscation, credential harvesting, cryptominer, or any form of malware — even if CodeQL and Dependabot don't flag it, the maintainer may investigate manually. Detection equals ban.
  • Unverified or suspicious links in issues, PRs, or comments (pastebin scrapers, redirect chains, unfamiliar shortlinks, link-shortener URLs without context).
  • Behavior or language violating GitHub's Acceptable Use Policies.
  • Off-topic / rambling reports that don't get to the point. Example of what gets ignored: "Good morning, today is a beautiful day, I was just wondering if maybe…" — get straight to the problem.
  • PRs that touch hundreds of files for a one-line fix (typical sign of an auto-formatter run on unrelated files).
  • Tests deleted, or --no-verify used to bypass pre-commit hooks.
  • "AI rewrote my entire codebase in a different style" PRs. AI-assisted edits are welcome (disclosed); whole-repo rewrites are not.
  • Spam, drive-by typo fixes that don't address a real issue, and karma-farming PRs.

What We Want

  • Bug fixes with a reproduction case and a regression test.
  • Locale corrections from native speakers.
  • New content-warning IDs with all 6 translations and a clear rationale (especially horror-genre vocabulary).
  • New video types or genres that fit the gameplay no-commentary use case.
  • Accessibility and mobile-responsive improvements.
  • Performance fixes with a before/after measurement.

What We Don't Want

  • Cosmetic refactors with no behavior change.
  • Adding new runtime dependencies without first opening an issue to discuss the tradeoff.
  • Renaming files without coordinating with open PRs.
  • Changes to the LICENSE or NOTICE files (these are governance, not contributions).

License

By contributing, you agree your contribution will be licensed under the Apache License 2.0, the same license as the project, and that you have the right to grant that license.