Compare commits

...
Author SHA1 Message Date
poli0981 f51980c6c3 chore: update version to 0.9.0
Bumps package.json, src-tauri/tauri.conf.json, src-tauri/Cargo.toml,
and the yt-desc-gen entry in src-tauri/Cargo.lock from 0.8.1 to 0.9.0.

CHANGELOG.md gets a v0.9.0 section covering the three feature PRs that
shipped on main this release: #37 (Phase 1 B2 — URL extractors +
name-mismatch banner), #40 (Phase 1 B1 — gacha_quest video type with
17 quest patterns), #41 (Phase 2 — QoL trio + multi-platform release
matrix). 297 tests green, main bundle 270 KB, 428 ui + 203 template
keys per locale.
2026-05-03 09:02:59 +07:00
poli0981 c8e75d7211 feat(v0.9-phase2): QoL trio + multi-platform release matrix (#41)
B3 — QoL trio:

(a) Cheatsheet modal — bare `?` key now opens the existing
ShortcutHelpModal (Ctrl+/ still works). The `?` handler skips firing
when the keydown target is an INPUT / TEXTAREA / SELECT / contentEditable
element so it doesn't hijack normal text entry. The modal grows a
search input that live-filters by translated label OR by the literal
key combo string (so "ctrl" finds every Ctrl-binding). Filter resets
on close.

(b) Genre search filter — GenreSelector now renders a search input
above the chip group. Live substring match (case-insensitive) on the
translated chip label. Empty query renders all 41 genres; empty result
set shows a localised "no matching genres" line in place of the chip
row.

(c) Bulk-toggle — three buttons above the chip group: "All RPGs", "All
Shooters", "All Horror". Clicking REPLACES the current selection with
the first MAX_GENRES (3) ids from the matching GENRE_GROUPS list — so
the cap is preserved end-to-end. Filter clears on bulk-toggle so the
new chips are always visible. Group registry lives in
src/config/genres.ts as a typed Record<GenreGroupId, readonly GenreId[]>.

i18n: 7 new keys/locale (4 in shortcuts/editor + 3 in
editor.genreGroups). All 6 locales fully translated. 428 ui keys/locale
(up from 421).

B4 — Multi-platform release matrix:

.github/workflows/release-desktop.yml grows from a Windows-only build
to a 4-entry matrix: windows-latest, macos-13 (Intel), macos-14 (ARM),
ubuntu-latest. fail-fast: false so one platform breaking doesn't
cancel the others. Each runner builds for its explicit
--target triple. Linux runner installs libwebkit2gtk-4.1-dev,
libgtk-3-dev, libayatana-appindicator3-dev, librsvg2-dev, and patchelf
(Tauri's webview + AppImage tooling).

tauri-action@v0 collects all artifacts onto a single draft GitHub
Release named "YTDescGen v__VERSION__". No code signing (open-source
project, recurring cert cost not justified) — users see the standard
unverified-publisher prompts on first launch. No git-cliff
auto-changelog; release notes come from the tag message.

Pre-workflow tags v0.8.0 and v0.8.1 will need a one-time manual
`gh release create` if multi-platform binaries are desired
retroactively. Documented in docs/PACKAGING.md.

CI: typecheck/lint clean. 297 tests pass. validate:locales 428/428 ui
+ 203/203 templates per locale. Main bundle 270 KB (≤500 KB gate).
2026-05-03 08:54:25 +07:00
poli0981 09989c6aca feat(v0.9-phase1-b1): gacha_quest video type with 17 quest patterns (#40)
Adds a first-class video type for gacha-game playthroughs. Covers the
quest taxonomy across major titles (Genshin, HSR, Wuthering Waves, ZZZ,
Honkai Impact 3rd, Reverse 1999, Nikke, Azur Lane, Granblue, …) where
the typical video is a quest-by-quest run with structured chapter /
event / side-quest metadata.

New config in src/config/gacha-quest-types.ts:
- GACHA_QUEST_TYPES: 17 literals grouped by use case
  (story / events / tutorial-trial / endgame-multiplayer / showcase)
- GACHA_QUEST_TYPE_GROUPS: display-order grouping for the dropdown
- GACHA_PART_SUFFIX_STYLES: per-quest-type partNumber style — main_story
  uses "Part N", anniversary + daily_commission use "Day N", endgame
  uses "Floor N", every other quest type drops the suffix.

GeneratorInput grows three optional fields: gachaQuestType (the enum),
chapterName (free-form chapter / story-arc label), questName (free-form
event / side-quest name). partNumber is reused as-is.

Engine wiring:
- title-builder.buildTitle dispatches on videoType === "gacha_quest" to
  the per-quest-type i18n template (`title.gachaQuestType.<id>`). The
  template already embeds gameName + chapterName / questName + the
  optional partSuffix; the standard `title.suffix` ("Gameplay No
  Commentary") still tails the result, and the quality badge respects
  badgePosition. Empty `videoTypeLabel` means a non-default badge in
  "middle" position lands as its own segment, matching the v0.6
  behaviour for `full` 4K runs.
- New helper `buildGachaPartSuffix(questType, partNumber, t)` resolves
  `title.gachaPartSuffix.{part|day|floor}` based on the per-type style.
- description-builder routes the intro through
  `description.intro.gacha_quest_<questType>` (17 distinct openings)
  while every other videoType keeps its flat key.
- tag-generator gets one shared gacha pool — quest-type-specific tags
  would balloon the pool and rarely surface in YouTube search.

UI (ExtraFieldsInput.tsx) renders a native <select> with <optgroup>
headers for the 5 quest groups, plus chapterName + questName inputs.
ExtraFields list for `gacha_quest` is
[gachaQuestType, chapterName, questName, partNumber].

Stores:
- editor-store v6 → v7: additive migration. Pre-v0.9 drafts get
  gachaQuestType="main_story", chapterName="", questName="".
- TemplateSnapshot adds the three fields as optional so legacy
  templates load cleanly via `loadProfile`'s spread.
- TemplateSaveForm + use-current-generator-input capture the new
  fields end-to-end.

i18n: 67 new keys per locale (28 ui + 39 templates). All 6 locales now
carry 421 ui + 203 template keys. en + vi fully translated; ja/es/ko/zh
seeded with English placeholders per the v0.8 polish convention.

17 new tests across title + description + part-suffix engine paths.
297 total pass. Main bundle 266 KB (≤500 KB gate).
2026-05-03 08:33:20 +07:00
poli0981 0f7a16b32b feat(v0.9-phase1-b2): Epic / Nintendo / Humble URL extractors + name-mismatch banner (#37)
Adds four new storefront extractors to PLATFORM_NAME_EXTRACTORS:

- Epic: store.epicgames.com/<locale>/p/<slug>[-<6+-hex hash>]
- Nintendo US: nintendo.com/us/store/products/<slug>[-switch[-2]]
- Nintendo EU: nintendo.com/<locale>/Games/<segment>/<slug>[-<id>].html
- Humble: humblebundle.com/store/<slug>

PlayStation, Xbox, and Amazon Luna stay unsupported — their canonical
URLs use opaque product IDs rather than name slugs. Existing Steam,
itch.io, and GOG extractors are unchanged.

New isLinkNameMismatch(gameName, url) helper applies a subset-tolerant
token comparison: the link's tokens must all appear in the typed Game
Name. Apostrophes are stripped (not spaced) so Marvel's tokenises to
marvels and matches Steam slugs like Marvels_Spider-Man_Remastered
verbatim. Returns false when the URL is unsupported or either side is
empty.

StoreLinkEditor surfaces a reactive banner above the platform grid when
any filled link points at a game name whose tokens aren't a subset of
the user's Game Name. Iteration order follows PLATFORMS; dismissed
fingerprints (gameName|url pairs) are skipped so a chain of mismatches
surfaces one at a time.

i18n: 2 new keys per locale (editor.warning.linkNameMismatch and
common.dismiss). 393 ui keys per locale, fully translated in all 6
languages.

27 new tests across all 4 extractors and the mismatch helper. 280 total
pass. Main bundle 242 KB (≤500 KB gate).
2026-05-03 07:52:40 +07:00
poli0981andClaude Opus 4.7 50bbaccee9 fix(v0.8.1): accept bare youtube.com + extra query params in playlist validator (#36)
* fix(v0.8.1): accept bare youtube.com + extra query params in playlist URL validator

The strict v0.8 regex required `www.youtube.com` and rejected any extra
query params after `list=`. Real YouTube share URLs often emit either
the bare `youtube.com` host or `&si=…`/`&pp=…` tracking suffixes, both
of which silently failed validation. ValidatedInput then called
`onChange("")` and wiped the entry from the settings store before the
user noticed — making the v0.8 phase 2 genre-playlist suggestion
feature look like it just didn't work.

The relaxed regex now accepts:
* optional `www.` (host can be `youtube.com` or `www.youtube.com`)
* `list=…` at any position in the query string, with sibling params
  before AND/OR after
* a trailing `#fragment`

`watch?v=…` URLs and `youtu.be/…` short links remain rejected because
the path must be exactly `/playlist`. 4 new tests cover the relaxed
shapes (no-www, `&si=` suffix, list= after another param, fragment).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: update version to 0.8.1

Patch release bumping all four manifest files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(changelog): backfill v0.8.0 + add v0.8.1 entries

CHANGELOG.md was last updated for v0.7.0 — adds the v0.8.0 release
notes (PRs #32 / #33 / #34 / #35) and the v0.8.1 patch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 23:38:38 +07:00
poli0981andClaude Opus 4.7 03bae05f07 chore: update version to 0.8.0 (#35)
* feat(v0.8-polish): VN bank/MoMo/ZaloPay donate, video-settings multi-line, mod-list textarea, template-snapshot fixes

Four small refinements requested before bumping 0.8.0.

VN donate (bank + MoMo + ZaloPay)
* Five new editor fields — vnBankName / vnBankAccount / vnBankHolder /
  vnMomo / vnZalopay — surface in a new `VietnameseDonateEditor`
  component nested inside the existing Store & Social accordion. The
  editor is always visible regardless of output language; the
  description block is gated on `language === "vi"` because non-VN
  viewers don't typically use these payment methods.
* Description renders a `🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ (Việt Nam)` block
  between donate links and social links. Bank line includes the holder
  in parens when set, drops the parens when not. MoMo / ZaloPay each
  get their own line, independent of the bank entry.

Video Settings — multi-line block with labels
* The "🖥 VIDEO SETTINGS" section now renders one labelled line per
  token (Video / In-game Setting / Art Style / Version), matching the
  key-value-per-line shape of the rig + timestamps blocks. The pre-v0.8
  pipe-separated single line is gone.
* `composeGraphicsPart` drops its trailing "Setting" suffix — the new
  "In-game Setting:" label provides the same context without the
  "Cinematic Setting" / "Ultra Setting" double-up. The
  `description.graphics.settingSuffix` template key is removed across
  all 6 locales.

Mod List
* New `modList: string` editor field — multi-line textarea exposed
  alongside `modName` whenever videoType is `mods`. Designed for pasting
  straight from a mod manager (Wabbajack / Vortex / Mod Organizer).
* Description renders a `🧩 MOD LIST` block right after MY RIG, only
  for the `mods` video type and only when the field is non-empty.

TemplateSnapshot completeness fix
* Adds the v0.7 phase 2 fields that had been missing — playthroughStatus,
  difficulty, difficultyCustomLabel, contentWarnings — plus all v0.8
  polish fields (modList, vnBank*, vnMomo, vnZalopay). Saving a template
  now captures the full editor state. All new fields are optional on
  the type so legacy snapshots load cleanly via `loadProfile`'s spread.

Migrations
* Editor store v5 → v6, additive — empty-string defaults for the 6 new
  fields. No value mapping, no data loss.

i18n
* 6 locales × ui.json (14 new editor keys) + templates.json (2 new
  section headers, 3 new graphics labels, dropped settingSuffix). 391
  ui keys + 164 template keys per locale. Vietnamese fully translated;
  ja / es / ko / zh seeded with English defaults for new editor strings.

Tests (7 new, 7 updated): `Video: 1080p - 60 FPS` / `In-game Setting:`
multi-line shape (8 tests), VN donate gating (4 tests, including the
non-vi guard), Mod List gating (2 tests). 249 total.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: update version to 0.8.0

Bumps all four manifest files for the v0.8.0 release: package.json,
src-tauri/tauri.conf.json, src-tauri/Cargo.toml, and the yt-desc-gen
entry in src-tauri/Cargo.lock. Marks the end of the v0.8 cycle (PR #32
+ #33 + #34 — tag fix, graphics v2, livestream, genre playlists, VN
donate, video-settings multi-line, mod list, TemplateSnapshot fix).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 22:31:20 +07:00
poli0981andClaude Opus 4.7 39dd346050 feat(v0.8-polish): VN bank/MoMo/ZaloPay donate, video-settings multi-line, mod-list textarea, template-snapshot fixes (#34)
Four small refinements requested before bumping 0.8.0.

VN donate (bank + MoMo + ZaloPay)
* Five new editor fields — vnBankName / vnBankAccount / vnBankHolder /
  vnMomo / vnZalopay — surface in a new `VietnameseDonateEditor`
  component nested inside the existing Store & Social accordion. The
  editor is always visible regardless of output language; the
  description block is gated on `language === "vi"` because non-VN
  viewers don't typically use these payment methods.
* Description renders a `🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ (Việt Nam)` block
  between donate links and social links. Bank line includes the holder
  in parens when set, drops the parens when not. MoMo / ZaloPay each
  get their own line, independent of the bank entry.

Video Settings — multi-line block with labels
* The "🖥 VIDEO SETTINGS" section now renders one labelled line per
  token (Video / In-game Setting / Art Style / Version), matching the
  key-value-per-line shape of the rig + timestamps blocks. The pre-v0.8
  pipe-separated single line is gone.
* `composeGraphicsPart` drops its trailing "Setting" suffix — the new
  "In-game Setting:" label provides the same context without the
  "Cinematic Setting" / "Ultra Setting" double-up. The
  `description.graphics.settingSuffix` template key is removed across
  all 6 locales.

Mod List
* New `modList: string` editor field — multi-line textarea exposed
  alongside `modName` whenever videoType is `mods`. Designed for pasting
  straight from a mod manager (Wabbajack / Vortex / Mod Organizer).
* Description renders a `🧩 MOD LIST` block right after MY RIG, only
  for the `mods` video type and only when the field is non-empty.

TemplateSnapshot completeness fix
* Adds the v0.7 phase 2 fields that had been missing — playthroughStatus,
  difficulty, difficultyCustomLabel, contentWarnings — plus all v0.8
  polish fields (modList, vnBank*, vnMomo, vnZalopay). Saving a template
  now captures the full editor state. All new fields are optional on
  the type so legacy snapshots load cleanly via `loadProfile`'s spread.

Migrations
* Editor store v5 → v6, additive — empty-string defaults for the 6 new
  fields. No value mapping, no data loss.

i18n
* 6 locales × ui.json (14 new editor keys) + templates.json (2 new
  section headers, 3 new graphics labels, dropped settingSuffix). 391
  ui keys + 164 template keys per locale. Vietnamese fully translated;
  ja / es / ko / zh seeded with English defaults for new editor strings.

Tests (7 new, 7 updated): `Video: 1080p - 60 FPS` / `In-game Setting:`
multi-line shape (8 tests), VN donate gating (4 tests, including the
non-vi guard), Mod List gating (2 tests). 249 total.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 22:25:55 +07:00
poli0981andClaude Opus 4.7 ba58037306 feat(v0.8-phase2): graphics settings v2, livestream, pinned-comment genre playlists (#33)
The big v0.8 feature drop: PC build viewers can finally see RT modes,
frame-gen multipliers, and upscaling quality in the description; 2D /
pixel-art games skip the Video Settings section entirely; livestreams
get their own video type with a 🔴 LIVE block; and the pinned-comment
template auto-suggests a per-genre playlist configured once in Settings.

Foundations
* New `src/config/graphics-settings.ts` — GraphicsPreset, RTMode,
  FrameGenVendor, FrameGenMultiplier, UpscaleQuality, ArtStyle enums,
  plus `GENRES_WITHOUT_GRAPHICS_SETTINGS` for the auto-suggest hint.
* `engine/types.ts` extends GeneratorInput; `livestream` joins VideoType.
* Editor store v4 → v5 migration maps legacy free-form `graphicsPreset`
  text ("Ultra"→"ultra"; "Epic"→"custom"+"Epic") and backfills 9 new
  fields. `legacyGraphicsPresetToEnum` is exported for unit tests, and
  `normalizeEditorPatch` runs on `loadProfile` / `loadPreset` so legacy
  profile / template snapshots round-trip cleanly.
* Settings store v6 → v7 — `genrePlaylists: {}` and
  `pinnedCommentIncludeGenrePlaylist: false`.

Engine
* `description-builder.ts` — `composeGraphicsPart` produces lines like
  `Cinematic Setting - NVIDIA Frame Generation x2 with Ray Tracing`,
  with Art Style and Driver/Game Version as separate trailing tokens.
  The whole 🖥 VIDEO SETTINGS section is omitted when
  `skipGraphicsSettings` is true. Livestream videos render an extra
  block with a locale-formatted scheduled time and the watch link.
* `tag-generator.ts` — new `livestream` pool ("livestream",
  "live gameplay", `${gameName} live`, `${gameName} stream`).
* `pinned-comment-builder.ts` gains `includeGenrePlaylist`,
  `genrePlaylists`, `genreLabels` options; emits the genre-playlist
  suggestion line for the primary genre when configured.

UI
* `VideoSettingsForm.tsx` rewritten — preset Select, Custom field,
  skip toggle (with help text), Ray Tracing chip multi-select,
  Frame Gen vendor + multiplier, Upscaling Quality, Art Style, free-form
  Driver/Game Version.
* `ExtraFieldsInput.tsx` — livestream extras (live URL, scheduled time
  via native datetime-local input).
* `GenreSelector.tsx` — auto-suggest skip-graphics chip when a
  visual_novel / fmv / rhythm genre is added; session-local dismissal.
* `SettingsPage.tsx` — Genre Playlists section (per-genre URL inputs
  validated by `validatePlaylistUrl`); `pinnedCommentIncludeGenrePlaylist`
  toggle nested under the existing pinned-comment template toggle.
* `OutputExtras.tsx` resolves genre labels and passes the new options
  to `buildPinnedComment`.
* Profile + template stores carry `GraphicsPreset` typed slot;
  TemplateSnapshot picks up the new fields as optional.

i18n — all 6 locales updated, schema enforces 377 ui + 160 template
keys / locale. Vietnamese fully translated; ja/es/ko/zh seeded with
English defaults for the new strings (refine later as needed). Brand
terms (DLSS / FSR / XeSS / Ray Tracing) intentionally English everywhere.

Tests (24 new): graphics composition (7), livestream (4 description +
1 title + 1 tag pool + 1 pinned greeting), genre-playlist suggestion (4),
`legacyGraphicsPresetToEnum` (7), settings-heal v6→v7 (3). 242 total.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 21:21:36 +07:00
poli0981andClaude Opus 4.7 26f5907006 feat(v0.8-phase1): tag long-name fix, playlist URL validator, URL paste auto-extract, publisher platform (#32)
Fixes the silent tag drop where a long game name (>30 chars after composition)
caused every game-name-bearing tag to disappear from the output. Adds
url-extractors that pre-fill Game Name from a pasted Steam / itch.io / GOG URL.
Tightens YouTube playlist URL validation. Introduces Publisher / Developer site
as a tenth store-link platform.

* tagFriendlyGameName helper strips trademark marks, peels edition qualifiers,
  falls back to colon head, then leading words. generateTags now seeds both a
  bare-name tag (≤30) and a compose-name (≤21) so composites also fit ≤30.
* validatePlaylistUrl rejects watch?v=, youtu.be, and http URLs; expects
  https://www.youtube.com/playlist?list=[id].
* StoreLinkEditor onPaste auto-fills empty Game Name with extracted slug;
  toast.custom shows the result with a 5s Undo action.
* Publisher platform uses a permissive HTTPS pattern for indie / niche releases
  distributed only from a developer's own site.
* New i18n keys: validation.playlistUrlInvalid, editor.toast.urlAutoFilled,
  common.undo (all 6 locales).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 20:41:29 +07:00
poli0981 73af30f6e6 chore: update version to 0.7.0 2026-04-24 21:56:17 +07:00
poli0981andClaude Opus 4.7 66753acce0 feat(v0.7-phase2): pinned-comment templates + playthrough/difficulty/content-warning fields (#31)
Second half of v0.7. Bumps package.json to 0.7.0 and ships the final
feature set for this version. See CHANGELOG.md for the full cumulative
entry covering both phases.

New description fields
- PlaythroughStatus (none / blind / replay / newgame_plus / postgame)
  renders a "🎯 Playthrough: …" line right after the intro.
- DifficultyLevel (none / easy / normal / hard / nightmare / custom)
  renders a "🎮 DIFFICULTY" block after Video Settings. "custom" reveals
  a free-form label that passes through the description untranslated —
  game-specific names like "Lethal" survive a locale switch.
- ContentWarnings (multi-select: flashing_lights / loud_noises /
  jump_scares) render a "⚠️ CONTENT WARNINGS" bulleted block between
  the spoiler and mature warnings.
- All three use a "none" / [] sentinel: creator hasn't picked → section
  is skipped entirely rather than rendered with a blank value.

Pinned-comment template system
- New pure engine module src/engine/pinned-comment-builder.ts composes
  from four shared sub-keys (thanks / playlist / engage / askNextGame)
  plus a per-video-type greeting. Missing per-type greeting falls back
  to greetings.part; missing that too drops the line rather than
  leaking a raw locale key.
- New Settings toggles showPinnedCommentTemplate (default off) and
  pinnedCommentIncludeAskNextGame (default on, only rendered when the
  parent toggle is on).
- OutputExtras renders a third section for the generated template with
  its own copy button, alongside the existing freeform pinnedComment
  field. They coexist as independent sections — no magic precedence.
- BatchPage generates one pinned-comment template per part per language
  with its own copy button; the combined "copy everything" bar includes
  the pinned block when the setting is on.

Refactor: useCurrentGeneratorInput hook
- The editor → GeneratorInput shape used to be copy-pasted across four
  call sites (use-generated-output, use-multilang-output, BatchPage,
  OutputExtras). Extracted into src/hooks/use-current-generator-input.ts
  so future input fields touch one file instead of four.

Store migrations
- Editor store v3 → v4: adds playthroughStatus, difficulty,
  difficultyCustomLabel, contentWarnings. Missing entries back-fill to
  sentinels, so existing drafts round-trip cleanly.
- Settings store v5 → v6: adds showPinnedCommentTemplate and
  pinnedCommentIncludeAskNextGame. Flat booleans pick up via the
  existing healSettings spread.

Locales (6 languages, all in sync)
- ui.json: playthrough / playthroughOptions, difficulty /
  difficultyOptions, difficultyCustomLabel / placeholder, content
  warnings + options, pinnedCommentTemplate label + copy button,
  Settings toggles for the template. (~23 new keys per locale.)
- templates.json: description.sections.{playthrough,difficulty,
  contentWarnings} + description.{playthrough,difficulty,
  contentWarnings} blocks + pinnedComment.{thanksForWatching,
  playlistPrompt, engagementPrompt, askNextGame} + 18 per-video-type
  greetings. (~36 new keys per locale.)
- _schema.json updated. validate:locales passes 314/125 keys across
  all 6 locales.

Tests
- New tests/engine/pinned-comment-builder.test.ts (11 cases): default
  greeting, localized game name, playlist include/exclude,
  includeAskNextGame toggle, per-type greetings (boss, speedrun),
  fallback to `part` greeting when per-type is missing, graceful
  drop-line when even fallback is missing, channelName interpolation,
  empty-locale returns "".
- description-builder.test.ts +8 cases for playthrough / difficulty
  (preset + custom + blank custom) / content warnings (render / empty /
  placement between spoiler & mature).
- settings-heal.test.ts +2 cases for v5 → v6 migration (back-fill
  defaults + preserve user-set values).
- Full suite: 177 / 177 pass.

Version
- package.json 0.7.0-phase1 → 0.7.0.
- New CHANGELOG.md with cumulative v0.7.0 entry.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 21:50:09 +07:00
poli0981andClaude Opus 4.7 c73c51472e feat(v0.7-phase1): title-format settings + reorganized Settings page (#30)
Add user-configurable title formatting so creators can switch the Batch
and Editor output to badge-first styles like "[2k] - Game - phần 1 -
Gameplay No Commentary". Reorganize the Settings page from 5 mixed
sections into 7 purpose-based sections so knobs are easier to locate.

Settings changes
- New nested `titleFormat: { badgePosition, separator, badgeCase }`
  config in SettingsData with defaults that reproduce v0.6 output
  byte-for-byte (middle / emDash / upper).
- Settings store v4 -> v5 with defensive sub-key merge in
  healSettings so a partial titleFormat object keeps working defaults.
- New `setTitleFormat(patch)` action.
- Page split into Appearance / Language & Defaults / Editor / Title /
  Description / Tags / History.

Engine changes
- buildTitle accepts an options bag (BuildTitleOptions) while still
  accepting the legacy boolean third arg, so title-variants.ts and any
  other existing caller keeps working unchanged.
- New composeTitle helper handles prefix / middle / suffix badge
  positions; empty-badge case collapses all three to identical output.
- Separator resolution prefers `title.separators.<id>` with fallback to
  the legacy `title.separator` key so partial locales still render.
- TitleFormatConfig + related types live in engine/types.ts (engine
  stays pure, store re-exports).

Renderer / call sites
- RenderOptions.titleFormat threads through template-renderer into
  buildTitle from useGeneratedOutput, useMultilangOutput, and BatchPage.
- Drive-by fix: useMultilangOutput was missing showSponsorCredit and
  the sponsor fields on its GeneratorInput; added both so multi-lang
  output matches single-lang.

Locales (6 languages)
- templates.json gains `title.separators.{emDash,hyphen,colon,pipe}`.
- ui.json gains the 14 new settings labels (titleFormatTitle,
  descriptionSettingsTitle, badgePosition{Prefix,Middle,Suffix},
  titleSeparator{EmDash,Hyphen,Colon,Pipe}, badgeCase{Upper,Lower}).
- _schema.json updated; `npm run validate:locales` passes 291/291 ui
  keys and 89/89 template keys per locale.

Tests
- 10 new title-builder cases (prefix/middle/suffix, lower-case, hyphen/
  colon/pipe separators, empty-badge collapse, legacy-separator
  fallback, legacy-boolean arg).
- 3 new settings-heal cases (v4 -> v5 back-fill, partial titleFormat
  merge, corrupt non-object titleFormat).
- Full suite: 156/156 pass.

Version
- package.json 0.6.0 -> 0.7.0-phase1. Tag + final 0.7.0 bump will land
  with phase 2 (pinned-comment templates + new description fields).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 21:22:42 +07:00
poli0981 2467d94328 Merge remote-tracking branch 'origin/main' 2026-04-24 12:07:21 +07:00
poli0981 54b3f1d180 fix 2026-04-24 12:06:58 +07:00
poli0981andClaude Opus 4.7 bd1f6f6192 Feat/v0.6 phase2 sponsor credit (#29)
* feat(v0.6): sponsor / key-provider credit toggle

Adds a new optional "🎁 Thanks to {sponsor} for providing the
{platform} key of this game." line to the generated description, for
creators who get review / press keys from publishers or developers.

- Editor: new SponsorCreditEditor (sponsor name + key platform) inside
  the Attribution accordion. Editor store v2 → v3 with a trivial
  migration that back-fills empty strings for old drafts.
- Settings: new `showSponsorCredit` toggle under Tag Settings. Off by
  default so existing users see no behaviour change. Settings store
  v3 → v4; healSettings back-fills the new default.
- Engine: `buildDescription` / `renderAll` take a `showSponsorCredit`
  option. Renders only when the toggle is on AND BOTH sponsor fields
  are non-empty — partial data is treated as "not ready, skip" rather
  than rendered with holes. Positioned above the music section and
  donate block so the thank-you is visually prominent.
- i18n: added sponsor-section UI labels/placeholders, the
  `settings.showSponsorCredit` toggle label, and
  `description.sections.sponsorCredit` template across all 6 locales
  (en, vi, ja, es, ko, zh) + schema.
- Tests: 7 new description-builder cases (render / toggle-off / blank
  name / blank platform / trim / ordering / vi localization) + 1
  healSettings case for the v3 → v4 back-fill.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore: update version to 0.6.0

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:57:20 +07:00
poli0981 c7ac53ed60 Merge remote-tracking branch 'origin/main' 2026-04-24 11:26:47 +07:00
poli0981 31288e9b7b chore: update version to 0.6.0 2026-04-24 11:26:28 +07:00
poli0981andClaude Opus 4.7 a5b2a16c29 feat(v0.6): sponsor / key-provider credit toggle (#28)
Adds a new optional "🎁 Thanks to {sponsor} for providing the
{platform} key of this game." line to the generated description, for
creators who get review / press keys from publishers or developers.

- Editor: new SponsorCreditEditor (sponsor name + key platform) inside
  the Attribution accordion. Editor store v2 → v3 with a trivial
  migration that back-fills empty strings for old drafts.
- Settings: new `showSponsorCredit` toggle under Tag Settings. Off by
  default so existing users see no behaviour change. Settings store
  v3 → v4; healSettings back-fills the new default.
- Engine: `buildDescription` / `renderAll` take a `showSponsorCredit`
  option. Renders only when the toggle is on AND BOTH sponsor fields
  are non-empty — partial data is treated as "not ready, skip" rather
  than rendered with holes. Positioned above the music section and
  donate block so the thank-you is visually prominent.
- i18n: added sponsor-section UI labels/placeholders, the
  `settings.showSponsorCredit` toggle label, and
  `description.sections.sponsorCredit` template across all 6 locales
  (en, vi, ja, es, ko, zh) + schema.
- Tests: 7 new description-builder cases (render / toggle-off / blank
  name / blank platform / trim / ordering / vi localization) + 1
  healSettings case for the v3 → v4 back-fill.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:48:51 +07:00
poli0981andClaude Opus 4.7 24055f9668 feat(v0.6): self-heal settings store + drop dead autoSaveDraft toggle (#27)
Settings are now re-merged with defaults on every rehydrate, so a
missing / partially-written settings.json can never leave the store in
an incomplete state — missing keys are back-filled, legacy shapes are
upgraded, and removed keys are stripped. Bumps store version 2 -> 3.

Also removes the autoSaveDraft toggle: the editor store already
autosaves unconditionally via zustand persist middleware, so the flag
had no effect. Cleaned up across UI, all 6 locales, and schema.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 10:40:54 +07:00
poli0981 baa7f4f0b7 Merge pull request #26 from poli0981/feat/v0.5-phase6-final
Phase 6 + v0.5.0: A/B variants, template cloning, copyright + usage policy
2026-04-23 21:18:28 +07:00
poli0981andClaude Opus 4.7 42bc7e8b6d feat(v0.5): A/B title variants, template cloning, copyright + usage policy
Phase 6 closes v0.5.0. Ships the last two roadmap features plus the two
description-footer additions the user requested mid-flight.

## A/B title variants

New `src/engine/title-variants.ts` exposes a pure `buildTitleVariants`
that reuses `buildTitle` and `buildQualityBadge` to produce 3 phrasings:

- default:      Game — Type [2K] — suffix
- typeFirst:    Type — Game [2K] — suffix
- qualityFirst: [2K] Game — Type — suffix

`qualityFirst` collapses to the default shape when no badge exists so
callers never see two identical variants.

UI: `VariantPicker` modal opens from the Output page's "Generate
alternatives" button. Each variant has its own CharCounter + Copy.

## Template cloning ("Save as Template")

New `src/store/template-store.ts` persists full-form snapshots of the
editor (`TemplateSnapshot` matches editor-store's partialize shape so
`loadProfile()` can restore everything). Dual-write to file-backed
storage alongside the other stores.

- Output page header gains "Save as Template" → modal prompting a
  name, saves the entire editor state.
- Profiles page gains a third tab "Templates" with list / apply /
  delete, plus export / import JSON — matches the existing preset
  tab pattern.

## Copyright footer (new)

`description-builder` appends section 13.5 between CTA and hashtags
when `showCopyright` is on AND `channelName` is non-empty:

  © 2026 TestChannel. All rights reserved.

`RenderOptions.showCopyright` (default true) threads through
`renderAll` → both hooks → BatchPage. Settings toggle added in Tags
section. Skipping when channelName is blank prevents orphan
"©  . All rights reserved." lines.

## Usage policy block (new)

Section 13.7 — localised fixed template behind `showUsagePolicy`
(default off). Uses the 5-bullet "how to reuse my footage" block
supplied by the user, translated to all 6 locales with plain-text
bullets (YouTube descriptions don't render markdown).

All 6 locales gain:

- `description.sections.copyright` (interpolates year + channelName)
- `description.sections.usagePolicyHeader` (e.g. 📋 USAGE POLICY)
- `description.sections.usagePolicy` (multi-line body)

## i18n

Schema grew to 273 ui + 84 templates keys. Added namespaces:
- `ui.output` — `generateAlternatives`, `saveAsTemplate`,
  `variants.{default, typeFirst, qualityFirst}`
- `ui.templates` — title, createNew, saveAsTemplate, templateName,
  templateNamePlaceholder, loadTemplate, deleteConfirm, emptyState,
  saveHint, savedAs, appliedToast, export/importTemplates
- `ui.settings` — showCopyright, showUsagePolicy

## Signature change

`buildDescription(input, t, hashtagCount)` → `buildDescription(input,
t, options?)` where options is `{ hashtagCount, showCopyright,
showUsagePolicy }`. All internal callers updated; no public API
exposed outside the engine.

## Version bump

`package.json`, `src-tauri/tauri.conf.json`, `src-tauri/Cargo.toml` →
`0.5.0`. CLAUDE.md updated to mention `title-variants.ts` and
`template-store.ts`.

## Tests

129 passing (+13 new):
- 7 title-variants tests — shape, ordering, badge on/off, fallback
  when no badge, mod name interpolation.
- 6 description-builder tests — copyright render/skip/no-channel,
  usage policy render/skip, footer order (CTA → copyright → policy
  → hashtags).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 21:17:08 +07:00
poli0981 8d5803f38d Merge pull request #25 from poli0981/feat/v0.5-phase5-accordion-polish
Phase 5: accordion editor layout + CharCounter polish + Ctrl+G
2026-04-23 20:51:12 +07:00
poli0981andClaude Opus 4.7 43082a13ad feat(editor): accordion layout + CharCounter polish + Ctrl+G shortcut
Phase 5 of the v0.5 roadmap. Regroups the editor's 12+ flat sections
into 6 collapsible accordions so the form doesn't require 40-row
scrolling to reach the less-used fields.

## Accordion layout

New `Accordion` UI component (controlled, animated via grid-rows
transition so any child height works without measurement). EditorPage
re-organises every existing input into 6 stable sections:

  1. Game Info           — language, genres, preset loader, game info
  2. Video Settings      — video type + its extra fields + resolution/fps
  3. Content Details     — timestamps, warnings, playlist, contact email
  4. Attribution         — music, thumbnail text, pinned comment
  5. My Rig              — hardware fields
  6. Store & Social      — store links + social links

Open state is controlled from `settings-store.editorAccordionState`
and persisted through the existing `partialize` + file-backed
snapshot. Defaults open the first two sections so new users see
"Game Info" and "Video Settings" immediately; attribution / rig /
store & social start collapsed to reduce visible scroll.

## GameInfoForm split

The video-type-specific fields (partNumber, bossName, dlcName,
challengeName, modName) lived inside GameInfoForm, which forced them
into the wrong accordion. Moved them to a new `ExtraFieldsInput`
component so they live with the video-type picker in Video Settings.

## CharCounter polish

- Threshold bumped from strict `> 80%` to `>= 80%` — the plan's
  cutoff, matching what creators expect when they think "80%".
- Warning and over-limit states switch to `font-semibold` so the
  number pops without needing coloured backgrounds (which the app's
  CSS-var theme can't express cleanly via Tailwind opacity
  modifiers).

## Ctrl+G generate shortcut

Added alongside the existing Ctrl+Enter. Both navigate to the Output
page. ShortcutHelpModal now lists Ctrl+G first (matching the v0.5
spec) while keeping Ctrl+Enter as an alternative.

## i18n

All six locales gain `editor.sections.{gameInfo, videoSettings,
contentDetails, attribution, rig, storeAndSocial}`. Schema bumped;
validate:locales shows 253/253 ui keys × 6 locales.

Tests: 116 passing (no engine change, no new tests needed).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:50:05 +07:00
poli0981 4d38d68a45 Merge pull request #24 from poli0981/feat/v0.5-phase4-data-fields
Phase 4: music attribution + thumbnail text + pinned comment
2026-04-23 20:38:45 +07:00
poli0981andClaude Opus 4.7 2474cb68ba feat(editor): music attribution, thumbnail text, and pinned comment fields
Phase 4 of the v0.5 roadmap. Adds three data fields that gameplay
YouTubers manage manually today — keeps everything inside YTDescGen so
workflow stays single-app.

## Music / sound attribution

- New `musicAttribution` field on GeneratorInput and editor-store.
- When non-empty, description-builder emits a "🎵 MUSIC / SOUND"
  section right before the donate block (both are credit-adjacent).
- Threaded through `useGeneratedOutput`, `useMultilangOutput`, and the
  BatchPage render loop so every language and part picks it up.
- New template key `description.sections.music` in all six locales.

## Thumbnail text helper

- `thumbnailText` field on editor-store. Never touches the engine —
  it's a creator-private draft so a designer (or the creator) can
  copy the thumbnail overlay text separately.

## Pinned comment template

- `pinnedComment` field on editor-store. Kept out of the description
  on purpose: YouTube treats the pinned comment as its own surface,
  so the text ships via its own copy button, not inlined.

## UI

- Three new editor components (ThumbnailHelper, PinnedCommentEditor,
  MusicAttributionEditor), each a thin Textarea wired into the store.
- EditorPage renders them after WarningToggles and before the store/
  rig/social blocks — roughly the "Attribution" cluster.
- New OutputExtras component on OutputPage shows thumbnail text and
  pinned comment as standalone sections (with their own Copy
  buttons) only when the corresponding field has content.

## i18n

All six locales gain:
- editor: `thumbnailText`, `thumbnailTextPlaceholder`, `pinnedComment`,
  `pinnedCommentPlaceholder`, `musicAttribution`,
  `musicAttributionPlaceholder`
- output: `thumbnailText`, `copyThumbnailText`, `pinnedComment`,
  `copyPinnedComment`
- templates: `description.sections.music` (the section header)

Schema bumped; validate:locales shows 247/247 ui + 81/81 templates.

## Tests

116 passing (+3 new): music section rendered, order vs donate section,
blank/whitespace skipped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:37:24 +07:00
poli0981 3e2fbd838a Merge pull request #23 from poli0981/feat/v0.5-phase3-quality-badge-video-types
Phase 3: quality badge in title + mods/collectibles video types
2026-04-23 20:23:50 +07:00
poli0981andClaude Opus 4.7 e5314ce09c feat(title): quality badge + mods and collectibles video types
Phase 3 of the v0.5 roadmap. Brings two related title-surface upgrades.

## Quality badge "[2K 60FPS]"

- New `buildQualityBadge` helper in title-builder renders a compact
  badge after the video-type segment when resolution/fps are above the
  defaults:
    1080p 60fps → no badge
    1440p 60fps → "[2K]"
    4K 120fps → "[4K 120FPS]"
    1080p 120fps → "[1080p 120FPS]" (resolution retained so a lonely
    fps isn't ambiguous)
  1440p maps to "2K" for title scannability; 720p and 4K pass through.
- Example output:
    Elden Ring — Part 5 [2K] — Gameplay No Commentary
- Settings toggle `showQualityBadge` (default true, in Tags section)
  lets creators opt out.
- `RenderOptions.showQualityBadge` threads through `renderAll`,
  `useGeneratedOutput`, `useMultilangOutput`, and the BatchPage render
  loop.

## Mods + Collectibles video types

Two new entries in VIDEO_TYPES for gameplay channels that frequently
make this kind of content:

- `mods` (icon 🧩): extra field `modName`. Title renders as
  "{{modName}} Mods" (e.g. "Requiem Mods"). Intro template names the
  mod. Tag pool: "mods", "modded gameplay", "mod showcase", etc.
- `collectibles` (icon ⭐): no extra fields. Title "All Collectibles".
  Tag pool covers 100% collectibles, completionist run, achievement
  guide.

GameInfoForm renders the modName input when the video type is `mods`.
`GeneratorInput.modName` is optional and threaded through both title
and description builders.

## i18n

All six locales (en/vi/ja/es/ko/zh) gain:
- `title.videoType.mods` + `.collectibles` (title templates)
- `description.intro.mods` + `.collectibles` (intro templates)
- `videoTypes.mods` + `.collectibles` (UI labels)
- `editor.modName` + `.modNamePlaceholder`
- `settings.showQualityBadge`

Schema bumped; validate:locales shows 237/237 ui + 80/80 templates.

## Tests

113 passing (+15 new). New coverage:
- 6 buildQualityBadge unit tests (all resolution/fps combinations)
- 6 buildTitle tests for badge placement, override, and both new
  video types
- 2 tag-generator tests for the new VIDEO_TYPE_TAGS entries

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:22:07 +07:00
poli0981 f6d8dfe51e Merge pull request #22 from poli0981/feat/v0.5-phase2-multi-genre
Phase 2: multi-select genres (42 total) with persist migrations
2026-04-23 20:10:07 +07:00
poli0981andClaude Opus 4.7 32e2e1e90e feat(genres): multi-select genres with 15 new granular sub-genres
Phase 2 of the v0.5 roadmap. Turns the single-genre picker into a
multi-select (max 3) and doubles the genre catalogue to 42 entries
so creators can tag a game like Elden Ring as "Action + Action RPG +
Souls-like" instead of picking one.

## Engine — breaking change to GeneratorInput

- `GeneratorInput.genre: Genre` became `genres: Genre[]`. The first
  entry drives the genre hashtag and trending-tag template; all
  selected genres contribute to the tag pool and the final dedup
  collapses overlap.
- New `MAX_GENRES = 3` constant.
- 15 new `GENRE_TAG_REGISTRY` entries, each with 3-4 genre-specific
  tag phrases: hack_slash, beatemup, platformer, survival_horror,
  psychological_horror, jrpg, action_rpg, arena_shooter, tactical_fps,
  boomer_shooter, extraction_shooter, shmup, city_builder, deck_builder,
  auto_battler.

## Stores — zustand persist migrations

All four persisted stores bump to version 2 and migrate v1 → v2
in-place so existing drafts, settings, presets, and history survive:

- editor-store: `genre` → `genres[]`
- settings-store: `defaultGenre` → `defaultGenres[]`
- preset-store: `GamePreset.genre` → `genres[]` (plus import normalisation)
- history-store: `HistoryEntry.genre` → `genres[]`

## UI

- ChipGroup gains a `multiple` mode with optional `max`. When the cap
  is reached, unselected chips disable and a counter (e.g. 2/3) shows
  next to the label.
- GenreSelector and the Settings page's default-genre field both use
  the new multi-select chip group.
- PresetCard renders every selected genre as a chip instead of just
  the first one.

## i18n

All 6 locales (en/vi/ja/es/ko/zh) gain 15 genre labels. The schema
(`_schema.json`) is updated to match so `npm run validate:locales`
stays strict. Tests: 98 passing (+1 new multi-genre hashtag test).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:08:39 +07:00
poli0981 9e99335d41 Merge pull request #21 from poli0981/feat/v0.5-phase1-bugs
Phase 1: fix underscore leaks + Tauri settings-folder opener
2026-04-23 19:49:05 +07:00
poli0981andClaude Opus 4.7 0979cfb3cc fix(tauri): open settings folder via opener plugin
The existing "Open Folder" button called tauri-plugin-shell.open() but
the default capability only grants shell:default, which excludes
allow-open, so every click toast-failed with "Could not open settings
folder".

Swap to the purpose-built tauri-plugin-opener (v2), which is the
recommended way to reveal files/folders in the host file manager:

- Cargo.toml: add tauri-plugin-opener = "2"
- lib.rs: register the plugin
- capabilities/default.json: grant opener:default plus
  allow-open-path and allow-reveal-item-in-dir scoped to $APPDATA (the
  only directory the UI ever opens)
- package.json: add @tauri-apps/plugin-opener
- SettingsPage.tsx: call openPath(dir) from the opener plugin

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 19:47:56 +07:00
poli0981andClaude Opus 4.7 d07b3fb3fa fix(engine): sanitise hashtags and humanise snake_case rig keys
Three underscore leaks were surfacing in the generated output:

- Rig section printed snake_case keys as-is (VIDEO_EDITOR:), now the key
  is split on underscore before upper-casing (VIDEO EDITOR:).
- Genre hashtag included the raw id (#visual_novel), now goes through a
  new sanitiseHashtag that drops every non-letter/digit so game names
  with punctuation also work (#STALKER2, #YakuzaLikeaDragon).
- Trending tag template interpolated the raw genre id ("best
  visual_novel games 2026"), now humanised via humanizeId.

Also narrows the store-links filter with a type predicate to remove a
pre-existing non-null assertion that was failing ESLint on main.

Adds 16 new tests covering the sanitiser, rig humanisation, hashtag
sanitising, and trending-tag humanisation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 19:47:23 +07:00
poli0981 186252b18f Merge pull request #20 from poli0981/chore/bump-version-0.4.0
chore: bump version to 0.4.0
2026-04-15 17:04:00 +07:00
poli0981andClaude Opus 4.6 252c2c589f chore: bump version to 0.4.0
Covers everything merged since v0.2.0:
- Phase A (PR #9-#15): tray Quit fix, drop macOS from release matrix,
  playlist title simplification, full_demo/demo_part video types,
  per-language tag scoping + visual_novel genre, timeline i18n parser.
- Phase B (PR #16-#19): proper Steam/itch.io URL regex with Steam
  normalize, invalid URLs no longer commit to the output, rig
  Video Editor dropdown + version, per-link Free/Paid/Demo type with
  dynamic GET/DOWNLOAD heading.

Bumps package.json, package-lock.json, src-tauri/Cargo.toml,
src-tauri/Cargo.lock, and src-tauri/tauri.conf.json.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 17:02:35 +07:00
poli0981 5f237012ea Merge pull request #19 from poli0981/feat/store-link-type
feat(store-links): per-link Free/Paid/Demo type with dynamic heading
2026-04-15 14:57:46 +07:00
poli0981andClaude Opus 4.6 f14b898d98 feat(store-links): per-link Free/Paid/Demo type with dynamic heading
Adds a parallel storeLinkTypes map to the editor store and GeneratorInput
so each store link can be classified as paid, free, or demo. Missing
entries default to "paid" so pre-existing drafts keep rendering
identically.

- Engine: new StoreLinkType union; description-builder picks a heading
  by majority (>50% non-paid → DOWNLOAD THE GAME, otherwise GET THE GAME)
  and appends a (free) or (free demo) suffix per link.
- Locales: the old description.sections.storeLinks key is replaced by
  storeLinksBuy / storeLinksDownload + a storeLinkSuffix block across
  all 6 templates.json files. ui.json gains editor.storeLinkType and a
  storeLinkTypes namespace.
- UI: StoreLinkEditor now renders a Type select next to each URL input.
  setStoreLinkType action added to editor-store.
- 6 new description-builder tests cover majority rule, tie-breaking,
  demo/free suffixes, and the paid default fallback.

No migration is required because storeLinkTypes starts empty and the
engine treats missing entries as "paid".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:57:22 +07:00
poli0981 77a4ef1d9c Merge pull request #18 from poli0981/feat/rig-video-editor
feat(rig): add Video Editor dropdown + version field
2026-04-15 14:43:43 +07:00
poli0981andClaude Opus 4.6 e3ecfc20a4 feat(rig): add Video Editor dropdown + version field
Extends the rig config with a new field type 'dropdown_with_version'
so users can pick their video editor from a curated list (DaVinci
Resolve / Studio, Premiere, After Effects, CapCut, Vegas, Final Cut,
Kdenlive, Shotcut, Filmora, Other) and free-type the version number.

- src/config/rig-fields.ts: new RigField shape, VIDEO_EDITOR_OPTIONS
  list, and a formatRigValue() helper that expands the stored
  "<id>|<version>" form into "Brand Name X.Y" for description output.
- RigEditor renders a Select + version Input pair for the new field
  type, falling back to Input for text fields.
- description-builder pipes rig values through formatRigValue.
- New 'editor.version' and 'rig.video_editor' keys in all 6 ui.json
  locales; schema updated accordingly.
- 7 new tests for formatRigValue edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:43:33 +07:00
poli0981 17e7d0dd6c Merge pull request #17 from poli0981/fix/url-invalid-not-committed
fix(validation): clear committed value when URL is invalid
2026-04-15 14:39:14 +07:00
poli0981andClaude Opus 4.6 7c77e8ed18 fix(validation): clear committed value when URL is invalid
ValidatedInput now commits an empty string (not the raw input) when a
field fails validation, while preserving the user's typed text in the
local displayValue so they can keep editing. This prevents invalid URLs
from landing in the generated description/tags — the existing
description-builder filters on empty strings, so bad links silently drop
out until they become valid again.

Warnings (e.g. prefix mismatch) continue to commit so the user can
override, but hard errors from validateUrlWithPattern now block the
commit path entirely.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:39:04 +07:00
poli0981 efebd24492 Merge pull request #16 from poli0981/fix/url-validation-platforms
fix(platforms): proper URL regex for Steam + itch.io with normalize
2026-04-15 14:37:43 +07:00
poli0981andClaude Opus 4.6 5871a482c7 fix(platforms): proper URL regex for Steam + itch.io with Steam normalize
Platform config now carries an authoritative urlPattern RegExp (and an
optional normalize() hook) instead of a naive startsWith() prefix check.

- Steam: https://store.steampowered.com/app/<id> with optional trailing
  slug. A normalizer strips the slug so committed URLs are canonical.
- itch.io: enforces the https://<dev>.itch.io/<game> subdomain form and
  rejects the bare https://itch.io/ host.
- validateUrlWithPattern() added to utils/validation for platform-scoped
  checks; prefix-mismatch is now a hard error instead of a silent warning.
- StoreLinkEditor uses the new validator and normalizes Steam URLs on
  commit.
- 13 new unit tests covering Steam accept/reject/normalize and itch.io
  accept/reject.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:37:24 +07:00
poli0981 2dc4cc3ac6 Merge pull request #15 from poli0981/feat/timeline-i18n
feat(timeline): parse and localize chapter markers
2026-04-15 13:50:46 +07:00
poli0981andClaude Opus 4.6 97a63d36f7 feat(timeline): parse and localize chapter markers
Adds a pure timeline parser (src/engine/timeline-parser.ts) that
recognizes common chapter markers across 6 languages (Chapter/Part/
Boss/Final Boss/Intro/Ending/Tutorial/Credits, in en/vi/ja/es/ko/zh),
extracts ordinal numbers, and re-renders the block in the user's
output language using a new templates.json 'timeline.keywords' namespace.

- New engine module: timeline-parser.ts with parseTimeline / renderTimeline
- description-builder now runs raw timestamps through parse+render so
  'Chapter 1' becomes 'Chương 1' when language is Vietnamese
- All 6 locales gain the timeline.keywords block (en/vi/ja/es/ko/zh)
- Schema updated, 12 new unit tests for the parser/renderer

Unrecognized labels are kept verbatim so the user's free-form notes
survive the round-trip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:50:37 +07:00
poli0981 bf1d71a2bb Merge pull request #14 from poli0981/feat/tag-generator-upgrade
feat(tags): scope tags to selected language, add visual_novel genre
2026-04-15 13:46:10 +07:00
poli0981andClaude Opus 4.6 a4e49f417f feat(tags): scope tags to selected language, add visual_novel genre
- Multilingual tags now honor the selected language instead of always
  emitting every language pool. Picking 'vi' no longer injects Japanese,
  Korean, or Chinese tags.
- Core tag pool is now language-specific (CORE_TAGS_BY_LANG) so the
  highest-priority tags match the viewer's region.
- New genre 'visual_novel' added to engine types, GENRE_TAG_REGISTRY,
  config/genres.ts, schema, and all 6 ui.json locales.
- Expanded several genre tag pools (story, indie, action, horror, etc.)
  so common searches aren't missed.
- Engine types updated with full_demo / demo_part / visual_novel.
- tag-generator tests updated to verify per-language isolation and new
  genre/video-type pools.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:46:01 +07:00
poli0981 535e4f7a8c Merge pull request #13 from poli0981/chore/cleanup-vite-cache
chore: clean up .vite cache + PHASE-4.1.md from main
2026-04-15 13:38:04 +07:00
poli0981andClaude Opus 4.6 91708ee95f chore: remove accidentally committed .vite/ cache and PHASE-4.1.md
PR #12 accidentally committed the Vite dep cache and a local planning
note. This removes them from the tree and adds .vite/ to .gitignore
so it can't happen again.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:37:56 +07:00
poli0981 793332b60c Merge pull request #12 from poli0981/feat/demo-video-types
feat(video-types): add 'full_demo' and 'demo_part'
2026-04-15 13:35:17 +07:00
poli0981andClaude Opus 4.6 e68d98df52 feat(video-types): add 'full_demo' and 'demo_part' video types
Introduces two new video types for demo coverage: 'full_demo' (complete
demo playthrough) and 'demo_part' (part-based demo series, reuses
partNumber field). Both wire through config, tag-generator pools,
schema, and all 6 locale templates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:35:07 +07:00
poli0981 9f09e53d73 Merge pull request #11 from poli0981/feat/playlist-title-format
feat(playlist): simplify title format to '[status] - Game Name'
2026-04-15 13:32:41 +07:00
poli0981andClaude Opus 4.6 9877671cae feat(playlist): simplify title format to '[status] - Game Name'
Drop the 'Gameplay No Commentary' suffix and em-dash separators from
the playlist title format across all 6 locales. Titles are now
'{{status}} - {{gameName}}' (e.g. '✅ Completed - Elden Ring').

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:32:32 +07:00
poli0981 9f76b07cb0 Merge pull request #10 from poli0981/ci/remove-macos
ci: drop macOS from desktop release matrix
2026-04-15 13:31:28 +07:00
poli0981andClaude Opus 4.6 d8a2780fe2 ci: drop macOS from desktop release matrix
Only Windows is supported for desktop releases going forward. Removes
both aarch64-apple-darwin and x86_64-apple-darwin matrix entries.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:31:11 +07:00
poli0981 c590e5a0a2 Merge pull request #9 from poli0981/fix/tray-quit
fix(tauri): tray Quit now actually exits the app
2026-04-15 13:30:40 +07:00
poli0981andClaude Opus 4.6 0c1df9d31f fix(tauri): tray Quit now actually exits the app
Introduce an AtomicBool 'quitting' flag set when the user picks Quit
from the tray menu. Window CloseRequested and RunEvent::ExitRequested
check this flag: when false, the app stays alive (close-to-tray); when
true, the exit proceeds normally.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:29:47 +07:00
101 changed files with 11780 additions and 758 deletions

No files matched your search

+17 -3
View File
@@ -10,14 +10,17 @@ permissions:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
- os: macos-13
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
@@ -28,6 +31,16 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf
- run: npm ci
- uses: tauri-apps/tauri-action@v0
env:
@@ -37,3 +50,4 @@ jobs:
releaseName: "YTDescGen v__VERSION__"
releaseBody: "See the assets to download the installer for your platform."
releaseDraft: true
args: --target ${{ matrix.target }}
+1
View File
@@ -1,5 +1,6 @@
node_modules/
dist/
.vite/
.env
.env.*
*.local
+125
View File
@@ -0,0 +1,125 @@
# Changelog
All notable changes to YTDescGen ship as tagged releases on `main`.
## v0.9.0 — 2026-05-03
Two-phase release. Phase 1 covered the gacha video type and four new URL extractors with a typed-name-mismatch banner; phase 2 wrapped the version with a QoL trio and a four-platform CI release matrix. PRs that landed: [#37](https://github.com/poli0981/youtube-generator/pull/37) (phase 1 B2), [#40](https://github.com/poli0981/youtube-generator/pull/40) (phase 1 B1, re-ship of #38), [#41](https://github.com/poli0981/youtube-generator/pull/41) (phase 2).
### Added
- **Gacha-quest video type** ([#40](https://github.com/poli0981/youtube-generator/pull/40)) — new `VideoType: "gacha_quest"` with a 17-value `gachaQuestType` enum grouped by use case (Story / Events / Tutorial-Trial / Endgame-Multiplayer / Showcase) plus free-form `chapterName` and `questName` extras. `partNumber` is reused, with the suffix wording driven by quest type — `main_story` → `"- Part N"`, `anniversary` + `daily_commission` → `"- Day N"`, `endgame` → `"- Floor N"`, every other quest type drops the suffix. Per-quest-type title format and intro template, single shared pinned-comment greeting.
- **4 new URL extractors** ([#37](https://github.com/poli0981/youtube-generator/pull/37)) — Epic Games Store (locale-prefixed `/p/<slug>`, strips trailing 6+-char hex hash), Nintendo US (`/us/store/products/<slug>`, strips `-switch` / `-switch-2` platform suffix), Nintendo EU (`/<locale>/Games/<segment>/<slug>-<id>.html`, strips trailing numeric id), and Humble Bundle. PlayStation / Xbox / Amazon Luna stay unsupported because their canonical URLs use opaque product IDs.
- **Name-mismatch warning banner** ([#37](https://github.com/poli0981/youtube-generator/pull/37)) — `StoreLinkEditor` shows a reactive banner above the platform grid when any filled link extracts to a name whose tokens aren't a subset of the typed Game Name. New `isLinkNameMismatch(gameName, url)` helper applies a subset-tolerant token comparison; apostrophes are stripped (not spaced) so `Marvel's` matches `Marvels` in Steam slugs. Per-pair dismissal (`gameName|url` fingerprint); banner re-shows automatically when either side changes.
- **Keyboard-shortcuts cheatsheet** ([#41](https://github.com/poli0981/youtube-generator/pull/41)) — bare `?` key now opens the existing modal (Ctrl+/ still works); the `?` handler skips firing when the keydown target is an input / textarea / select / contentEditable element. The modal grows a search input that filters by translated label OR by the literal key combo string.
- **Genre selector search + bulk-toggle** ([#41](https://github.com/poli0981/youtube-generator/pull/41)) — case-insensitive substring filter above the chip group, plus three bulk-select buttons ("All RPGs" / "All Shooters" / "All Horror") that replace the current selection with the first `MAX_GENRES` (3) ids of the matching `GENRE_GROUPS` entry. Filter clears on bulk-toggle.
### Changed
- **Editor store** v6 → v7 (additive — gacha extras `gachaQuestType` / `chapterName` / `questName`).
- **TemplateSnapshot** — extends with the gacha extras as optional so legacy templates load cleanly.
### CI / Release
- **`release-desktop.yml`** ([#41](https://github.com/poli0981/youtube-generator/pull/41)) grows from a Windows-only build to a four-entry matrix: `windows-latest`, `macos-13` (Intel), `macos-14` (ARM), `ubuntu-latest`. `fail-fast: false` so one platform breaking doesn't cancel the others. Linux runner installs `libwebkit2gtk-4.1-dev` + companions for Tauri's webview + AppImage tooling. `tauri-action@v0` collects all artifacts onto a single draft GitHub Release named `YTDescGen v__VERSION__`. No code signing; release notes come from the tag message.
### Under the hood
- New `src/config/gacha-quest-types.ts` houses the 17-value enum, display-order grouping, and the per-quest-type partNumber suffix style map (`GACHA_PART_SUFFIX_STYLES`).
- New `src/config/genres.ts:GENRE_GROUPS` typed `Record<GenreGroupId, readonly GenreId[]>` drives the bulk-toggle buttons.
- All 6 locales updated: 428 ui + 203 template keys each (up from 391 + 164 in v0.8). en + vi fully translated; ja / es / ko / zh seeded with English placeholders for the new strings.
- Full suite: 297 tests green; main bundle 270 KB.
### Migration notes
- No manual action required. First launch after upgrade heals any missing keys in place.
- Pre-v0.9 drafts get `gachaQuestType: "main_story"` and empty `chapterName` / `questName` defaults. The fields only matter when `videoType === "gacha_quest"`.
## v0.8.1 — 2026-05-02
Patch release fixing a v0.8 regression in the genre-playlist suggestion feature.
### Fixed
- **Genre-playlist URL validator** ([#36](https://github.com/poli0981/youtube-generator/pull/36)) accepted only `https://www.youtube.com/playlist?list=…` with the literal `www.` subdomain and rejected any extra query parameters. Real share URLs from YouTube emit `https://youtube.com/…` (no `www.`) or `…&si=…` tracking params, both of which silently failed validation and the `ValidatedInput` component then wiped the entry from the settings store. Now accepts: optional `www.`, `list=…` at any position in the query string with sibling params before/after, and a trailing fragment. `watch?v=…` and `youtu.be/…` short URLs still rejected (path must be `/playlist`).
### Under the hood
- 4 new validation tests cover the relaxed regex (no-www, mixed query order, trailing fragment, `&si=` tracking suffix). Full suite: 253 tests green.
## v0.8.0 — 2026-05-02
Three-PR release covering graphics rebuild, livestream support, pinned-comment polish, and Vietnamese-specific donate fields. PRs that landed: [#32](https://github.com/poli0981/youtube-generator/pull/32) (phase 1), [#33](https://github.com/poli0981/youtube-generator/pull/33) (phase 2), [#34](https://github.com/poli0981/youtube-generator/pull/34) (polish), [#35](https://github.com/poli0981/youtube-generator/pull/35) (version bump).
### Added
- **Graphics Settings v2** — preset is now an enum (`Low` → `Extreme` + `Custom`) instead of free-form text, default `Medium`. New multi-select **Ray Tracing** modes (Ray Tracing / Full Ray Tracing / Path Tracing / Ray Reconstruction), **Frame Generation** vendor + multiplier (NVIDIA / AMD / Intel × x2 / x3 / x4 / x6), **Upscaling Quality** (DLSS / FSR / XeSS quality presets), **Art Style** dropdown, free-form **Driver / Game Version** field, and a **Skip-graphics toggle** for 2D / pixel-art / web games (auto-suggested when a `visual_novel` / `fmv` / `rhythm` genre is added). Description renders a labelled multi-line block: `Video: 1080p - 60 FPS` / `In-game Setting: Cinematic - NVIDIA Frame Generation x2 with Ray Tracing` / `Art Style: …` / `Version: …`.
- **Livestream** — new VideoType with `liveUrl` + `scheduledTime` extras. Title gets `🔴 LIVE` segment, description gets `🔴 LIVE on {{time}}` / `Watch / replay: {{link}}` block (locale-aware datetime via `Intl.DateTimeFormat`), tag pool gets `livestream` / `live gameplay` / `${gameName} live` / `${gameName} stream`, pinned-comment template gets a livestream-specific greeting.
- **Pinned-comment genre playlists** — Settings → Genre Playlists section configures one YouTube playlist URL per genre. When the new `pinnedCommentIncludeGenrePlaylist` toggle is on, the template auto-suggests `📺 More <genre> gameplay on the channel: <link>` for the video's primary genre.
- **Vietnamese donate** — five new editor fields (bank name, account number, account holder, MoMo, ZaloPay) in a new `VietnameseDonateEditor` component. Description block `🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ (Việt Nam)` only renders when output language is `vi`; bank line drops the parens when holder is empty; e-wallet lines render independently.
- **Mod List textarea** — new `modList` field exposed alongside `modName` for the `mods` videoType. Description gets a `🧩 MOD LIST` block right after MY RIG.
- **Publisher / Developer site** — 10th store-link platform with a permissive HTTPS pattern for indie / niche releases.
- **URL paste auto-extract** — pasting a Steam / itch.io / GOG URL into a store-link input auto-fills an empty Game Name with a 5s Undo toast. Other storefronts skipped because their URL slugs aren't stable.
- **YouTube playlist URL validator** — `validatePlaylistUrl` for the editor's playlist-link field and the new Genre Playlists settings. (Note: a regression in the strict regex shipped here; corrected in v0.8.1.)
### Fixed
- **Long-game-name tag bug** ([#32](https://github.com/poli0981/youtube-generator/pull/32)) — composite tags built from a long game name (`Tony Hawk's Pro Skater 1+2 Remastered: Definitive Edition`) used to silently disappear because they exceeded YouTube's 30-char per-tag limit. New `tagFriendlyGameName` helper strips trademark marks + edition qualifiers, then composes ≤21-char form for composite tags + bare ≤30-char form. The game name now always lands in the tag list.
### Changed
- **Editor store**: v4 → v5 (graphics enum + livestream + new fields, legacy `graphicsPreset` text mapped via `legacyGraphicsPresetToEnum`); v5 → v6 (additive — VN donate fields + modList).
- **Settings store**: v6 → v7 (additive — `genrePlaylists` map + the new pinned-comment toggle).
- **TemplateSnapshot** — extended to capture the v0.7 phase 2 fields that had been missing (`playthroughStatus`, `difficulty`, `difficultyCustomLabel`, `contentWarnings`) plus all v0.8 fields. Saving a template now preserves full editor state.
- **Video Settings description block** — was a single pipe-separated line `1080p | 60 FPS | Cinematic Setting - …`, now multi-line with explicit labels matching the rig + timestamps shape.
### Under the hood
- New `src/config/graphics-settings.ts` houses every graphics-related enum + the `GENRES_WITHOUT_GRAPHICS_SETTINGS` allowlist for the auto-suggest hint.
- New `src/utils/url-extractors.ts` implements Steam / itch.io / GOG slug extraction with a shared `titleCase` helper.
- Brand-name table (`VENDOR_GFX_BRANDS`) is engine-internal and English-only across locales (DLSS / FSR / XeSS preserved verbatim for SEO).
- All 6 locales updated: 391 ui + 164 template keys each. Vietnamese fully translated; ja / es / ko / zh seeded with English defaults for the new strings.
- Full suite: 249 tests green; main bundle 239 KB.
### Migration notes
- No manual action required. First launch after upgrade heals any missing keys in place.
- Pre-v0.8 free-form `graphicsPreset` text values map automatically: known labels ("Ultra", "Very High", …) become enum values; anything else lands in the new Custom slot ("Epic" → `graphicsPreset: "custom"` + `graphicsPresetCustom: "Epic"`).
- Existing `Profile` and `TemplateSnapshot` shapes are TS-extended to the v0.8 enum types; legacy on-disk values round-trip via `normalizeEditorPatch` on `loadProfile` / `loadPreset`.
## v0.7.0 — 2026-04-24
Two-phase release. Phase 1 landed as [#30](https://github.com/poli0981/youtube-generator/pull/30); this entry is cumulative across both phases.
### Added
- **Title format settings** (phase 1): configure where the quality badge sits (`prefix` / `middle` / `suffix`), which separator joins the segments (`—` / `-` / `:` / `|`), and the badge case (`2K` / `2k`). Defaults reproduce v0.6 output byte-for-byte. Setting the trio to `prefix` + `hyphen` + `lower` produces e.g. `[2k] - Elden Ring - phần 1 - Gameplay No Commentary`.
- **Settings page reorganized** (phase 1) from 5 → 7 sections: Appearance, Language & Defaults, Editor, **Title**, **Description**, Tags, History.
- **Content Details** (phase 2): three new editor fields for framing a run.
- `Playthrough status` — Blind / Replay / New Game+ / Post-game. Renders a `🎯 Playthrough: …` line right after the intro.
- `Difficulty` — Easy / Normal / Hard / Nightmare / Custom. Custom reveals a free-form label so game-specific names like "Lethal" or "NG+7" survive a locale switch unchanged.
- `Content warnings` — multi-select chips for Flashing lights / Loud noises / Jump scares. Renders a `⚠️ CONTENT WARNINGS` bulleted block between spoiler and mature warnings.
- **Pinned-comment template system** (phase 2): opt-in Settings toggle generates a ready-to-paste pinned comment per video. Per-video-type greetings (boss / ending / speedrun / …) sit atop four shared CTA lines (thanks / playlist / engage / ask-next-game). Shown as a third section on the Output page alongside the user's freeform pinned comment; Batch generates one per part per language with its own copy button.
### Changed
- **Settings store**: v4 → v6. Heal migration back-fills `titleFormat` (v4→v5) and the two pinned-comment toggles (v5→v6) with sensible defaults — upgrading from v0.6 requires no manual action.
- **Editor store**: v3 → v4. Heal migration back-fills `playthroughStatus`, `difficulty`, `difficultyCustomLabel`, and `contentWarnings` — existing drafts round-trip cleanly.
- **Shared `useCurrentGeneratorInput` hook**: the editor → `GeneratorInput` shape used to be copy-pasted across four call sites (two hooks + Batch + OutputExtras). Extracted into one hook; future input-field additions now touch one file instead of four.
- **`buildTitle` options bag**: third arg accepts either the legacy boolean (`showQualityBadge`) OR a full options object. Legacy callers (including `title-variants.ts`) don't need to change.
### Fixed
- `useMultilangOutput` was silently missing `showSponsorCredit` and the sponsor fields on its built `GeneratorInput`, so multi-language output hid the sponsor credit line even when the setting was on. Fixed while threading the new `titleFormat` options through.
### Under the hood
- `engine/types.ts` gained `TitleFormatConfig`, `PlaythroughStatus`, `DifficultyLevel`, `ContentWarning` + the const-tuple ID registries that back them. Engine stays pure; `store/settings-heal.ts` re-exports.
- New pure module `engine/pinned-comment-builder.ts` (10 unit tests).
- Description builder gained 9 new cases; title builder has 10 new options-bag cases; settings-heal has 5 new migration cases. Full suite: 175 tests green.
- All 6 locales (`en`, `vi`, `ja`, `es`, `ko`, `zh`) now in sync at 314 UI + 125 template keys each.
### Migration notes
- No manual action required. First launch after upgrade heals any missing keys in place.
- If you've been hand-editing `settings.json` or `ytdescgen-editor-draft.json`, the new optional fields will be back-filled to sensible defaults (playthrough/difficulty default to `"none"` → section is skipped; content warnings default to `[]`; pinned-comment template defaults to off).
+4 -2
View File
@@ -75,7 +75,8 @@ yt-desc-gen/
│ │ └── _schema.json # JSON schema for locale validation
│ │
│ ├── engine/ # Core template engine (pure functions, no React)
│ │ ├── title-builder.ts # Title generation logic
│ │ ├── title-builder.ts # Title generation + quality-badge helper
│ │ ├── title-variants.ts # A/B variant title generator (v0.5)
│ │ ├── description-builder.ts # Description generation logic
│ │ ├── tag-generator.ts # Tag generation + dedup + char limit
│ │ ├── template-renderer.ts # Orchestrator: combines title + desc + tags
@@ -85,8 +86,9 @@ yt-desc-gen/
│ │ ├── editor-store.ts # Current editor form state
│ │ ├── profile-store.ts # Saved profiles (social, rig, channel)
│ │ ├── preset-store.ts # Game presets (name + store links)
│ │ ├── template-store.ts # Full-form snapshots (v0.5)
│ │ ├── history-store.ts # Generated output history
│ │ └── settings-store.ts # App settings (theme, default language)
│ │ └── settings-store.ts # App settings (theme, default language, description toggles)
│ │
│ ├── hooks/ # Custom React hooks
│ │ ├── use-generated-output.ts # Memoized template rendering
+3 -3
View File
@@ -254,9 +254,9 @@ Zustand Stores:
│ SettingsStore │
│ - theme: "dark" | "light" │
│ - defaultLanguage: SupportedLanguage │
│ - defaultGenre: Genre │
│ - autoSaveDraft: boolean │
│ Middleware: persist (localStorage) │
│ - defaultGenres: GenreId[] │
│ - (flags: quality badge / copyright / ...) │
│ Middleware: persist (localStorage + file) │
└───────────────────────────────────────────────┘
```
+17 -39
View File
@@ -239,48 +239,26 @@ Output locations:
### GitHub Actions Release
```yaml
# .github/workflows/release-desktop.yml
name: Release Desktop
The live workflow lives at [.github/workflows/release-desktop.yml](../.github/workflows/release-desktop.yml). Pushing a `v*` tag (e.g. `v0.10.0`) triggers a four-platform matrix build (Windows, macOS Intel, macOS ARM, Linux) and uploads each installer to a single draft GitHub Release named `YTDescGen v__VERSION__`. Publish the draft manually after smoke-testing the binaries.
on:
push:
tags: ["v*"]
Matrix entries (v0.9 phase 2):
permissions:
contents: write
| Runner | Target | Output |
|---|---|---|
| `windows-latest` | `x86_64-pc-windows-msvc` | `.msi`, `.exe` (NSIS) |
| `macos-13` | `x86_64-apple-darwin` | `.dmg`, `.app.tar.gz` |
| `macos-14` | `aarch64-apple-darwin` | `.dmg`, `.app.tar.gz` |
| `ubuntu-latest` | `x86_64-unknown-linux-gnu` | `.AppImage`, `.deb` |
jobs:
build:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- run: npm ci
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__
releaseName: "YTDescGen v__VERSION__"
releaseBody: "See CHANGELOG.md for details."
releaseDraft: true
```
Linux runners install `libwebkit2gtk-4.1-dev`, `libgtk-3-dev`, `libayatana-appindicator3-dev`, `librsvg2-dev`, and `patchelf` before building — Tauri's webview + AppImage tooling needs these.
`fail-fast: false` keeps the other platforms going if one breaks. `args: --target ${{ matrix.target }}` is passed through to `tauri build` so each runner uses its explicit target triple.
**Code signing is intentionally skipped** for both Windows and macOS — this is an open-source personal tool, and signing certificates carry recurring cost. End users will see the standard "unverified publisher" / "unidentified developer" prompts on first launch. Document the bypass steps in the release notes if needed.
**Auto-changelog** (`git-cliff`) is out of scope; release notes come from the tag's annotated message via the default `tauri-action` behaviour. CHANGELOG.md is hand-maintained.
**Backfill for pre-workflow tags:** `v0.8.0` and `v0.8.1` predate the multi-platform matrix and only have local Windows builds. To attach binaries retroactively, build manually then `gh release create v0.8.0 --notes-file CHANGELOG.md path/to/*.msi …`.
## Auto-Update Flow
+12 -2
View File
@@ -1,16 +1,17 @@
{
"name": "yt-desc-gen",
"version": "0.2.0",
"version": "0.7.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yt-desc-gen",
"version": "0.2.0",
"version": "0.7.0",
"dependencies": {
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-opener": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0",
"clsx": "^2.1.0",
"i18next": "^23.15.0",
@@ -1513,6 +1514,15 @@
"@tauri-apps/api": "^2.10.1"
}
},
"node_modules/@tauri-apps/plugin-opener": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-opener/-/plugin-opener-2.5.3.tgz",
"integrity": "sha512-CCcUltXMOfUEArbf3db3kCE7Ggy1ExBEBl51Ko2ODJ6GDYHRp1nSNlQm5uNCFY5k7/ufaK5Ib3Du/Zir19IYQQ==",
"license": "MIT OR Apache-2.0",
"dependencies": {
"@tauri-apps/api": "^2.8.0"
}
},
"node_modules/@tauri-apps/plugin-shell": {
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@tauri-apps/plugin-shell/-/plugin-shell-2.3.5.tgz",
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "yt-desc-gen",
"version": "0.2.0",
"version": "0.9.0",
"private": true,
"type": "module",
"scripts": {
@@ -33,6 +33,7 @@
"@tauri-apps/api": "^2.0.0",
"@tauri-apps/plugin-dialog": "^2.0.0",
"@tauri-apps/plugin-fs": "^2.0.0",
"@tauri-apps/plugin-opener": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.0"
},
"devDependencies": {
+444 -1
View File
@@ -47,6 +47,137 @@ version = "1.0.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
[[package]]
name = "async-broadcast"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
dependencies = [
"event-listener",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-channel"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
dependencies = [
"concurrent-queue",
"event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"pin-project-lite",
"slab",
]
[[package]]
name = "async-io"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
dependencies = [
"autocfg",
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite",
"parking",
"polling",
"rustix",
"slab",
"windows-sys 0.61.2",
]
[[package]]
name = "async-lock"
version = "3.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
dependencies = [
"event-listener",
"event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-process"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
dependencies = [
"async-channel",
"async-io",
"async-lock",
"async-signal",
"async-task",
"blocking",
"cfg-if",
"event-listener",
"futures-lite",
"rustix",
]
[[package]]
name = "async-recursion"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "async-signal"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
dependencies = [
"async-io",
"async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
"rustix",
"signal-hook-registry",
"slab",
"windows-sys 0.61.2",
]
[[package]]
name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
version = "0.1.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "atk"
version = "0.18.2"
@@ -142,6 +273,19 @@ dependencies = [
"objc2",
]
[[package]]
name = "blocking"
version = "1.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21"
dependencies = [
"async-channel",
"async-task",
"futures-io",
"futures-lite",
"piper",
]
[[package]]
name = "brotli"
version = "8.0.2"
@@ -322,6 +466,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "concurrent-queue"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "convert_case"
version = "0.4.0"
@@ -706,6 +859,33 @@ dependencies = [
"cfg-if",
]
[[package]]
name = "endi"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
[[package]]
name = "enumflags2"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
dependencies = [
"enumflags2_derive",
"serde",
]
[[package]]
name = "enumflags2_derive"
version = "0.7.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "equivalent"
version = "1.0.2"
@@ -733,6 +913,27 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "event-listener"
version = "5.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab"
dependencies = [
"concurrent-queue",
"parking",
"pin-project-lite",
]
[[package]]
name = "event-listener-strategy"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
dependencies = [
"event-listener",
"pin-project-lite",
]
[[package]]
name = "fastrand"
version = "2.4.1"
@@ -870,6 +1071,19 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
[[package]]
name = "futures-lite"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
dependencies = [
"fastrand",
"futures-core",
"futures-io",
"parking",
"pin-project-lite",
]
[[package]]
name = "futures-macro"
version = "0.3.32"
@@ -1255,6 +1469,12 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
[[package]]
name = "hex"
version = "0.4.3"
@@ -1766,6 +1986,12 @@ dependencies = [
"libc",
]
[[package]]
name = "linux-raw-sys"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
[[package]]
name = "litemap"
version = "0.8.2"
@@ -2125,6 +2351,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "ordered-stream"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
dependencies = [
"futures-core",
"pin-project-lite",
]
[[package]]
name = "os_pipe"
version = "1.2.3"
@@ -2160,6 +2396,12 @@ dependencies = [
"system-deps",
]
[[package]]
name = "parking"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
version = "0.12.5"
@@ -2388,6 +2630,17 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "piper"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
dependencies = [
"atomic-waker",
"fastrand",
"futures-io",
]
[[package]]
name = "pkg-config"
version = "0.3.32"
@@ -2420,6 +2673,20 @@ dependencies = [
"miniz_oxide",
]
[[package]]
name = "polling"
version = "3.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
dependencies = [
"cfg-if",
"concurrent-queue",
"hermit-abi",
"pin-project-lite",
"rustix",
"windows-sys 0.61.2",
]
[[package]]
name = "potential_utf"
version = "0.1.5"
@@ -2787,6 +3054,19 @@ dependencies = [
"semver",
]
[[package]]
name = "rustix"
version = "1.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
dependencies = [
"bitflags 2.11.0",
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.61.2",
]
[[package]]
name = "rustversion"
version = "1.0.22"
@@ -3575,6 +3855,28 @@ dependencies = [
"url",
]
[[package]]
name = "tauri-plugin-opener"
version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc624469b06f59f5a29f874bbc61a2ed737c0f9c23ef09855a292c389c42e83f"
dependencies = [
"dunce",
"glob",
"objc2-app-kit",
"objc2-foundation",
"open",
"schemars 0.8.22",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"thiserror 2.0.18",
"url",
"windows",
"zbus",
]
[[package]]
name = "tauri-plugin-shell"
version = "2.3.5"
@@ -3696,6 +3998,19 @@ dependencies = [
"toml 0.9.12+spec-1.1.0",
]
[[package]]
name = "tempfile"
version = "3.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [
"fastrand",
"getrandom 0.4.2",
"once_cell",
"rustix",
"windows-sys 0.61.2",
]
[[package]]
name = "tendril"
version = "0.4.3"
@@ -3982,9 +4297,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"pin-project-lite",
"tracing-attributes",
"tracing-core",
]
[[package]]
name = "tracing-attributes"
version = "0.1.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.117",
]
[[package]]
name = "tracing-core"
version = "0.1.36"
@@ -4034,6 +4361,17 @@ version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb"
[[package]]
name = "uds_windows"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
dependencies = [
"memoffset",
"tempfile",
"windows-sys 0.61.2",
]
[[package]]
name = "unic-char-property"
version = "0.9.0"
@@ -4866,6 +5204,9 @@ name = "winnow"
version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945"
dependencies = [
"memchr",
]
[[package]]
name = "winnow"
@@ -5070,7 +5411,7 @@ dependencies = [
[[package]]
name = "yt-desc-gen"
version = "0.2.0"
version = "0.9.0"
dependencies = [
"serde",
"serde_json",
@@ -5078,9 +5419,71 @@ dependencies = [
"tauri-build",
"tauri-plugin-dialog",
"tauri-plugin-fs",
"tauri-plugin-opener",
"tauri-plugin-shell",
]
[[package]]
name = "zbus"
version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca82f95dbd3943a40a53cfded6c2d0a2ca26192011846a1810c4256ef92c60bc"
dependencies = [
"async-broadcast",
"async-executor",
"async-io",
"async-lock",
"async-process",
"async-recursion",
"async-task",
"async-trait",
"blocking",
"enumflags2",
"event-listener",
"futures-core",
"futures-lite",
"hex",
"libc",
"ordered-stream",
"rustix",
"serde",
"serde_repr",
"tracing",
"uds_windows",
"uuid",
"windows-sys 0.61.2",
"winnow 0.7.15",
"zbus_macros",
"zbus_names",
"zvariant",
]
[[package]]
name = "zbus_macros"
version = "5.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897e79616e84aac4b2c46e9132a4f63b93105d54fe8c0e8f6bffc21fa8d49222"
dependencies = [
"proc-macro-crate 3.5.0",
"proc-macro2",
"quote",
"syn 2.0.117",
"zbus_names",
"zvariant",
"zvariant_utils",
]
[[package]]
name = "zbus_names"
version = "4.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffd8af6d5b78619bab301ff3c560a5bd22426150253db278f164d6cf3b72c50f"
dependencies = [
"serde",
"winnow 0.7.15",
"zvariant",
]
[[package]]
name = "zerocopy"
version = "0.8.48"
@@ -5160,3 +5563,43 @@ name = "zmij"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
[[package]]
name = "zvariant"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5708299b21903bbe348e94729f22c49c55d04720a004aa350f1f9c122fd2540b"
dependencies = [
"endi",
"enumflags2",
"serde",
"winnow 0.7.15",
"zvariant_derive",
"zvariant_utils",
]
[[package]]
name = "zvariant_derive"
version = "5.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b59b012ebe9c46656f9cc08d8da8b4c726510aef12559da3e5f1bf72780752c"
dependencies = [
"proc-macro-crate 3.5.0",
"proc-macro2",
"quote",
"syn 2.0.117",
"zvariant_utils",
]
[[package]]
name = "zvariant_utils"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f75c23a64ef8f40f13a6989991e643554d9bef1d682a281160cf0c1bc389c5e9"
dependencies = [
"proc-macro2",
"quote",
"serde",
"syn 2.0.117",
"winnow 0.7.15",
]
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "yt-desc-gen"
version = "0.2.0"
version = "0.9.0"
description = "YouTube Gameplay Description Generator"
authors = ["poli0981"]
edition = "2021"
@@ -16,6 +16,7 @@ tauri-build = { version = "2", features = [] }
tauri = { version = "2", features = ["tray-icon"] }
tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tauri-plugin-opener = "2"
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
+10 -1
View File
@@ -10,6 +10,15 @@
"fs:default",
"fs:allow-read-text-file",
"fs:allow-write-text-file",
"shell:default"
"shell:default",
"opener:default",
{
"identifier": "opener:allow-open-path",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
},
{
"identifier": "opener:allow-reveal-item-in-dir",
"allow": [{ "path": "$APPDATA" }, { "path": "$APPDATA/**" }]
}
]
}
+1 -1
View File
@@ -1 +1 @@
{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command Line truncated
{"core":{"default_permission":{"identifier":"default","description":"Default core plugins set.","permissions":["core:path:default","core:event:default","core:window:default","core:webview:default","core:app:default","core:image:default","core:resources:default","core:menu:default","core:tray:default"]},"permissions":{},"permission_sets":{},"global_scope_schema":null},"core:app":{"default_permission":{"identifier":"default","description":"Default permissions for the plugin.","permissions":["allow-version","allow-name","allow-tauri-version","allow-identifier","allow-bundle-type","allow-register-listener","allow-remove-listener"]},"permissions":{"allow-app-hide":{"identifier":"allow-app-hide","description":"Enables the app_hide command without any pre-configured scope.","commands":{"allow":["app_hide"],"deny":[]}},"allow-app-show":{"identifier":"allow-app-show","description":"Enables the app_show command without any pre-configured scope.","commands":{"allow":["app_show"],"deny":[]}},"allow-bundle-type":{"identifier":"allow-bundle-type","description":"Enables the bundle_type command without any pre-configured scope.","commands":{"allow":["bundle_type"],"deny":[]}},"allow-default-window-icon":{"identifier":"allow-default-window-icon","description":"Enables the default_window_icon command without any pre-configured scope.","commands":{"allow":["default_window_icon"],"deny":[]}},"allow-fetch-data-store-identifiers":{"identifier":"allow-fetch-data-store-identifiers","description":"Enables the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":["fetch_data_store_identifiers"],"deny":[]}},"allow-identifier":{"identifier":"allow-identifier","description":"Enables the identifier command without any pre-configured scope.","commands":{"allow":["identifier"],"deny":[]}},"allow-name":{"identifier":"allow-name","description":"Enables the name command without any pre-configured scope.","commands":{"allow":["name"],"deny":[]}},"allow-register-listener":{"identifier":"allow-register-listener","description":"Enables the register_listener command without any pre-configured scope.","commands":{"allow":["register_listener"],"deny":[]}},"allow-remove-data-store":{"identifier":"allow-remove-data-store","description":"Enables the remove_data_store command without any pre-configured scope.","commands":{"allow":["remove_data_store"],"deny":[]}},"allow-remove-listener":{"identifier":"allow-remove-listener","description":"Enables the remove_listener command without any pre-configured scope.","commands":{"allow":["remove_listener"],"deny":[]}},"allow-set-app-theme":{"identifier":"allow-set-app-theme","description":"Enables the set_app_theme command without any pre-configured scope.","commands":{"allow":["set_app_theme"],"deny":[]}},"allow-set-dock-visibility":{"identifier":"allow-set-dock-visibility","description":"Enables the set_dock_visibility command without any pre-configured scope.","commands":{"allow":["set_dock_visibility"],"deny":[]}},"allow-tauri-version":{"identifier":"allow-tauri-version","description":"Enables the tauri_version command without any pre-configured scope.","commands":{"allow":["tauri_version"],"deny":[]}},"allow-version":{"identifier":"allow-version","description":"Enables the version command without any pre-configured scope.","commands":{"allow":["version"],"deny":[]}},"deny-app-hide":{"identifier":"deny-app-hide","description":"Denies the app_hide command without any pre-configured scope.","commands":{"allow":[],"deny":["app_hide"]}},"deny-app-show":{"identifier":"deny-app-show","description":"Denies the app_show command without any pre-configured scope.","commands":{"allow":[],"deny":["app_show"]}},"deny-bundle-type":{"identifier":"deny-bundle-type","description":"Denies the bundle_type command without any pre-configured scope.","commands":{"allow":[],"deny":["bundle_type"]}},"deny-default-window-icon":{"identifier":"deny-default-window-icon","description":"Denies the default_window_icon command without any pre-configured scope.","commands":{"allow":[],"deny":["default_window_icon"]}},"deny-fetch-data-store-identifiers":{"identifier":"deny-fetch-data-store-identifiers","description":"Denies the fetch_data_store_identifiers command without any pre-configured scope.","commands":{"allow":[],"deny":["fetch_data_store_identifiers"]}},"deny-identifier":{"identifier":"deny-identifier","description":"Denies the identifier command without any pre-configured scope.","commands":{"allow":[],"deny":["identifier"]}},"deny-name":{"identifier":"deny-name","description":"Denies the name command without any pre-configured scope.","commands":{"allow":[],"deny":["name"]}},"deny-register-listener":{"identifier":"deny-register-listener","description":"Denies the register_listener command without any pre-configured scope.","commands":{"allow":[],"deny":["register_listener"]}},"deny-remove-data-store":{"identifier":"deny-remove-data-store","description":"Denies the remove_data_store command Line truncated
+1 -1
View File
@@ -1 +1 @@
{"default":{"identifier":"default","description":"Default capabilities for YTDescGen","local":true,"windows":["main"],"permissions":["core:default","dialog:default","dialog:allow-save","dialog:allow-open","fs:default","fs:allow-read-text-file","fs:allow-write-text-file","shell:default"]}}
{"default":{"identifier":"default","description":"Default capabilities for YTDescGen","local":true,"windows":["main"],"permissions":["core:default","dialog:default","dialog:allow-save","dialog:allow-open","fs:default","fs:allow-read-text-file","fs:allow-write-text-file","shell:default","opener:default",{"identifier":"opener:allow-open-path","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]},{"identifier":"opener:allow-reveal-item-in-dir","allow":[{"path":"$APPDATA"},{"path":"$APPDATA/**"}]}]}}
+233
View File
@@ -1958,6 +1958,174 @@
}
}
},
{
"if": {
"properties": {
"identifier": {
"anyOf": [
{
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
"type": "string",
"const": "opener:default",
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
},
{
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
"type": "string",
"const": "opener:allow-default-urls",
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
},
{
"description": "Enables the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-path",
"markdownDescription": "Enables the open_path command without any pre-configured scope."
},
{
"description": "Enables the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-url",
"markdownDescription": "Enables the open_url command without any pre-configured scope."
},
{
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-reveal-item-in-dir",
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "Denies the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-path",
"markdownDescription": "Denies the open_path command without any pre-configured scope."
},
{
"description": "Denies the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-url",
"markdownDescription": "Denies the open_url command without any pre-configured scope."
},
{
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-reveal-item-in-dir",
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
}
]
}
}
},
"then": {
"properties": {
"allow": {
"items": {
"title": "OpenerScopeEntry",
"description": "Opener scope entry.",
"anyOf": [
{
"type": "object",
"required": [
"url"
],
"properties": {
"app": {
"description": "An application to open this url with, for example: firefox.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"url": {
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"app": {
"description": "An application to open this path with, for example: xdg-open.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"path": {
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
}
}
}
]
}
},
"deny": {
"items": {
"title": "OpenerScopeEntry",
"description": "Opener scope entry.",
"anyOf": [
{
"type": "object",
"required": [
"url"
],
"properties": {
"app": {
"description": "An application to open this url with, for example: firefox.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"url": {
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"app": {
"description": "An application to open this path with, for example: xdg-open.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"path": {
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
}
}
}
]
}
}
}
},
"properties": {
"identifier": {
"description": "Identifier of the permission or permission set.",
"allOf": [
{
"$ref": "#/definitions/Identifier"
}
]
}
}
},
{
"if": {
"properties": {
@@ -5996,6 +6164,54 @@
"const": "fs:write-files",
"markdownDescription": "This enables all file write related commands without any pre-configured accessible paths."
},
{
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
"type": "string",
"const": "opener:default",
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
},
{
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
"type": "string",
"const": "opener:allow-default-urls",
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
},
{
"description": "Enables the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-path",
"markdownDescription": "Enables the open_path command without any pre-configured scope."
},
{
"description": "Enables the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-url",
"markdownDescription": "Enables the open_url command without any pre-configured scope."
},
{
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-reveal-item-in-dir",
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "Denies the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-path",
"markdownDescription": "Denies the open_path command without any pre-configured scope."
},
{
"description": "Denies the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-url",
"markdownDescription": "Denies the open_url command without any pre-configured scope."
},
{
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-reveal-item-in-dir",
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`",
"type": "string",
@@ -6158,6 +6374,23 @@
}
]
},
"Application": {
"description": "Opener scope application.",
"anyOf": [
{
"description": "Open in default application.",
"type": "null"
},
{
"description": "If true, allow open with any application.",
"type": "boolean"
},
{
"description": "Allow specific application to open with.",
"type": "string"
}
]
},
"ShellScopeEntryAllowedArg": {
"description": "A command argument allowed to be executed by the webview API.",
"anyOf": [
+233
View File
@@ -1958,6 +1958,174 @@
}
}
},
{
"if": {
"properties": {
"identifier": {
"anyOf": [
{
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
"type": "string",
"const": "opener:default",
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
},
{
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
"type": "string",
"const": "opener:allow-default-urls",
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
},
{
"description": "Enables the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-path",
"markdownDescription": "Enables the open_path command without any pre-configured scope."
},
{
"description": "Enables the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-url",
"markdownDescription": "Enables the open_url command without any pre-configured scope."
},
{
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-reveal-item-in-dir",
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "Denies the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-path",
"markdownDescription": "Denies the open_path command without any pre-configured scope."
},
{
"description": "Denies the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-url",
"markdownDescription": "Denies the open_url command without any pre-configured scope."
},
{
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-reveal-item-in-dir",
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
}
]
}
}
},
"then": {
"properties": {
"allow": {
"items": {
"title": "OpenerScopeEntry",
"description": "Opener scope entry.",
"anyOf": [
{
"type": "object",
"required": [
"url"
],
"properties": {
"app": {
"description": "An application to open this url with, for example: firefox.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"url": {
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"app": {
"description": "An application to open this path with, for example: xdg-open.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"path": {
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
}
}
}
]
}
},
"deny": {
"items": {
"title": "OpenerScopeEntry",
"description": "Opener scope entry.",
"anyOf": [
{
"type": "object",
"required": [
"url"
],
"properties": {
"app": {
"description": "An application to open this url with, for example: firefox.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"url": {
"description": "A URL that can be opened by the webview when using the Opener APIs.\n\nWildcards can be used following the UNIX glob pattern.\n\nExamples:\n\n- \"https://*\" : allows all HTTPS origin\n\n- \"https://*.github.com/tauri-apps/tauri\": allows any subdomain of \"github.com\" with the \"tauri-apps/api\" path\n\n- \"https://myapi.service.com/users/*\": allows access to any URLs that begins with \"https://myapi.service.com/users/\"",
"type": "string"
}
}
},
{
"type": "object",
"required": [
"path"
],
"properties": {
"app": {
"description": "An application to open this path with, for example: xdg-open.",
"allOf": [
{
"$ref": "#/definitions/Application"
}
]
},
"path": {
"description": "A path that can be opened by the webview when using the Opener APIs.\n\nThe pattern can start with a variable that resolves to a system base directory. The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.",
"type": "string"
}
}
}
]
}
}
}
},
"properties": {
"identifier": {
"description": "Identifier of the permission or permission set.",
"allOf": [
{
"$ref": "#/definitions/Identifier"
}
]
}
}
},
{
"if": {
"properties": {
@@ -5996,6 +6164,54 @@
"const": "fs:write-files",
"markdownDescription": "This enables all file write related commands without any pre-configured accessible paths."
},
{
"description": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`",
"type": "string",
"const": "opener:default",
"markdownDescription": "This permission set allows opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application\nas well as reveal file in directories using default file explorer\n#### This default permission set includes:\n\n- `allow-open-url`\n- `allow-reveal-item-in-dir`\n- `allow-default-urls`"
},
{
"description": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application.",
"type": "string",
"const": "opener:allow-default-urls",
"markdownDescription": "This enables opening `mailto:`, `tel:`, `https://` and `http://` urls using their default application."
},
{
"description": "Enables the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-path",
"markdownDescription": "Enables the open_path command without any pre-configured scope."
},
{
"description": "Enables the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-open-url",
"markdownDescription": "Enables the open_url command without any pre-configured scope."
},
{
"description": "Enables the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:allow-reveal-item-in-dir",
"markdownDescription": "Enables the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "Denies the open_path command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-path",
"markdownDescription": "Denies the open_path command without any pre-configured scope."
},
{
"description": "Denies the open_url command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-open-url",
"markdownDescription": "Denies the open_url command without any pre-configured scope."
},
{
"description": "Denies the reveal_item_in_dir command without any pre-configured scope.",
"type": "string",
"const": "opener:deny-reveal-item-in-dir",
"markdownDescription": "Denies the reveal_item_in_dir command without any pre-configured scope."
},
{
"description": "This permission set configures which\nshell functionality is exposed by default.\n\n#### Granted Permissions\n\nIt allows to use the `open` functionality with a reasonable\nscope pre-configured. It will allow opening `http(s)://`,\n`tel:` and `mailto:` links.\n\n#### This default permission set includes:\n\n- `allow-open`",
"type": "string",
@@ -6158,6 +6374,23 @@
}
]
},
"Application": {
"description": "Opener scope application.",
"anyOf": [
{
"description": "Open in default application.",
"type": "null"
},
{
"description": "If true, allow open with any application.",
"type": "boolean"
},
{
"description": "Allow specific application to open with.",
"type": "string"
}
]
},
"ShellScopeEntryAllowedArg": {
"description": "A command argument allowed to be executed by the webview API.",
"anyOf": [
+27 -7
View File
@@ -1,3 +1,6 @@
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use tauri::{
menu::{Menu, MenuItem},
tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
@@ -19,11 +22,20 @@ fn read_from_file(path: String) -> Result<String, String> {
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// Flag that signals the user has requested a full quit (via tray menu).
// When false, closing the window hides it to the tray; when true,
// the app is allowed to exit.
let quitting = Arc::new(AtomicBool::new(false));
let quitting_menu = quitting.clone();
let quitting_window = quitting.clone();
let quitting_run = quitting.clone();
tauri::Builder::default()
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_shell::init())
.setup(|app| {
.setup(move |app| {
let show = MenuItem::with_id(app, "show", "Show YTDescGen", true, None::<&str>)?;
let quit = MenuItem::with_id(app, "quit", "Quit", true, None::<&str>)?;
let menu = Menu::with_items(app, &[&show, &quit])?;
@@ -31,7 +43,7 @@ pub fn run() {
let _tray = TrayIconBuilder::with_id("ytdescgen-tray")
.tooltip("YTDescGen — YouTube Description Generator")
.menu(&menu)
.on_menu_event(|app, event| match event.id.as_ref() {
.on_menu_event(move |app, event| match event.id.as_ref() {
"show" => {
if let Some(window) = app.get_webview_window("main") {
let _ = window.show();
@@ -40,6 +52,7 @@ pub fn run() {
}
}
"quit" => {
quitting_menu.store(true, Ordering::SeqCst);
app.exit(0);
}
_ => {}
@@ -63,18 +76,25 @@ pub fn run() {
Ok(())
})
.on_window_event(|window, event| {
.on_window_event(move |window, event| {
if let WindowEvent::CloseRequested { api, .. } = event {
let _ = window.hide();
api.prevent_close();
// If the user asked to quit via the tray menu, let the
// window close normally so the app can exit.
if !quitting_window.load(Ordering::SeqCst) {
let _ = window.hide();
api.prevent_close();
}
}
})
.invoke_handler(tauri::generate_handler![save_to_file, read_from_file])
.build(tauri::generate_context!())
.expect("error while building tauri application")
.run(|_app_handle, event| {
.run(move |_app_handle, event| {
if let RunEvent::ExitRequested { api, .. } = event {
api.prevent_exit();
// Only prevent exit when the user hasn't explicitly asked to quit.
if !quitting_run.load(Ordering::SeqCst) {
api.prevent_exit();
}
}
});
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
"productName": "YTDescGen",
"version": "0.2.0",
"version": "0.9.0",
"identifier": "com.skullmute.ytdescgen",
"build": {
"beforeBuildCommand": "npm run build",
@@ -0,0 +1,82 @@
import { useTranslation } from "react-i18next";
import { Select } from "@components/ui/Select";
import { Input } from "@components/ui/Input";
import { ChipGroup } from "@components/ui/ChipGroup";
import { useEditorStore } from "@store/editor-store";
import {
PLAYTHROUGH_STATUSES,
DIFFICULTY_LEVELS,
CONTENT_WARNINGS,
type PlaythroughStatus,
type DifficultyLevel,
type ContentWarning,
} from "@engine/types";
/**
* Metadata that tells viewers "what kind of run is this and is it safe
* to watch". Lives in the Content Details accordion alongside
* timestamps + spoiler/mature toggles because all four are about
* framing, not about the capture itself.
*
* Design notes:
* - Playthrough + Difficulty default to `"none"`, which renders as "(no
* value)" in the select and suppresses the section in the generated
* description. Makes "no opinion" explicit rather than ambiguous.
* - The custom-difficulty input only appears when the creator picks
* `"custom"` — free-form text is intentionally not translated, so
* game-specific names like "Lethal" or "Blueberry" survive a locale
* switch unchanged.
* - Content warnings use the existing ChipGroup multi-select, capped at
* the full set (no `max` prop — every warning is additive).
*/
export function ContentDetailsForm() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const playthroughOptions = PLAYTHROUGH_STATUSES.map((id) => ({
value: id,
label: t(`editor.playthroughOptions.${id}`),
}));
const difficultyOptions = DIFFICULTY_LEVELS.map((id) => ({
value: id,
label: t(`editor.difficultyOptions.${id}`),
}));
const contentWarningOptions = CONTENT_WARNINGS.map((id) => ({
id,
label: t(`editor.contentWarningOptions.${id}`),
}));
return (
<div className="flex flex-col gap-3">
<Select
label={t("editor.playthrough")}
options={playthroughOptions}
value={store.playthroughStatus}
onChange={(v) => store.set("playthroughStatus", v as PlaythroughStatus)}
/>
<Select
label={t("editor.difficulty")}
options={difficultyOptions}
value={store.difficulty}
onChange={(v) => store.set("difficulty", v as DifficultyLevel)}
/>
{store.difficulty === "custom" && (
<Input
label={t("editor.difficultyCustomLabel")}
placeholder={t("editor.difficultyCustomPlaceholder")}
value={store.difficultyCustomLabel}
onChange={(e) => store.set("difficultyCustomLabel", e.target.value)}
/>
)}
<ChipGroup
label={t("editor.contentWarnings")}
multiple
options={contentWarningOptions}
value={store.contentWarnings}
onChange={(next) => store.set("contentWarnings", next as ContentWarning[])}
/>
</div>
);
}
+146
View File
@@ -0,0 +1,146 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { Textarea } from "@components/ui/Textarea";
import { VIDEO_TYPES } from "@config/video-types";
import {
GACHA_QUEST_TYPE_GROUPS,
type GachaQuestType,
} from "@config/gacha-quest-types";
import { useEditorStore } from "@store/editor-store";
/**
* Renders inputs for the extra fields required by the currently selected
* video type — e.g. "Part Number" for `part`, "Boss Name" for `boss`,
* "Mod Name" for `mods`. Returns null when the video type has no extras,
* so the caller doesn't have to conditionally render.
*/
export function ExtraFieldsInput() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const currentVideoType = VIDEO_TYPES.find((vt) => vt.id === store.videoType);
const extraFields: readonly string[] = currentVideoType?.extraFields ?? [];
if (extraFields.length === 0) return null;
return (
<div className="flex flex-col gap-3">
{extraFields.includes("gachaQuestType") && (
<div className="flex flex-col gap-1">
<label
htmlFor="gacha-quest-type"
className="text-sm font-medium text-text-secondary"
>
{t("editor.gachaQuestType")}
</label>
<select
id="gacha-quest-type"
value={store.gachaQuestType ?? "main_story"}
onChange={(e) =>
store.set("gachaQuestType", e.target.value as GachaQuestType)
}
className="rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/50"
>
{GACHA_QUEST_TYPE_GROUPS.map((g) => (
<optgroup
key={g.group}
label={t(`editor.gachaQuestTypeGroups.${g.group}`)}
>
{g.members.map((m) => (
<option key={m} value={m}>
{t(`editor.gachaQuestTypeOptions.${m}`)}
</option>
))}
</optgroup>
))}
</select>
</div>
)}
{extraFields.includes("chapterName") && (
<Input
label={t("editor.chapterName")}
placeholder={t("editor.chapterNamePlaceholder")}
value={store.chapterName ?? ""}
onChange={(e) => store.set("chapterName", e.target.value)}
/>
)}
{extraFields.includes("questName") && (
<Input
label={t("editor.questName")}
placeholder={t("editor.questNamePlaceholder")}
value={store.questName ?? ""}
onChange={(e) => store.set("questName", e.target.value)}
/>
)}
{extraFields.includes("partNumber") && (
<Input
label={t("editor.partNumber")}
placeholder={t("editor.partNumberPlaceholder")}
value={store.partNumber ?? ""}
onChange={(e) => store.set("partNumber", e.target.value)}
/>
)}
{extraFields.includes("bossName") && (
<Input
label={t("editor.bossName")}
placeholder={t("editor.bossNamePlaceholder")}
value={store.bossName ?? ""}
onChange={(e) => store.set("bossName", e.target.value)}
/>
)}
{extraFields.includes("dlcName") && (
<Input
label={t("editor.dlcName")}
placeholder={t("editor.dlcNamePlaceholder")}
value={store.dlcName ?? ""}
onChange={(e) => store.set("dlcName", e.target.value)}
/>
)}
{extraFields.includes("challengeName") && (
<Input
label={t("editor.challengeName")}
placeholder={t("editor.challengeNamePlaceholder")}
value={store.challengeName ?? ""}
onChange={(e) => store.set("challengeName", e.target.value)}
/>
)}
{extraFields.includes("modName") && (
<>
<Input
label={t("editor.modName")}
placeholder={t("editor.modNamePlaceholder")}
value={store.modName ?? ""}
onChange={(e) => store.set("modName", e.target.value)}
/>
<Textarea
label={t("editor.modList")}
placeholder={t("editor.modListPlaceholder")}
value={store.modList ?? ""}
onChange={(e) => store.set("modList", e.target.value)}
rows={5}
/>
</>
)}
{extraFields.includes("liveUrl") && (
<Input
label={t("editor.liveUrl")}
placeholder={t("editor.liveUrlPlaceholder")}
value={store.liveUrl ?? ""}
onChange={(e) => store.set("liveUrl", e.target.value)}
/>
)}
{extraFields.includes("scheduledTime") && (
<div className="flex flex-col gap-1">
<label className="text-sm font-medium text-text-secondary">
{t("editor.scheduledTime")}
</label>
<input
type="datetime-local"
value={store.scheduledTime ?? ""}
onChange={(e) => store.set("scheduledTime", e.target.value)}
className="rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/50"
/>
</div>
)}
</div>
);
}
+5 -36
View File
@@ -2,16 +2,17 @@ import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { Select } from "@components/ui/Select";
import { PLATFORMS } from "@config/platforms";
import { VIDEO_TYPES } from "@config/video-types";
import { useEditorStore } from "@store/editor-store";
/**
* Core identity fields for the video (game name, channel, platform).
* Video-type-specific extra fields (partNumber, bossName, …) live in
* ExtraFieldsInput so they group with the video-type picker.
*/
export function GameInfoForm() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const currentVideoType = VIDEO_TYPES.find((vt) => vt.id === store.videoType);
const extraFields: readonly string[] = currentVideoType?.extraFields ?? [];
const platformOptions = PLATFORMS.map((p) => ({ value: p.id, label: p.label }));
return (
@@ -34,38 +35,6 @@ export function GameInfoForm() {
value={store.platform}
onChange={(v) => store.set("platform", v)}
/>
{extraFields.includes("partNumber") && (
<Input
label={t("editor.partNumber")}
placeholder={t("editor.partNumberPlaceholder")}
value={store.partNumber ?? ""}
onChange={(e) => store.set("partNumber", e.target.value)}
/>
)}
{extraFields.includes("bossName") && (
<Input
label={t("editor.bossName")}
placeholder={t("editor.bossNamePlaceholder")}
value={store.bossName ?? ""}
onChange={(e) => store.set("bossName", e.target.value)}
/>
)}
{extraFields.includes("dlcName") && (
<Input
label={t("editor.dlcName")}
placeholder={t("editor.dlcNamePlaceholder")}
value={store.dlcName ?? ""}
onChange={(e) => store.set("dlcName", e.target.value)}
/>
)}
{extraFields.includes("challengeName") && (
<Input
label={t("editor.challengeName")}
placeholder={t("editor.challengeNamePlaceholder")}
value={store.challengeName ?? ""}
onChange={(e) => store.set("challengeName", e.target.value)}
/>
)}
</div>
);
}
+111 -13
View File
@@ -1,25 +1,123 @@
import { useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { ChipGroup } from "@components/ui/ChipGroup";
import { GENRES } from "@config/genres";
import {
GENRES,
GENRE_GROUPS,
GENRE_GROUP_IDS,
type GenreGroupId,
} from "@config/genres";
import { GENRES_WITHOUT_GRAPHICS_SETTINGS } from "@config/graphics-settings";
import { useEditorStore } from "@store/editor-store";
import { MAX_GENRES, type Genre } from "@engine/types";
export function GenreSelector() {
const { t } = useTranslation("ui");
const genre = useEditorStore((s) => s.genre);
const genres = useEditorStore((s) => s.genres);
const skipGraphicsSettings = useEditorStore((s) => s.skipGraphicsSettings);
const set = useEditorStore((s) => s.set);
// Session-local dismissal so the hint doesn't keep popping up after the
// user has chosen "Keep". Forgets across reloads, which is fine — a
// creator who flips back-and-forth between visual-novel and other genres
// benefits from being reminded once per session.
const [hintDismissed, setHintDismissed] = useState(false);
const [filter, setFilter] = useState("");
const options = GENRES.map((g) => ({
id: g.id,
label: t(g.labelKey),
icon: g.icon,
}));
const allOptions = useMemo(
() =>
GENRES.map((g) => ({
id: g.id,
label: t(g.labelKey),
icon: g.icon,
})),
[t],
);
const visibleOptions = useMemo(() => {
const trimmed = filter.trim().toLowerCase();
if (!trimmed) return allOptions;
return allOptions.filter((o) => o.label.toLowerCase().includes(trimmed));
}, [allOptions, filter]);
const matchingGenre = genres.find((g) =>
(GENRES_WITHOUT_GRAPHICS_SETTINGS as readonly string[]).includes(g),
);
const showHint = !!matchingGenre && !skipGraphicsSettings && !hintDismissed;
const applyGroup = (groupId: GenreGroupId) => {
const next = GENRE_GROUPS[groupId].slice(0, MAX_GENRES) as Genre[];
set("genres", next);
// Clear the filter so the user can see the newly-selected chips
// light up — otherwise a stale filter could hide them all.
setFilter("");
};
return (
<ChipGroup
label={t("editor.genre")}
options={options}
value={genre}
onChange={(v) => set("genre", v as typeof genre)}
/>
<div className="flex flex-col gap-2">
<div className="flex flex-wrap items-center justify-between gap-2">
<span className="text-sm font-medium text-text-secondary">
{t("editor.genre")}
</span>
<span className="text-xs text-text-muted">
{genres.length}/{MAX_GENRES}
</span>
</div>
<div className="flex flex-wrap gap-2">
{GENRE_GROUP_IDS.map((groupId) => (
<button
key={groupId}
type="button"
onClick={() => applyGroup(groupId)}
className="rounded-lg border border-border bg-surface-1 px-2.5 py-1 text-xs font-medium text-text-secondary transition-colors hover:border-accent hover:text-text-primary"
>
{t(`editor.genreGroups.${groupId}`)}
</button>
))}
</div>
<input
type="text"
value={filter}
onChange={(e) => setFilter(e.target.value)}
placeholder={t("editor.genreSearchPlaceholder")}
className="rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/50"
/>
{visibleOptions.length === 0 ? (
<p className="py-2 text-sm text-text-muted">
{t("editor.genreSearchNoResults")}
</p>
) : (
<ChipGroup
multiple
max={MAX_GENRES}
options={visibleOptions}
value={genres}
onChange={(next) => set("genres", next as Genre[])}
/>
)}
{showHint && (
<div className="flex items-center justify-between gap-3 rounded-lg border border-accent/40 bg-accent/5 px-3 py-2 text-xs text-text-secondary">
<span>{t("editor.skipGraphicsHintLabel")}</span>
<div className="flex shrink-0 gap-2">
<button
type="button"
className="rounded bg-accent px-2 py-1 font-medium text-white"
onClick={() => {
set("skipGraphicsSettings", true);
setHintDismissed(true);
}}
>
{t("editor.skipGraphicsHintHide")}
</button>
<button
type="button"
className="rounded px-2 py-1 font-medium text-text-secondary hover:bg-surface-2"
onClick={() => setHintDismissed(true)}
>
{t("editor.skipGraphicsHintKeep")}
</button>
</div>
</div>
)}
</div>
);
}
@@ -0,0 +1,23 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Music / sound attribution credit. When non-empty, the engine adds a
* "🎵 MUSIC / SOUND" section to the generated description.
*/
export function MusicAttributionEditor() {
const { t } = useTranslation("ui");
const musicAttribution = useEditorStore((s) => s.musicAttribution);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.musicAttribution")}
placeholder={t("editor.musicAttributionPlaceholder")}
value={musicAttribution ?? ""}
onChange={(e) => set("musicAttribution", e.target.value)}
rows={3}
/>
);
}
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Template for the pinned comment a creator posts under their own
* video. Lives outside the description so the creator can paste it
* directly into YouTube's comment box.
*/
export function PinnedCommentEditor() {
const { t } = useTranslation("ui");
const pinnedComment = useEditorStore((s) => s.pinnedComment);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.pinnedComment")}
placeholder={t("editor.pinnedCommentPlaceholder")}
value={pinnedComment ?? ""}
onChange={(e) => set("pinnedComment", e.target.value)}
rows={3}
/>
);
}
+41 -9
View File
@@ -1,5 +1,6 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { Select } from "@components/ui/Select";
import { RIG_FIELDS } from "@config/rig-fields";
import { useEditorStore } from "@store/editor-store";
@@ -12,15 +13,46 @@ export function RigEditor() {
<div className="flex flex-col gap-3">
<span className="text-sm font-medium text-text-secondary">{t("editor.rig")}</span>
<div className="grid grid-cols-2 gap-2">
{RIG_FIELDS.map((field) => (
<Input
key={field.id}
label={t(field.labelKey)}
placeholder={field.placeholder}
value={rig[field.id] ?? ""}
onChange={(e) => setNested("rig", field.id, e.target.value)}
/>
))}
{RIG_FIELDS.map((field) => {
if (field.type === "dropdown_with_version") {
const raw = rig[field.id] ?? "";
const [value = "", version = ""] = raw.split("|");
const commit = (nextValue: string, nextVersion: string) => {
// Keep the stored form compact: drop the pipe when empty.
const next =
!nextValue && !nextVersion ? "" : `${nextValue}|${nextVersion}`;
setNested("rig", field.id, next);
};
return (
<div key={field.id} className="col-span-2 grid grid-cols-[1fr_auto] gap-2">
<Select
label={t(field.labelKey)}
value={value}
options={field.options ?? []}
onChange={(v) => commit(v, version)}
/>
<Input
label={t("editor.version")}
placeholder={field.versionPlaceholder}
value={version}
onChange={(e) => commit(value, e.target.value)}
/>
</div>
);
}
return (
<Input
key={field.id}
label={t(field.labelKey)}
placeholder={field.placeholder}
value={rig[field.id] ?? ""}
onChange={(e) => setNested("rig", field.id, e.target.value)}
/>
);
})}
</div>
</div>
);
@@ -0,0 +1,32 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { useEditorStore } from "@store/editor-store";
/**
* Publisher/developer + platform pair for the "🎁 Thanks to …" credit
* line. Rendered in the description only when the Settings toggle
* `showSponsorCredit` is on AND both inputs are non-empty.
*/
export function SponsorCreditEditor() {
const { t } = useTranslation("ui");
const sponsorName = useEditorStore((s) => s.sponsorName);
const sponsorPlatform = useEditorStore((s) => s.sponsorPlatform);
const set = useEditorStore((s) => s.set);
return (
<div className="flex flex-col gap-2">
<Input
label={t("editor.sponsorName")}
placeholder={t("editor.sponsorNamePlaceholder")}
value={sponsorName ?? ""}
onChange={(e) => set("sponsorName", e.target.value)}
/>
<Input
label={t("editor.sponsorPlatform")}
placeholder={t("editor.sponsorPlatformPlaceholder")}
value={sponsorPlatform ?? ""}
onChange={(e) => set("sponsorPlatform", e.target.value)}
/>
</div>
);
}
+141 -11
View File
@@ -1,28 +1,158 @@
import { useMemo, useState } from "react";
import type { ClipboardEvent } from "react";
import { useTranslation } from "react-i18next";
import toast from "react-hot-toast";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { Select } from "@components/ui/Select";
import { PLATFORMS } from "@config/platforms";
import { useEditorStore } from "@store/editor-store";
import { validateUrlWithPrefix } from "@utils/validation";
import { validateUrlWithPattern } from "@utils/validation";
import {
extractGameNameFromUrl,
isLinkNameMismatch,
} from "@utils/url-extractors";
import type { StoreLinkType } from "@engine/types";
const STORE_LINK_TYPE_VALUES: readonly StoreLinkType[] = ["paid", "free", "demo"];
interface MismatchInfo {
host: string;
suggestedName: string;
fingerprint: string;
}
export function StoreLinkEditor() {
const { t } = useTranslation("ui");
const storeLinks = useEditorStore((s) => s.storeLinks);
const storeLinkTypes = useEditorStore((s) => s.storeLinkTypes);
const gameName = useEditorStore((s) => s.gameName);
const setField = useEditorStore((s) => s.set);
const setNested = useEditorStore((s) => s.setNested);
const setStoreLinkType = useEditorStore((s) => s.setStoreLinkType);
const [dismissedFingerprints, setDismissedFingerprints] = useState<
ReadonlySet<string>
>(new Set());
const typeOptions = STORE_LINK_TYPE_VALUES.map((value) => ({
value,
label: t(`storeLinkTypes.${value}`),
}));
// Find the first store link whose extracted name doesn't fit the
// typed Game Name (subset-tolerant check). Iteration order is
// PLATFORMS order. Dismissed fingerprints are skipped so a chain of
// mismatches surfaces one at a time.
const mismatch = useMemo<MismatchInfo | null>(() => {
const trimmed = gameName.trim();
if (!trimmed) return null;
for (const platform of PLATFORMS) {
const url = (storeLinks[platform.id] ?? "").trim();
if (!url) continue;
if (!isLinkNameMismatch(trimmed, url)) continue;
const suggestedName = extractGameNameFromUrl(url);
if (!suggestedName) continue;
const fingerprint = `${trimmed}|${url}`;
if (dismissedFingerprints.has(fingerprint)) continue;
let host: string;
try {
host = new URL(url).host;
} catch {
continue;
}
return { host, suggestedName, fingerprint };
}
return null;
}, [gameName, storeLinks, dismissedFingerprints]);
// When a recognised store URL is pasted into any link input AND the
// Game Name field is still empty, auto-fill it from the URL slug. The
// toast carries an Undo action so a wrong guess is one click away from
// being reverted. Never overwrites a non-empty Game Name.
const handlePaste = (e: ClipboardEvent<HTMLInputElement>) => {
if (gameName.trim()) return;
const pasted = e.clipboardData.getData("text").trim();
if (!pasted) return;
const extracted = extractGameNameFromUrl(pasted);
if (!extracted) return;
setField("gameName", extracted);
toast.custom(
(item) => (
<div className="flex items-center gap-3 rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary shadow">
<span>{t("editor.toast.urlAutoFilled", { name: extracted })}</span>
<button
type="button"
className="rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-surface-1"
onClick={() => {
setField("gameName", "");
toast.dismiss(item.id);
}}
>
{t("common.undo")}
</button>
</div>
),
{ duration: 5000 },
);
};
return (
<div className="flex flex-col gap-3">
<span className="text-sm font-medium text-text-secondary">{t("editor.storeLinks")}</span>
{mismatch && (
<div className="flex items-start gap-2 rounded-lg border border-warning bg-surface-2 px-3 py-2 text-sm">
<span className="flex-1 text-text-primary">
{t("editor.warning.linkNameMismatch", {
host: mismatch.host,
suggestedName: mismatch.suggestedName,
gameName: gameName.trim(),
})}
</span>
<button
type="button"
aria-label={t("common.dismiss")}
className="shrink-0 rounded px-2 py-0.5 text-base leading-none text-text-secondary hover:bg-surface-1"
onClick={() =>
setDismissedFingerprints((prev) => {
const next = new Set(prev);
next.add(mismatch.fingerprint);
return next;
})
}
>
×
</button>
</div>
)}
<div className="flex flex-col gap-2">
{PLATFORMS.map((platform) => (
<ValidatedInput
key={platform.id}
label={platform.label}
placeholder={platform.urlPrefix}
value={storeLinks[platform.id] ?? ""}
onChange={(v) => setNested("storeLinks", platform.id, v)}
validate={(v) => validateUrlWithPrefix(v, platform.urlPrefix)}
/>
))}
{PLATFORMS.map((platform) => {
const currentType = storeLinkTypes[platform.id] ?? "paid";
return (
<div
key={platform.id}
className="grid grid-cols-[1fr_9rem] items-end gap-2"
>
<ValidatedInput
label={platform.label}
placeholder={platform.urlPrefix}
value={storeLinks[platform.id] ?? ""}
onChange={(v) => {
const final = v && platform.normalize ? platform.normalize(v) : v;
setNested("storeLinks", platform.id, final);
}}
validate={(v) => validateUrlWithPattern(v, platform.urlPattern)}
onPaste={handlePaste}
/>
<Select
label={t("editor.storeLinkType")}
value={currentType}
options={typeOptions}
onChange={(v) => setStoreLinkType(platform.id, v as StoreLinkType)}
/>
</div>
);
})}
</div>
</div>
);
+24
View File
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { Textarea } from "@components/ui/Textarea";
import { useEditorStore } from "@store/editor-store";
/**
* Free-form draft for the thumbnail text overlay. Never lands in the
* generated description — stored only so the creator (or a collaborating
* designer) can copy it separately.
*/
export function ThumbnailHelper() {
const { t } = useTranslation("ui");
const thumbnailText = useEditorStore((s) => s.thumbnailText);
const set = useEditorStore((s) => s.set);
return (
<Textarea
label={t("editor.thumbnailText")}
placeholder={t("editor.thumbnailTextPlaceholder")}
value={thumbnailText ?? ""}
onChange={(e) => set("thumbnailText", e.target.value)}
rows={2}
/>
);
}
+116 -4
View File
@@ -1,7 +1,23 @@
import { useTranslation } from "react-i18next";
import { Select } from "@components/ui/Select";
import { Input } from "@components/ui/Input";
import { ChipGroup } from "@components/ui/ChipGroup";
import { Toggle } from "@components/ui/Toggle";
import { useEditorStore } from "@store/editor-store";
import {
GRAPHICS_PRESETS,
RT_MODES,
FRAMEGEN_VENDORS,
FRAMEGEN_MULTIPLIERS,
UPSCALE_QUALITIES,
ART_STYLES,
type GraphicsPreset,
type RTMode,
type FrameGenVendor,
type FrameGenMultiplier,
type UpscaleQuality,
type ArtStyle,
} from "@config/graphics-settings";
const RESOLUTION_OPTIONS = [
{ value: "720p", label: "720p" },
@@ -21,9 +37,40 @@ export function VideoSettingsForm() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const presetOptions = GRAPHICS_PRESETS.map((p) => ({
value: p,
label: t(`editor.graphicsPresetOptions.${p}`),
}));
const rtChipOptions = RT_MODES.map((m) => ({
id: m,
label: t(`editor.rtOptions.${m}`),
}));
const vendorOptions = FRAMEGEN_VENDORS.map((v) => ({
value: v,
label: t(`editor.frameGenVendorOptions.${v}`),
}));
const multiplierOptions = FRAMEGEN_MULTIPLIERS.map((m) => ({
value: m,
label: t(`editor.frameGenMultiplierOptions.${m}`),
}));
const upscaleOptions = UPSCALE_QUALITIES.map((q) => ({
value: q,
label: t(`editor.upscaleQualityOptions.${q}`),
}));
const artStyleOptions = ART_STYLES.map((s) => ({
value: s,
label: t(`editor.artStyleOptions.${s}`),
}));
return (
<div className="flex flex-col gap-3">
<span className="text-sm font-medium text-text-secondary">{t("editor.videoSettings")}</span>
<div className="grid grid-cols-3 gap-3">
<Select
label={t("editor.resolution")}
@@ -37,13 +84,78 @@ export function VideoSettingsForm() {
value={store.fps ?? "60"}
onChange={(v) => store.set("fps", v)}
/>
<Input
<Select
label={t("editor.graphicsPreset")}
placeholder="Ultra"
value={store.graphicsPreset ?? ""}
onChange={(e) => store.set("graphicsPreset", e.target.value)}
options={presetOptions}
value={store.graphicsPreset}
onChange={(v) => store.set("graphicsPreset", v as GraphicsPreset)}
/>
</div>
{store.graphicsPreset === "custom" && (
<Input
label={t("editor.graphicsPresetCustom")}
placeholder={t("editor.graphicsPresetCustomPlaceholder")}
value={store.graphicsPresetCustom}
onChange={(e) => store.set("graphicsPresetCustom", e.target.value)}
/>
)}
<Toggle
label={t("editor.skipGraphicsSettings")}
checked={store.skipGraphicsSettings}
onChange={(v) => store.set("skipGraphicsSettings", v)}
/>
<p className="-mt-1 text-xs text-text-muted">{t("editor.skipGraphicsSettingsHelp")}</p>
{!store.skipGraphicsSettings && (
<>
<ChipGroup
label={t("editor.rayTracing")}
multiple
options={rtChipOptions}
value={store.rayTracingModes}
onChange={(next) => store.set("rayTracingModes", next as RTMode[])}
/>
<div className="grid grid-cols-2 gap-3">
<Select
label={t("editor.frameGenVendor")}
options={vendorOptions}
value={store.frameGenVendor}
onChange={(v) => store.set("frameGenVendor", v as FrameGenVendor)}
/>
<Select
label={t("editor.frameGenMultiplier")}
options={multiplierOptions}
value={store.frameGenMultiplier}
onChange={(v) => store.set("frameGenMultiplier", v as FrameGenMultiplier)}
/>
</div>
<div className="grid grid-cols-2 gap-3">
<Select
label={t("editor.upscaleQuality")}
options={upscaleOptions}
value={store.upscaleQuality}
onChange={(v) => store.set("upscaleQuality", v as UpscaleQuality)}
/>
<Select
label={t("editor.artStyle")}
options={artStyleOptions}
value={store.artStyle}
onChange={(v) => store.set("artStyle", v as ArtStyle)}
/>
</div>
<Input
label={t("editor.versionInfo")}
placeholder={t("editor.versionInfoPlaceholder")}
value={store.versionInfo}
onChange={(e) => store.set("versionInfo", e.target.value)}
/>
</>
)}
</div>
);
}
@@ -0,0 +1,68 @@
import { useTranslation } from "react-i18next";
import { Input } from "@components/ui/Input";
import { useEditorStore } from "@store/editor-store";
/**
* Vietnam-specific donate fields — bank transfer + e-wallets. The
* `🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ` description block only renders when
* the output language is Vietnamese, so the help text below the section
* label flags that condition for creators who occasionally publish in
* English / Japanese / etc.
*
* The fields are always visible in the editor regardless of the active
* output language — we don't want creators to have to flip language
* just to fill in their bank info, and the data is preserved in the
* draft either way.
*/
export function VietnameseDonateEditor() {
const { t } = useTranslation("ui");
const store = useEditorStore();
return (
<div className="flex flex-col gap-3">
<div className="flex flex-col gap-1">
<span className="text-sm font-medium text-text-secondary">
{t("editor.vnDonate")}
</span>
<p className="text-xs text-text-muted">{t("editor.vnDonateHelp")}</p>
</div>
<div className="grid grid-cols-2 gap-3">
<Input
label={t("editor.vnBankName")}
placeholder={t("editor.vnBankNamePlaceholder")}
value={store.vnBankName ?? ""}
onChange={(e) => store.set("vnBankName", e.target.value)}
/>
<Input
label={t("editor.vnBankAccount")}
placeholder={t("editor.vnBankAccountPlaceholder")}
value={store.vnBankAccount ?? ""}
onChange={(e) => store.set("vnBankAccount", e.target.value)}
/>
</div>
<Input
label={t("editor.vnBankHolder")}
placeholder={t("editor.vnBankHolderPlaceholder")}
value={store.vnBankHolder ?? ""}
onChange={(e) => store.set("vnBankHolder", e.target.value)}
/>
<div className="grid grid-cols-2 gap-3">
<Input
label={t("editor.vnMomo")}
placeholder={t("editor.vnMomoPlaceholder")}
value={store.vnMomo ?? ""}
onChange={(e) => store.set("vnMomo", e.target.value)}
/>
<Input
label={t("editor.vnZalopay")}
placeholder={t("editor.vnZalopayPlaceholder")}
value={store.vnZalopay ?? ""}
onChange={(e) => store.set("vnZalopay", e.target.value)}
/>
</div>
</div>
);
}
+11 -2
View File
@@ -6,14 +6,23 @@ interface CharCounterProps {
limit: number;
}
/**
* Thresholds follow the v0.5 spec:
* - ≥100 %: red (over limit — YouTube will refuse the string).
* - ≥80 %: yellow (close enough that the user should glance).
* - else: muted grey.
*/
export function CharCounter({ text, limit }: CharCounterProps) {
const { count, isOver, percentage } = useCharCount(text, limit);
const isWarning = !isOver && percentage >= 80;
return (
<span
className={clsx(
"text-xs font-mono",
isOver ? "text-danger" : percentage > 80 ? "text-warning" : "text-text-muted",
"text-xs font-mono font-semibold transition-colors",
isOver && "text-danger",
isWarning && "text-warning",
!isOver && !isWarning && "text-text-muted font-normal",
)}
>
{count}/{limit}
+117
View File
@@ -0,0 +1,117 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import i18n from "i18next";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { useCurrentGeneratorInput } from "@hooks/use-current-generator-input";
import { buildPinnedComment } from "@engine/pinned-comment-builder";
import { GENRES } from "@config/genres";
import type { Genre } from "@engine/types";
import { CopyButton } from "./CopyButton";
/**
* Renders the non-description artefacts on the Output page:
* 1. Thumbnail text (creator's free-form idea / copy for the thumbnail)
* 2. Pinned comment — creator's free-form draft
* 3. Pinned comment TEMPLATE — engine-generated, opt-in via Settings
*
* (1) and (2) stay outside the description because they get pasted into
* different YouTube surfaces. (3) is independent from (2) by design:
* creators can copy the template AND keep their freeform draft side by
* side without either overriding the other.
*/
export function OutputExtras() {
const { t } = useTranslation("ui");
const thumbnailText = useEditorStore((s) => s.thumbnailText);
const pinnedComment = useEditorStore((s) => s.pinnedComment);
const showPinnedCommentTemplate = useSettingsStore((s) => s.showPinnedCommentTemplate);
const includeAskNextGame = useSettingsStore((s) => s.pinnedCommentIncludeAskNextGame);
const includeGenrePlaylist = useSettingsStore(
(s) => s.pinnedCommentIncludeGenrePlaylist,
);
const genrePlaylists = useSettingsStore((s) => s.genrePlaylists);
const input = useCurrentGeneratorInput();
// Resolve genre labels via the UI-namespace translator. The pinned-comment
// builder is config-free by design — labels come in pre-resolved.
const genreLabels = useMemo(() => {
const map: Partial<Record<Genre, string>> = {};
for (const g of GENRES) map[g.id as Genre] = t(g.labelKey);
return map;
}, [t]);
const templateText = useMemo(() => {
if (!showPinnedCommentTemplate) return "";
const tFn = i18n.getFixedT(input.language, "templates");
return buildPinnedComment(input, tFn, {
includeAskNextGame,
includeGenrePlaylist,
genrePlaylists,
genreLabels,
});
}, [
showPinnedCommentTemplate,
input,
includeAskNextGame,
includeGenrePlaylist,
genrePlaylists,
genreLabels,
]);
const hasThumbnail = thumbnailText && thumbnailText.trim() !== "";
const hasPinned = pinnedComment && pinnedComment.trim() !== "";
const hasTemplate = templateText.trim() !== "";
if (!hasThumbnail && !hasPinned && !hasTemplate) return null;
return (
<div className="flex flex-col gap-6">
{hasThumbnail && (
<section className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-text-primary">
{t("output.thumbnailText")}
</h3>
<CopyButton text={thumbnailText} label={t("output.copyThumbnailText")} />
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
{thumbnailText}
</pre>
</div>
</section>
)}
{hasPinned && (
<section className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-text-primary">
{t("output.pinnedComment")}
</h3>
<CopyButton text={pinnedComment} label={t("output.copyPinnedComment")} />
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
{pinnedComment}
</pre>
</div>
</section>
)}
{hasTemplate && (
<section className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-sm font-semibold text-text-primary">
{t("output.pinnedCommentTemplate")}
</h3>
<CopyButton text={templateText} label={t("output.copyPinnedCommentTemplate")} />
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<pre className="whitespace-pre-wrap font-sans text-sm text-text-secondary">
{templateText}
</pre>
</div>
</section>
)}
</div>
);
}
+100
View File
@@ -0,0 +1,100 @@
import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import i18n from "i18next";
import { Modal } from "@components/ui/Modal";
import { CopyButton } from "./CopyButton";
import { CharCounter } from "./CharCounter";
import { buildTitleVariants } from "@engine/title-variants";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { YT_LIMITS, type GeneratorInput } from "@engine/types";
interface VariantPickerProps {
open: boolean;
onClose: () => void;
}
/**
* Modal that shows 3 A/B-testable title variants for the current editor
* state. Generated fresh each time the modal opens — no state persists
* here because the titles are derived from the store.
*/
export function VariantPicker({ open, onClose }: VariantPickerProps) {
const { t } = useTranslation("ui");
const state = useEditorStore();
const showQualityBadge = useSettingsStore((s) => s.showQualityBadge);
const variants = useMemo(() => {
if (!open) return [];
const input: GeneratorInput = {
videoType: state.videoType,
language: state.language,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: state.partNumber,
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
modName: state.modName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
};
const tFn = i18n.getFixedT(state.language, "templates");
return buildTitleVariants(input, tFn, showQualityBadge);
}, [
open,
showQualityBadge,
state.videoType,
state.language,
state.genres,
state.gameName,
state.gameNameLocalized,
state.channelName,
state.platform,
state.partNumber,
state.bossName,
state.dlcName,
state.challengeName,
state.modName,
state.resolution,
state.fps,
state.graphicsPreset,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.social,
state.rig,
]);
return (
<Modal open={open} onClose={onClose} title={t("output.generateAlternatives")} className="max-w-2xl">
<div className="flex flex-col gap-4">
{variants.map((variant) => (
<section key={variant.id} className="flex flex-col gap-2">
<div className="flex items-center justify-between">
<h3 className="text-xs font-semibold uppercase tracking-wide text-text-muted">
{t(variant.labelKey)}
</h3>
<div className="flex items-center gap-3">
<CharCounter text={variant.title} limit={YT_LIMITS.TITLE_MAX} />
<CopyButton text={variant.title} label={t("output.copyTitle")} />
</div>
</div>
<div className="rounded-lg border border-border bg-surface-1 p-3">
<p className="text-sm font-medium text-text-primary">{variant.title}</p>
</div>
</section>
))}
</div>
</Modal>
);
}
+9 -7
View File
@@ -23,7 +23,7 @@ export function PresetCard({ preset }: PresetCardProps) {
loadPreset({
gameName: preset.gameName,
gameNameLocalized: preset.gameNameLocalized ? { ...preset.gameNameLocalized } : {},
genre: preset.genre,
genres: [...preset.genres],
platform: preset.platform,
storeLinks: { ...preset.storeLinks },
spoilerWarning: preset.spoilerWarning,
@@ -31,19 +31,21 @@ export function PresetCard({ preset }: PresetCardProps) {
});
};
const genre = GENRES.find((g) => g.id === preset.genre);
const genreDefs = preset.genres
.map((id) => GENRES.find((g) => g.id === id))
.filter((g): g is (typeof GENRES)[number] => g !== undefined);
return (
<>
<div className="flex items-center justify-between rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div className="flex-1">
<h3 className="text-sm font-semibold text-text-primary">{preset.gameName}</h3>
<div className="mt-1.5 flex items-center gap-2 text-xs text-text-muted">
{genre && (
<span className="rounded bg-surface-2 px-1.5 py-0.5">
{genre.icon} {t(genre.labelKey)}
<div className="mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-text-muted">
{genreDefs.map((g) => (
<span key={g.id} className="rounded bg-surface-2 px-1.5 py-0.5">
{g.icon} {t(g.labelKey)}
</span>
)}
))}
<span>{preset.platform}</span>
</div>
</div>
+1 -1
View File
@@ -23,7 +23,7 @@ export function PresetSaveForm({ open, onClose, editPreset }: PresetSaveFormProp
const data = {
gameName: gameName.trim() || "Unnamed Game",
gameNameLocalized: editPreset?.gameNameLocalized ?? { ...editor.gameNameLocalized },
genre: editPreset?.genre ?? editor.genre,
genres: editPreset?.genres ?? [...editor.genres],
platform: editPreset?.platform ?? editor.platform,
storeLinks: editPreset?.storeLinks ?? { ...editor.storeLinks },
spoilerWarning: editPreset?.spoilerWarning ?? editor.spoilerWarning,
+1 -1
View File
@@ -22,7 +22,7 @@ export function PresetSelector() {
loadPreset({
gameName: preset.gameName,
gameNameLocalized: preset.gameNameLocalized ? { ...preset.gameNameLocalized } : {},
genre: preset.genre,
genres: [...preset.genres],
platform: preset.platform,
storeLinks: { ...preset.storeLinks },
spoilerWarning: preset.spoilerWarning,
+63
View File
@@ -0,0 +1,63 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Upload, Trash2 } from "lucide-react";
import { Button } from "@components/ui/Button";
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
import { useEditorStore } from "@store/editor-store";
import { useTemplateStore, type EditorTemplate } from "@store/template-store";
import toast from "react-hot-toast";
interface TemplateCardProps {
template: EditorTemplate;
}
export function TemplateCard({ template }: TemplateCardProps) {
const { t } = useTranslation("ui");
const loadProfile = useEditorStore((s) => s.loadProfile);
const deleteTemplate = useTemplateStore((s) => s.deleteTemplate);
const [showDelete, setShowDelete] = useState(false);
const handleApply = () => {
loadProfile(template.snapshot);
toast.success(t("templates.appliedToast", { name: template.name }));
};
const date = new Date(template.createdAt).toLocaleDateString();
return (
<>
<div className="flex items-center justify-between rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30">
<div className="flex-1">
<h3 className="text-sm font-semibold text-text-primary">{template.name}</h3>
<div className="mt-1.5 flex items-center gap-2 text-xs text-text-muted">
<span>{template.snapshot.gameName || "—"}</span>
<span>·</span>
<span>{date}</span>
</div>
</div>
<div className="flex items-center gap-1.5">
<Button variant="primary" size="sm" onClick={handleApply}>
<Upload className="h-3.5 w-3.5" />
{t("templates.loadTemplate")}
</Button>
<Button variant="ghost" size="sm" onClick={() => setShowDelete(true)}>
<Trash2 className="h-3.5 w-3.5 text-danger" />
</Button>
</div>
</div>
<ConfirmDialog
open={showDelete}
onConfirm={() => {
deleteTemplate(template.id);
setShowDelete(false);
}}
onCancel={() => setShowDelete(false)}
title={t("common.delete")}
message={t("templates.deleteConfirm")}
confirmLabel={t("common.delete")}
variant="danger"
/>
</>
);
}
+24
View File
@@ -0,0 +1,24 @@
import { useTranslation } from "react-i18next";
import { useTemplateStore } from "@store/template-store";
import { TemplateCard } from "./TemplateCard";
export function TemplateList() {
const { t } = useTranslation("ui");
const templates = useTemplateStore((s) => s.templates);
if (templates.length === 0) {
return (
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
{t("templates.emptyState")}
</p>
);
}
return (
<div className="flex flex-col gap-2">
{templates.map((template) => (
<TemplateCard key={template.id} template={template} />
))}
</div>
);
}
@@ -0,0 +1,110 @@
import { useState } from "react";
import { useTranslation } from "react-i18next";
import { Modal } from "@components/ui/Modal";
import { Button } from "@components/ui/Button";
import { Input } from "@components/ui/Input";
import { useEditorStore } from "@store/editor-store";
import { useTemplateStore, type TemplateSnapshot } from "@store/template-store";
import toast from "react-hot-toast";
interface TemplateSaveFormProps {
open: boolean;
onClose: () => void;
}
/**
* Prompts for a template name, then saves the entire editor form as a
* reusable snapshot. Leaves the editor state untouched.
*/
export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
const { t } = useTranslation("ui");
const editor = useEditorStore();
const addTemplate = useTemplateStore((s) => s.addTemplate);
const [name, setName] = useState("");
const handleSave = () => {
const snapshot: TemplateSnapshot = {
videoType: editor.videoType,
language: editor.language,
genres: [...editor.genres],
gameName: editor.gameName,
gameNameLocalized: { ...editor.gameNameLocalized },
channelName: editor.channelName,
platform: editor.platform,
partNumber: editor.partNumber,
bossName: editor.bossName,
dlcName: editor.dlcName,
challengeName: editor.challengeName,
modName: editor.modName,
modList: editor.modList,
liveUrl: editor.liveUrl,
scheduledTime: editor.scheduledTime,
gachaQuestType: editor.gachaQuestType,
chapterName: editor.chapterName,
questName: editor.questName,
resolution: editor.resolution,
fps: editor.fps,
graphicsPreset: editor.graphicsPreset,
graphicsPresetCustom: editor.graphicsPresetCustom,
skipGraphicsSettings: editor.skipGraphicsSettings,
rayTracingModes: [...editor.rayTracingModes],
frameGenVendor: editor.frameGenVendor,
frameGenMultiplier: editor.frameGenMultiplier,
upscaleQuality: editor.upscaleQuality,
artStyle: editor.artStyle,
versionInfo: editor.versionInfo,
timestamps: editor.timestamps,
playlistLink: editor.playlistLink,
contactEmail: editor.contactEmail,
musicAttribution: editor.musicAttribution,
thumbnailText: editor.thumbnailText,
pinnedComment: editor.pinnedComment,
spoilerWarning: editor.spoilerWarning,
matureWarning: editor.matureWarning,
playthroughStatus: editor.playthroughStatus,
difficulty: editor.difficulty,
difficultyCustomLabel: editor.difficultyCustomLabel,
contentWarnings: [...editor.contentWarnings],
storeLinks: { ...editor.storeLinks },
storeLinkTypes: { ...editor.storeLinkTypes },
social: { ...editor.social },
rig: { ...editor.rig },
vnBankName: editor.vnBankName,
vnBankAccount: editor.vnBankAccount,
vnBankHolder: editor.vnBankHolder,
vnMomo: editor.vnMomo,
vnZalopay: editor.vnZalopay,
};
addTemplate(name, snapshot);
toast.success(t("templates.savedAs", { name: name.trim() || "Untitled" }));
setName("");
onClose();
};
return (
<Modal
open={open}
onClose={onClose}
title={t("templates.saveAsTemplate")}
footer={
<>
<Button variant="ghost" onClick={onClose}>
{t("common.cancel")}
</Button>
<Button onClick={handleSave}>{t("common.save")}</Button>
</>
}
>
<div className="flex flex-col gap-3">
<Input
label={t("templates.templateName")}
placeholder={t("templates.templateNamePlaceholder")}
value={name}
onChange={(e) => setName(e.target.value)}
autoFocus
/>
<p className="text-xs text-text-muted">{t("templates.saveHint")}</p>
</div>
</Modal>
);
}
+72
View File
@@ -0,0 +1,72 @@
import { ChevronDown } from "lucide-react";
import type { ReactNode } from "react";
import clsx from "clsx";
interface AccordionProps {
/** Unique id for the section — used as React key in lists. */
id: string;
/** Header label. */
title: string;
/** Optional leading icon (emoji or single-char string). */
icon?: string;
/** Optional trailing badge — e.g. a count or status chip. */
badge?: ReactNode;
/** Controlled open state. */
open: boolean;
/** Called when the user clicks the header to toggle. */
onToggle: () => void;
children: ReactNode;
}
/**
* Single-section accordion. Controlled only — the parent decides which
* sections are open and persists that choice. Height animates via a
* grid-rows trick so content can be any height without measurement.
*/
export function Accordion({
id,
title,
icon,
badge,
open,
onToggle,
children,
}: AccordionProps) {
return (
<section
data-accordion-id={id}
className="overflow-hidden rounded-lg border border-border bg-surface-1"
>
<button
type="button"
onClick={onToggle}
aria-expanded={open}
className="flex w-full items-center justify-between gap-3 px-4 py-3 text-left transition-colors hover:bg-surface-2"
>
<div className="flex items-center gap-2">
{icon && <span className="text-base leading-none">{icon}</span>}
<span className="text-sm font-semibold text-text-primary">{title}</span>
{badge}
</div>
<ChevronDown
className={clsx(
"h-4 w-4 text-text-muted transition-transform duration-200",
open && "rotate-180",
)}
/>
</button>
<div
className={clsx(
"grid transition-[grid-template-rows] duration-200 ease-out",
open ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
)}
>
<div className="overflow-hidden">
<div className="flex flex-col gap-3 border-t border-border px-4 py-4">
{children}
</div>
</div>
</div>
</section>
);
}
+73 -21
View File
@@ -6,35 +6,87 @@ interface ChipOption {
icon?: string;
}
interface ChipGroupProps {
interface BaseProps {
label?: string;
options: readonly ChipOption[];
value: string;
onChange: (value: string) => void;
className?: string;
}
export function ChipGroup({ label, options, value, onChange, className }: ChipGroupProps) {
type SingleProps = BaseProps & {
multiple?: false;
value: string;
onChange: (value: string) => void;
};
type MultiProps = BaseProps & {
multiple: true;
/** Ordered list of selected option ids. */
value: readonly string[];
onChange: (value: string[]) => void;
/** Optional cap on total selections. When reached, unselected chips disable. */
max?: number;
};
export type ChipGroupProps = SingleProps | MultiProps;
export function ChipGroup(props: ChipGroupProps) {
const { label, options, className } = props;
const isSelected = (id: string): boolean => {
if (props.multiple) return props.value.includes(id);
return props.value === id;
};
const atCapacity = props.multiple && props.max != null && props.value.length >= props.max;
const handleClick = (id: string) => {
if (props.multiple) {
if (props.value.includes(id)) {
props.onChange(props.value.filter((v) => v !== id));
} else {
if (props.max != null && props.value.length >= props.max) return;
props.onChange([...props.value, id]);
}
} else {
props.onChange(id);
}
};
const counter =
props.multiple && props.max != null ? `${props.value.length}/${props.max}` : null;
return (
<div className={clsx("flex flex-col gap-2", className)}>
{label && <span className="text-sm font-medium text-text-secondary">{label}</span>}
{(label || counter) && (
<div className="flex items-center justify-between">
{label && <span className="text-sm font-medium text-text-secondary">{label}</span>}
{counter && <span className="text-xs text-text-muted">{counter}</span>}
</div>
)}
<div className="flex flex-wrap gap-2">
{options.map((option) => (
<button
key={option.id}
type="button"
onClick={() => onChange(option.id)}
className={clsx(
"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
value === option.id
? "bg-accent text-white"
: "bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary",
)}
>
{option.icon && <span>{option.icon}</span>}
{option.label}
</button>
))}
{options.map((option) => {
const selected = isSelected(option.id);
const disabled = !selected && atCapacity;
return (
<button
key={option.id}
type="button"
disabled={disabled}
onClick={() => handleClick(option.id)}
className={clsx(
"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selected
? "bg-accent text-white"
: disabled
? "cursor-not-allowed bg-surface-2 text-text-muted opacity-40"
: "bg-surface-2 text-text-secondary hover:bg-surface-3 hover:text-text-primary",
)}
>
{option.icon && <span>{option.icon}</span>}
{option.label}
</button>
);
})}
</div>
</div>
);
+49 -9
View File
@@ -1,3 +1,4 @@
import { useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { Modal } from "./Modal";
@@ -6,28 +7,67 @@ interface ShortcutHelpModalProps {
onClose: () => void;
}
const shortcuts = [
const SHORTCUTS = [
{ keys: "Ctrl + G", labelKey: "shortcuts.generate" },
{ keys: "Ctrl + Enter", labelKey: "shortcuts.generate" },
{ keys: "Ctrl + Shift + C", labelKey: "shortcuts.copyAll" },
{ keys: "Ctrl + S", labelKey: "shortcuts.saveDraft" },
{ keys: "Ctrl + /", labelKey: "shortcuts.help" },
{ keys: "?", labelKey: "shortcuts.help" },
{ keys: "Escape", labelKey: "shortcuts.close" },
] as const;
export function ShortcutHelpModal({ open, onClose }: ShortcutHelpModalProps) {
const { t } = useTranslation("ui");
const [query, setQuery] = useState("");
// Reset the filter every time the modal closes so a re-open starts
// fresh — otherwise the previous filter persists invisibly.
useEffect(() => {
if (!open) setQuery("");
}, [open]);
const filtered = useMemo(() => {
const trimmed = query.trim().toLowerCase();
if (!trimmed) return SHORTCUTS;
return SHORTCUTS.filter((s) => {
const label = t(s.labelKey).toLowerCase();
return label.includes(trimmed) || s.keys.toLowerCase().includes(trimmed);
});
}, [query, t]);
return (
<Modal open={open} onClose={onClose} title={t("shortcuts.title")}>
<div className="flex flex-col gap-2">
{shortcuts.map((s) => (
<div key={s.keys} className="flex items-center justify-between py-1">
<span className="text-sm text-text-secondary">{t(s.labelKey)}</span>
<kbd className="rounded bg-surface-2 px-2 py-0.5 font-mono text-xs text-text-primary">
{s.keys}
</kbd>
<div className="flex flex-col gap-3">
<input
type="text"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder={t("shortcuts.searchPlaceholder")}
className="rounded-lg border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/50"
autoFocus
/>
{filtered.length === 0 ? (
<p className="py-2 text-sm text-text-muted">
{t("shortcuts.noResults")}
</p>
) : (
<div className="flex flex-col gap-2">
{filtered.map((s) => (
<div
key={`${s.keys}-${s.labelKey}`}
className="flex items-center justify-between py-1"
>
<span className="text-sm text-text-secondary">
{t(s.labelKey)}
</span>
<kbd className="rounded bg-surface-2 px-2 py-0.5 font-mono text-xs text-text-primary">
{s.keys}
</kbd>
</div>
))}
</div>
))}
)}
</div>
</Modal>
);
+17 -2
View File
@@ -1,4 +1,4 @@
import { useState, useCallback } from "react";
import { useState, useCallback, type ClipboardEvent } from "react";
import { useTranslation } from "react-i18next";
import type { ValidationResult } from "@utils/validation";
import clsx from "clsx";
@@ -10,6 +10,13 @@ interface ValidatedInputProps {
validate: (value: string) => ValidationResult;
placeholder?: string;
helpText?: string;
/**
* Forwarded to the inner `<input>`. Used by StoreLinkEditor to sniff a
* pasted URL and auto-fill the Game Name field — see
* `extractGameNameFromUrl`. The handler runs alongside the normal paste
* flow; nothing here interferes with the value committed via onChange.
*/
onPaste?: (e: ClipboardEvent<HTMLInputElement>) => void;
}
export function ValidatedInput({
@@ -19,6 +26,7 @@ export function ValidatedInput({
validate,
placeholder,
helpText,
onPaste,
}: ValidatedInputProps) {
const { t } = useTranslation("ui");
const [displayValue, setDisplayValue] = useState(value);
@@ -30,14 +38,20 @@ export function ValidatedInput({
setDisplayValue(newValue);
const result = validate(newValue);
if (result.valid && !result.error) {
// Fully valid: commit the value to the store.
setError(null);
onChange(newValue);
} else if (result.valid && result.error) {
// Warning (valid but prefix mismatch)
// Warning (e.g. prefix mismatch from validateUrlWithPrefix).
// Surface the warning but still commit so the user can decide.
setError(t(result.error, result.errorParams as Record<string, string>));
onChange(newValue);
} else {
// Invalid: show the error and CLEAR the committed value so the
// bad input never reaches the generated description/tags. The
// local displayValue is preserved so the user can keep editing.
setError(t(result.error ?? "", result.errorParams as Record<string, string>));
onChange("");
}
setTouched(true);
},
@@ -52,6 +66,7 @@ export function ValidatedInput({
value={displayValue}
onChange={(e) => handleChange(e.target.value)}
onBlur={() => setTouched(true)}
onPaste={onPaste}
placeholder={placeholder}
className={clsx(
"rounded-lg border bg-surface-1 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50",
+90 -7
View File
@@ -1,11 +1,26 @@
import type { VideoTypeId } from "./video-types";
import type { GenreId } from "./genres";
import type { SupportedLanguage } from "@engine/types";
import type {
GraphicsPreset,
RTMode,
FrameGenVendor,
FrameGenMultiplier,
UpscaleQuality,
ArtStyle,
} from "./graphics-settings";
import { DEFAULT_GACHA_QUEST_TYPE, type GachaQuestType } from "./gacha-quest-types";
import type {
SupportedLanguage,
StoreLinkType,
PlaythroughStatus,
DifficultyLevel,
ContentWarning,
} from "@engine/types";
export interface EditorDefaults {
videoType: VideoTypeId;
language: SupportedLanguage;
genre: GenreId;
genres: GenreId[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
@@ -14,30 +29,68 @@ export interface EditorDefaults {
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
/** Long-form mod credit list (multi-line) — only rendered for `mods` videoType. */
modList: string;
/** Livestream-only: live URL on YouTube/Twitch. */
liveUrl: string;
/** Livestream-only: ISO scheduled datetime. */
scheduledTime: string;
/** Gacha-quest selected pattern (v0.9). */
gachaQuestType: GachaQuestType;
/** Gacha-quest chapter / story-arc label (free-form). */
chapterName: string;
/** Gacha-quest individual quest / event name (free-form). */
questName: string;
resolution: string;
fps: string;
graphicsPreset: string;
graphicsPreset: GraphicsPreset;
graphicsPresetCustom: string;
skipGraphicsSettings: boolean;
rayTracingModes: RTMode[];
frameGenVendor: FrameGenVendor;
frameGenMultiplier: FrameGenMultiplier;
upscaleQuality: UpscaleQuality;
artStyle: ArtStyle;
versionInfo: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
sponsorName: string;
sponsorPlatform: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
playthroughStatus: PlaythroughStatus;
difficulty: DifficultyLevel;
difficultyCustomLabel: string;
contentWarnings: ContentWarning[];
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
/** Vietnam-specific donate: bank transfer + e-wallet fields. Only
* rendered into the description when output language is Vietnamese. */
vnBankName: string;
vnBankAccount: string;
vnBankHolder: string;
vnMomo: string;
vnZalopay: string;
}
export interface SettingsDefaults {
theme: "dark" | "light";
defaultLanguage: string;
defaultGenre: GenreId;
defaultGenres: GenreId[];
}
export const DEFAULTS = {
editor: {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "",
gameNameLocalized: {},
channelName: "",
@@ -46,22 +99,52 @@ export const DEFAULTS = {
bossName: "",
dlcName: "",
challengeName: "",
modName: "",
modList: "",
liveUrl: "",
scheduledTime: "",
gachaQuestType: DEFAULT_GACHA_QUEST_TYPE,
chapterName: "",
questName: "",
resolution: "1080p",
fps: "60",
graphicsPreset: "Ultra",
graphicsPreset: "medium",
graphicsPresetCustom: "",
skipGraphicsSettings: false,
rayTracingModes: [],
frameGenVendor: "none",
frameGenMultiplier: "none",
upscaleQuality: "none",
artStyle: "none",
versionInfo: "",
timestamps: "",
playlistLink: "",
contactEmail: "",
musicAttribution: "",
sponsorName: "",
sponsorPlatform: "",
thumbnailText: "",
pinnedComment: "",
spoilerWarning: false,
matureWarning: false,
playthroughStatus: "none",
difficulty: "none",
difficultyCustomLabel: "",
contentWarnings: [],
storeLinks: {},
storeLinkTypes: {},
social: {},
rig: {},
vnBankName: "",
vnBankAccount: "",
vnBankHolder: "",
vnMomo: "",
vnZalopay: "",
} satisfies EditorDefaults,
settings: {
theme: "dark",
defaultLanguage: "en",
defaultGenre: "action",
defaultGenres: ["action"],
} satisfies SettingsDefaults,
} as const;
+116
View File
@@ -0,0 +1,116 @@
/**
* Gacha-game quest taxonomy (v0.9 phase 1). One literal union covering
* the 17 quest patterns we see across major gacha titles — Genshin,
* Honkai: Star Rail, Wuthering Waves, ZZZ, Honkai Impact 3rd, Reverse
* 1999, Nikke, Azur Lane, Granblue, etc. Game-specific names like
* "Archon Quest" (Genshin) or "Trailblaze Mission" (HSR) collapse into
* `main_story`; "Hangout" / "Agent Story" collapse into
* `companion_quest`; "Spiral Abyss" / "Memory of Chaos" / "Tower of
* Adversity" / "Shiyu Defense" all collapse into `endgame`.
*
* Order matters: this is also the dropdown rendering order in the
* editor, grouped by use case (story → events → tutorial/trial →
* endgame/multiplayer → showcase).
*/
export const GACHA_QUEST_TYPES = [
// Story (6)
"main_story",
"world_quest",
"side_quest",
"spinoff_quest",
"companion_quest",
"bond_quest",
// Events (4)
"event",
"anniversary",
"crossover",
"dating_event",
// Tutorial / Trial (3)
"tutorial_quest",
"guide_quest",
"trial_quest",
// Endgame / Multiplayer (3)
"endgame",
"coop",
"daily_commission",
// Showcase (1)
"showcase",
] as const;
export type GachaQuestType = (typeof GACHA_QUEST_TYPES)[number];
export const DEFAULT_GACHA_QUEST_TYPE: GachaQuestType = "main_story";
export type GachaQuestTypeGroup =
| "story"
| "events"
| "tutorial_trial"
| "endgame_multiplayer"
| "showcase";
/**
* Display-order grouping for the quest-type dropdown. Each group
* surfaces a small heading (i18n: `editor.gachaQuestTypeGroups.<id>`)
* above its members.
*/
export const GACHA_QUEST_TYPE_GROUPS: ReadonlyArray<{
group: GachaQuestTypeGroup;
members: readonly GachaQuestType[];
}> = [
{
group: "story",
members: [
"main_story",
"world_quest",
"side_quest",
"spinoff_quest",
"companion_quest",
"bond_quest",
],
},
{
group: "events",
members: ["event", "anniversary", "crossover", "dating_event"],
},
{
group: "tutorial_trial",
members: ["tutorial_quest", "guide_quest", "trial_quest"],
},
{
group: "endgame_multiplayer",
members: ["endgame", "coop", "daily_commission"],
},
{
group: "showcase",
members: ["showcase"],
},
];
/**
* `partNumber` rendering style per quest type. Title-builder consumes
* this to decide whether the title's part-suffix reads "Part N", "Day
* N", "Floor N", or is dropped entirely. The four values map to
* `title.gachaPartSuffix.{part|day|floor}` translation keys; `none`
* skips the suffix.
*/
export type GachaPartSuffixStyle = "part" | "day" | "floor" | "none";
export const GACHA_PART_SUFFIX_STYLES: Record<GachaQuestType, GachaPartSuffixStyle> = {
main_story: "part",
world_quest: "none",
side_quest: "none",
spinoff_quest: "none",
companion_quest: "none",
bond_quest: "none",
event: "none",
anniversary: "day",
crossover: "none",
dating_event: "none",
tutorial_quest: "none",
guide_quest: "none",
trial_quest: "none",
endgame: "floor",
coop: "none",
daily_commission: "day",
showcase: "none",
};
+46 -1
View File
@@ -1,14 +1,28 @@
export const GENRES = [
{ id: "action", labelKey: "genres.action", icon: "⚔️" },
{ id: "hack_slash", labelKey: "genres.hack_slash", icon: "🗡" },
{ id: "beatemup", labelKey: "genres.beatemup", icon: "👊" },
{ id: "platformer", labelKey: "genres.platformer", icon: "🦘" },
{ id: "horror", labelKey: "genres.horror", icon: "👻" },
{ id: "survival_horror", labelKey: "genres.survival_horror", icon: "🧟" },
{ id: "psychological_horror", labelKey: "genres.psychological_horror", icon: "🧠" },
{ id: "rpg", labelKey: "genres.rpg", icon: "🛡" },
{ id: "jrpg", labelKey: "genres.jrpg", icon: "🎎" },
{ id: "action_rpg", labelKey: "genres.action_rpg", icon: "🏹" },
{ id: "crpg", labelKey: "genres.crpg", icon: "📜" },
{ id: "fps", labelKey: "genres.fps", icon: "🔫" },
{ id: "arena_shooter", labelKey: "genres.arena_shooter", icon: "🎯" },
{ id: "tactical_fps", labelKey: "genres.tactical_fps", icon: "🎖" },
{ id: "boomer_shooter", labelKey: "genres.boomer_shooter", icon: "💥" },
{ id: "extraction_shooter", labelKey: "genres.extraction_shooter", icon: "🎒" },
{ id: "shmup", labelKey: "genres.shmup", icon: "🛸" },
{ id: "openworld", labelKey: "genres.openworld", icon: "🌍" },
{ id: "indie", labelKey: "genres.indie", icon: "🕹" },
{ id: "soulslike", labelKey: "genres.soulslike", icon: "💀" },
{ id: "racing", labelKey: "genres.racing", icon: "🏎" },
{ id: "story", labelKey: "genres.story", icon: "📖" },
{ id: "simulation", labelKey: "genres.simulation", icon: "🏗" },
{ id: "city_builder", labelKey: "genres.city_builder", icon: "🏙" },
{ id: "fighting", labelKey: "genres.fighting", icon: "🥊" },
{ id: "stealth", labelKey: "genres.stealth", icon: "🥷" },
{ id: "survival_craft", labelKey: "genres.survival_craft", icon: "⛏" },
@@ -19,12 +33,43 @@ export const GENRES = [
{ id: "puzzle", labelKey: "genres.puzzle", icon: "🧩" },
{ id: "tower_defense", labelKey: "genres.tower_defense", icon: "🏰" },
{ id: "card_game", labelKey: "genres.card_game", icon: "🃏" },
{ id: "deck_builder", labelKey: "genres.deck_builder", icon: "🎴" },
{ id: "auto_battler", labelKey: "genres.auto_battler", icon: "🤖" },
{ id: "battle_royale", labelKey: "genres.battle_royale", icon: "🏆" },
{ id: "crpg", labelKey: "genres.crpg", icon: "📜" },
{ id: "tactical", labelKey: "genres.tactical", icon: "♟" },
{ id: "space", labelKey: "genres.space", icon: "🚀" },
{ id: "farming", labelKey: "genres.farming", icon: "🌾" },
{ id: "fmv", labelKey: "genres.fmv", icon: "🎬" },
{ id: "visual_novel", labelKey: "genres.visual_novel", icon: "💬" },
] as const;
export type GenreId = (typeof GENRES)[number]["id"];
/**
* Ids for the bulk-select buttons rendered above the genre chip group.
* Each id maps to a curated set of genres in {@link GENRE_GROUPS} and
* an i18n label under `editor.genreGroups.<id>`.
*/
export type GenreGroupId = "rpg" | "shooter" | "horror";
/**
* Bulk-toggle groups (v0.9 phase 2). Clicking the group's button
* REPLACES the current selection with the first {@link MAX_GENRES} ids
* from the list (so the selection stays under the cap regardless of
* how big the group is). Order in each list determines which ids get
* picked when the group exceeds the cap.
*/
export const GENRE_GROUPS: Record<GenreGroupId, readonly GenreId[]> = {
rpg: ["rpg", "jrpg", "action_rpg", "crpg"],
shooter: [
"fps",
"arena_shooter",
"tactical_fps",
"boomer_shooter",
"extraction_shooter",
"shmup",
],
horror: ["horror", "survival_horror", "psychological_horror"],
};
export const GENRE_GROUP_IDS: readonly GenreGroupId[] = ["rpg", "shooter", "horror"];
+101
View File
@@ -0,0 +1,101 @@
import type { GenreId } from "./genres";
/**
* Graphics-quality preset ladder. Mirrors the most common in-game preset
* names across Unreal/Unity/proprietary engines. `"custom"` reveals a
* free-form text field for games whose preset names don't fit the ladder
* (e.g. "Epic", "Maximum", "Insane") — same escape-hatch pattern as the
* v0.7 difficulty `"custom"` option.
*
* Default: `"medium"` (a sensible neutral starting point for new drafts).
*/
export const GRAPHICS_PRESETS = [
"low",
"medium",
"high",
"very_high",
"cinematic",
"ultra",
"extreme",
"custom",
] as const;
export type GraphicsPreset = (typeof GRAPHICS_PRESETS)[number];
/**
* Ray-tracing modes. Multi-select — modern AAA games can ship with several
* of these layered (e.g. Path Tracing + Ray Reconstruction + Frame
* Generation). Empty array → no RT clause in the description.
*/
export const RT_MODES = [
"ray_tracing",
"full_rt",
"path_tracing",
"ray_reconstruction",
] as const;
export type RTMode = (typeof RT_MODES)[number];
/**
* GPU vendor whose upscaling / frame-gen tech the creator used. Single
* vendor field on purpose — most builds run a single vendor's stack
* (NVIDIA → DLSS, AMD → FSR, Intel → XeSS). `"none"` skips the modifier
* entirely.
*/
export const FRAMEGEN_VENDORS = ["none", "nvidia", "amd", "intel"] as const;
export type FrameGenVendor = (typeof FRAMEGEN_VENDORS)[number];
/**
* Frame-generation multiplier — DLSS 4 supports up to x4, FSR 3 up to x3,
* Intel XeFG is ramping up. `"none"` means upscaling is in use but frame
* generation isn't; useful for builds where DLSS Quality is enabled but
* FG was left off.
*/
export const FRAMEGEN_MULTIPLIERS = ["none", "x2", "x3", "x4", "x6"] as const;
export type FrameGenMultiplier = (typeof FRAMEGEN_MULTIPLIERS)[number];
/**
* Upscaling-quality preset across DLSS Super Resolution / FSR / XeSS.
* The actual brand name is rendered from {@link FRAMEGEN_VENDORS}; this
* enum carries only the quality dimension.
*/
export const UPSCALE_QUALITIES = [
"none",
"native_aa",
"quality",
"balanced",
"performance",
"ultra_performance",
] as const;
export type UpscaleQuality = (typeof UPSCALE_QUALITIES)[number];
/**
* High-level visual style of the game. Optional context for viewers
* scanning the description — particularly useful for indie titles where
* "Pixel Art" or "Hand-drawn" is part of the appeal. `"none"` skips the
* art-style line.
*/
export const ART_STYLES = [
"none",
"realistic",
"stylized",
"anime",
"cel_shaded",
"low_poly",
"voxel",
"pixel_art",
"hand_drawn",
"comic",
"photorealistic",
] as const;
export type ArtStyle = (typeof ART_STYLES)[number];
/**
* Genres where in-game graphics settings are typically absent — used by
* the editor to surface a one-time "Hide graphics settings?" suggestion
* chip. The user always has the final say via the manual `skipGraphicsSettings`
* toggle; this list only seeds the hint.
*/
export const GENRES_WITHOUT_GRAPHICS_SETTINGS: readonly GenreId[] = [
"visual_novel",
"fmv",
"rhythm",
] as const;
+100 -10
View File
@@ -1,13 +1,103 @@
export const PLATFORMS = [
{ id: "steam", label: "Steam", urlPrefix: "https://store.steampowered.com/app/" },
{ id: "epic", label: "Epic Games Store", urlPrefix: "https://store.epicgames.com/" },
{ id: "ps", label: "PlayStation Store", urlPrefix: "https://store.playstation.com/" },
{ id: "xbox", label: "Xbox / Microsoft Store", urlPrefix: "https://www.xbox.com/games/" },
{ id: "nintendo", label: "Nintendo eShop", urlPrefix: "https://www.nintendo.com/store/" },
{ id: "gog", label: "GOG", urlPrefix: "https://www.gog.com/game/" },
{ id: "itchio", label: "itch.io", urlPrefix: "https://itch.io/" },
{ id: "humble", label: "Humble Bundle", urlPrefix: "https://www.humblebundle.com/store/" },
{ id: "amazon", label: "Amazon Luna", urlPrefix: "https://www.amazon.com/luna/" },
export interface PlatformConfig {
readonly id: string;
readonly label: string;
/** Shown as placeholder / hint to the user. */
readonly urlPrefix: string;
/** Authoritative validator. Must match the entire trimmed URL. */
readonly urlPattern: RegExp;
/**
* Optional canonicaliser run on already-valid URLs before commit.
* Useful for stripping trailing slug segments (e.g. Steam app pages
* include the game name after the app id).
*/
readonly normalize?: (url: string) => string;
}
/**
* Normaliser for Steam store URLs.
*
* Valid shape: `https://store.steampowered.com/app/<id>` with an optional
* trailing slug such as `/ELDEN_RING/`. This strips everything after the
* numeric id, yielding the canonical `.../app/<id>` form.
*/
function normalizeSteamUrl(url: string): string {
const match = url.match(
/^(https:\/\/store\.steampowered\.com\/app\/\d+)(?:\/.*)?$/i,
);
return match?.[1] ?? url;
}
export const PLATFORMS: readonly PlatformConfig[] = [
{
id: "steam",
label: "Steam",
urlPrefix: "https://store.steampowered.com/app/",
// /app/<digits>, optionally followed by /<slug> or trailing slash.
urlPattern: /^https:\/\/store\.steampowered\.com\/app\/\d+(?:\/[^\s]*)?$/i,
normalize: normalizeSteamUrl,
},
{
id: "epic",
label: "Epic Games Store",
urlPrefix: "https://store.epicgames.com/",
urlPattern: /^https:\/\/store\.epicgames\.com\/[^\s]+$/i,
},
{
id: "ps",
label: "PlayStation Store",
urlPrefix: "https://store.playstation.com/",
urlPattern: /^https:\/\/store\.playstation\.com\/[^\s]+$/i,
},
{
id: "xbox",
label: "Xbox / Microsoft Store",
urlPrefix: "https://www.xbox.com/games/",
urlPattern: /^https:\/\/www\.xbox\.com\/[^\s]+$/i,
},
{
id: "nintendo",
label: "Nintendo eShop",
urlPrefix: "https://www.nintendo.com/store/",
urlPattern: /^https:\/\/www\.nintendo\.com\/[^\s]+$/i,
},
{
id: "gog",
label: "GOG",
urlPrefix: "https://www.gog.com/game/",
urlPattern: /^https:\/\/www\.gog\.com\/[^\s]+$/i,
},
{
id: "itchio",
label: "itch.io",
urlPrefix: "https://<dev>.itch.io/<game>",
// itch.io games live at https://<dev>.itch.io/<game>, where <dev>
// is a user subdomain. Reject the bare https://itch.io/... host.
urlPattern:
/^https:\/\/[a-z0-9][a-z0-9-]*\.itch\.io\/[a-z0-9][a-z0-9_-]*\/?$/i,
},
{
id: "humble",
label: "Humble Bundle",
urlPrefix: "https://www.humblebundle.com/store/",
urlPattern: /^https:\/\/www\.humblebundle\.com\/[^\s]+$/i,
},
{
id: "amazon",
label: "Amazon Luna",
urlPrefix: "https://www.amazon.com/luna/",
urlPattern: /^https:\/\/www\.amazon\.com\/[^\s]+$/i,
},
{
// Catch-all for indie / niche releases distributed only from a
// publisher's or developer's own site. Pattern is intentionally
// loose (any HTTPS URL with a host) — these sites don't share a
// common shape, and tightening the regex would just lock real
// links out of the description.
id: "publisher",
label: "Publisher / Developer site",
urlPrefix: "https://",
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/[^\s]*)?$/i,
},
] as const;
export type PlatformId = (typeof PLATFORMS)[number]["id"];
+89 -10
View File
@@ -1,12 +1,91 @@
export const RIG_FIELDS = [
{ id: "cpu", labelKey: "rig.cpu", placeholder: "Intel i9-14900K / AMD Ryzen 9 7950X" },
{ id: "gpu", labelKey: "rig.gpu", placeholder: "NVIDIA RTX 4090 / AMD RX 7900 XTX" },
{ id: "ram", labelKey: "rig.ram", placeholder: "32GB DDR5-6000" },
{ id: "storage", labelKey: "rig.storage", placeholder: "2TB Samsung 990 PRO NVMe" },
{ id: "monitor", labelKey: "rig.monitor", placeholder: "LG 27GP950 27\" 4K 144Hz" },
{ id: "capture", labelKey: "rig.capture", placeholder: "OBS Studio 30.x" },
{ id: "motherboard", labelKey: "rig.motherboard", placeholder: "ASUS ROG Maximus Z790 Hero" },
{ id: "controller", labelKey: "rig.controller", placeholder: "DualSense / Xbox Elite Series 2" },
] as const;
/**
* Supported rig field input types.
*
* - `text`: plain text input (existing behaviour).
* - `dropdown_with_version`: a dropdown of preset options paired with a
* free-form version text input. The stored value is
* `"<option_value>|<version>"` so we don't break the flat
* `Partial<Record<string, string>>` rig shape in the editor store.
*/
export type RigFieldType = "text" | "dropdown_with_version";
export interface RigFieldOption {
readonly value: string;
/** Display label (not translated — software names are brand-preserved). */
readonly label: string;
}
export interface RigField {
readonly id: string;
readonly labelKey: string;
readonly type: RigFieldType;
readonly placeholder?: string;
readonly options?: readonly RigFieldOption[];
readonly versionPlaceholder?: string;
}
/**
* Dropdown options for the video editing software field.
*
* Order loosely reflects popularity among no-commentary gameplay
* creators. Add new entries here — the UI picks them up automatically.
*/
export const VIDEO_EDITOR_OPTIONS: readonly RigFieldOption[] = [
{ value: "", label: "—" },
{ value: "davinci_resolve", label: "DaVinci Resolve" },
{ value: "davinci_resolve_studio", label: "DaVinci Resolve Studio" },
{ value: "premiere", label: "Adobe Premiere Pro" },
{ value: "after_effects", label: "Adobe After Effects" },
{ value: "capcut", label: "CapCut" },
{ value: "vegas", label: "Vegas Pro" },
{ value: "final_cut", label: "Final Cut Pro" },
{ value: "kdenlive", label: "Kdenlive" },
{ value: "shotcut", label: "Shotcut" },
{ value: "filmora", label: "Wondershare Filmora" },
{ value: "other", label: "Other" },
];
export const RIG_FIELDS: readonly RigField[] = [
{ id: "cpu", labelKey: "rig.cpu", type: "text", placeholder: "Intel i9-14900K / AMD Ryzen 9 7950X" },
{ id: "gpu", labelKey: "rig.gpu", type: "text", placeholder: "NVIDIA RTX 4090 / AMD RX 7900 XTX" },
{ id: "ram", labelKey: "rig.ram", type: "text", placeholder: "32GB DDR5-6000" },
{ id: "storage", labelKey: "rig.storage", type: "text", placeholder: "2TB Samsung 990 PRO NVMe" },
{ id: "monitor", labelKey: "rig.monitor", type: "text", placeholder: "LG 27GP950 27\" 4K 144Hz" },
{ id: "capture", labelKey: "rig.capture", type: "text", placeholder: "OBS Studio 30.x" },
{ id: "motherboard", labelKey: "rig.motherboard", type: "text", placeholder: "ASUS ROG Maximus Z790 Hero" },
{ id: "controller", labelKey: "rig.controller", type: "text", placeholder: "DualSense / Xbox Elite Series 2" },
{
id: "video_editor",
labelKey: "rig.video_editor",
type: "dropdown_with_version",
options: VIDEO_EDITOR_OPTIONS,
versionPlaceholder: "19.1 / 2024 / v5.0",
},
];
export type RigFieldId = (typeof RIG_FIELDS)[number]["id"];
/**
* Format a stored rig value for display in the description output.
* For dropdown_with_version fields, this turns `"davinci_resolve_studio|19.1"`
* into `"DaVinci Resolve Studio 19.1"`. Other values pass through.
*/
export function formatRigValue(fieldId: string, raw: string): string {
const field = RIG_FIELDS.find((f) => f.id === fieldId);
if (!field || field.type !== "dropdown_with_version") return raw;
const [value = "", version = ""] = raw.split("|");
const trimmedVersion = version.trim();
if (!value && !trimmedVersion) return "";
// The empty-value sentinel option renders as "—" in the dropdown but
// should act as "no selection" in the output.
let label = "";
if (value) {
const option = field.options?.find((o) => o.value === value);
label = option?.label ?? value;
}
if (!label) return trimmedVersion;
return trimmedVersion ? `${label} ${trimmedVersion}` : label;
}
+16
View File
@@ -1,6 +1,8 @@
export const VIDEO_TYPES = [
{ id: "full", labelKey: "videoTypes.full", icon: "🎮", extraFields: [] },
{ id: "part", labelKey: "videoTypes.part", icon: "📂", extraFields: ["partNumber"] },
{ id: "full_demo", labelKey: "videoTypes.full_demo", icon: "🎬", extraFields: [] },
{ id: "demo_part", labelKey: "videoTypes.demo_part", icon: "🎞", extraFields: ["partNumber"] },
{ id: "boss", labelKey: "videoTypes.boss", icon: "👹", extraFields: ["bossName"] },
{ id: "boss_nohit", labelKey: "videoTypes.boss_nohit", icon: "💀", extraFields: ["bossName"] },
{ id: "ending", labelKey: "videoTypes.ending", icon: "🏁", extraFields: [] },
@@ -13,6 +15,20 @@ export const VIDEO_TYPES = [
{ id: "secret", labelKey: "videoTypes.secret", icon: "🔍", extraFields: [] },
{ id: "comparison", labelKey: "videoTypes.comparison", icon: "⚖️", extraFields: [] },
{ id: "guide", labelKey: "videoTypes.guide", icon: "📘", extraFields: [] },
{ id: "mods", labelKey: "videoTypes.mods", icon: "🧩", extraFields: ["modName"] },
{ id: "collectibles", labelKey: "videoTypes.collectibles", icon: "⭐", extraFields: [] },
{
id: "livestream",
labelKey: "videoTypes.livestream",
icon: "🔴",
extraFields: ["liveUrl", "scheduledTime"],
},
{
id: "gacha_quest",
labelKey: "videoTypes.gacha_quest",
icon: "🎴",
extraFields: ["gachaQuestType", "chapterName", "questName", "partNumber"],
},
] as const;
export type VideoTypeId = (typeof VIDEO_TYPES)[number]["id"];
+398 -23
View File
@@ -2,6 +2,10 @@ import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
import { YT_LIMITS } from "./types";
import { PLATFORMS } from "@config/platforms";
import { SOCIAL_FIELDS } from "@config/social-fields";
import { formatRigValue } from "@config/rig-fields";
import { DEFAULT_GACHA_QUEST_TYPE } from "@config/gacha-quest-types";
import { parseTimeline, renderTimeline } from "./timeline-parser";
import { sanitizeHashtag } from "@utils/sanitize";
const SOCIAL_ICONS: Record<string, string> = {
kofi: "☕",
@@ -31,59 +35,339 @@ function getLabelForId(id: string, configs: readonly { id: string; label: string
return configs.find((c) => c.id === id)?.label ?? id;
}
/**
* Locale-aware short formatter for the livestream `scheduledTime` field.
* The editor stores ISO strings (`<input type="datetime-local">` output);
* we render them as "Sat, May 2, 8:00 PM" in en, and equivalent native
* forms elsewhere via `Intl.DateTimeFormat`. Falls back to the raw input
* if it can't be parsed — better than emitting "Invalid Date".
*/
function formatScheduledTime(iso: string, language: string): string {
const trimmed = iso.trim();
if (!trimmed) return "";
const date = new Date(trimmed);
if (Number.isNaN(date.getTime())) return trimmed;
try {
return new Intl.DateTimeFormat(language, {
weekday: "short",
month: "short",
day: "numeric",
hour: "numeric",
minute: "2-digit",
}).format(date);
} catch {
return trimmed;
}
}
/**
* Brand names by GPU vendor — kept in English on purpose. These are
* trademarked product names viewers are searching for verbatim ("DLSS",
* "FSR", "XeSS"); translating them would hurt SEO. Frame-gen branding
* is similarly fixed: "Frame Generation" (NVIDIA), "Fluid Motion Frames"
* (AMD's official term), "XeFG" (Intel's announced FG tech).
*/
const VENDOR_GFX_BRANDS: Record<
"nvidia" | "amd" | "intel",
{ upscale: string; framegen: string }
> = {
nvidia: { upscale: "NVIDIA DLSS", framegen: "NVIDIA Frame Generation" },
amd: { upscale: "AMD FSR", framegen: "AMD Fluid Motion Frames" },
intel: { upscale: "Intel XeSS", framegen: "Intel XeFG" },
};
/**
* Compose the value half of the "In-game Setting:" line — e.g.
* `Cinematic - NVIDIA Frame Generation x2 with Ray Tracing`.
*
* The `<label>: ` prefix is added by the caller (so the renderer can
* emit a multi-line block matching the rig / timestamps style). We drop
* the legacy "Setting" suffix here — having both the label AND a
* trailing "Setting" word read as redundant ("In-game Setting: Ultra
* Setting").
*
* Returns an empty string when nothing meaningful can be said (no preset
* label AND no modifiers AND no RT modes); the caller skips the line.
*/
function composeGraphicsPart(input: GeneratorInput, t: TranslationFn): string {
// 1. Preset label — `"custom"` reads from the free-form slot; everything
// else goes through i18n. Missing translation falls back to nothing
// rather than leaking the raw key.
let presetLabel = "";
if (input.graphicsPreset === "custom") {
presetLabel = (input.graphicsPresetCustom ?? "").trim();
} else if (input.graphicsPreset) {
const key = `description.graphics.presetOptions.${input.graphicsPreset}`;
const resolved = t(key);
if (resolved && resolved !== key) presetLabel = resolved;
}
// 2. Modifier (upscale + frame-gen). Vendor gates the whole clause —
// upscaling/frame-gen quality without a vendor is meaningless.
const vendor =
input.frameGenVendor && input.frameGenVendor !== "none"
? input.frameGenVendor
: null;
const upscaleQ =
input.upscaleQuality && input.upscaleQuality !== "none"
? input.upscaleQuality
: null;
const fgMul =
input.frameGenMultiplier && input.frameGenMultiplier !== "none"
? input.frameGenMultiplier
: null;
let modifier = "";
if (vendor) {
const brands = VENDOR_GFX_BRANDS[vendor];
const parts: string[] = [];
if (upscaleQ) {
const qLabel = t(`description.graphics.upscaleQualityOptions.${upscaleQ}`);
parts.push(`${brands.upscale} ${qLabel}`);
}
if (fgMul) {
// When upscaling is also present, just say "Frame Generation x2"
// without re-stating the brand — the upscaler already established
// it. Otherwise spell out "NVIDIA Frame Generation x2".
parts.push(parts.length > 0 ? `Frame Generation ${fgMul}` : `${brands.framegen} ${fgMul}`);
}
modifier = parts.join(" + ");
}
// 3. Ray-tracing clause. Each mode runs through i18n; falls back to
// the snake_case id if a locale hasn't translated it.
const rtModes = input.rayTracingModes ?? [];
let rtClause = "";
if (rtModes.length > 0) {
const labels = rtModes.map((m) => {
const key = `description.graphics.rtOptions.${m}`;
const resolved = t(key);
return resolved === key ? m : resolved;
});
rtClause = ` ${t("description.graphics.with")} ${labels.join(", ")}`;
}
if (!presetLabel && !modifier && !rtClause) return "";
if (!presetLabel) {
// No anchor preset (e.g. `custom` with empty free-form): fall back
// to just the modifier + RT clause, trimmed.
return `${modifier}${rtClause}`.trim();
}
const middle = modifier ? ` - ${modifier}` : "";
return `${presetLabel}${middle}${rtClause}`;
}
export interface BuildDescriptionOptions {
hashtagCount?: number;
/** When true and channelName is non-empty, appends an auto-generated
* copyright line after the CTA. */
showCopyright?: boolean;
/** When true, appends a localised usage-policy block after the
* copyright line. */
showUsagePolicy?: boolean;
/** When true and both `sponsorName` and `sponsorPlatform` are set,
* emits a "🎁 Thanks to …" credit line above the music section. */
showSponsorCredit?: boolean;
}
export function buildDescription(
input: GeneratorInput,
t: TranslationFn,
hashtagCount = 3,
options: BuildDescriptionOptions = {},
): string {
const {
hashtagCount = 3,
showCopyright = false,
showUsagePolicy = false,
showSponsorCredit = false,
} = options;
const sections: string[] = [];
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
// 1. Intro
const intro = t(`description.intro.${input.videoType}`, {
// 1. Intro. Gacha videos dispatch on `gachaQuestType` so each of the
// 17 patterns can frame the description with its own opening line
// ("World Quest …", "Spiral Abyss endgame", "Dating Event …"). All
// other video types fall through to the flat `description.intro.<id>`
// shape that's been around since v0.2.
let introKey = `description.intro.${input.videoType}`;
if (input.videoType === "gacha_quest") {
const questType = input.gachaQuestType ?? DEFAULT_GACHA_QUEST_TYPE;
introKey = `description.intro.gacha_quest_${questType}`;
}
const intro = t(introKey, {
gameName,
channelName: input.channelName,
partNumber: input.partNumber ?? "",
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
chapterName: input.chapterName ?? "",
questName: input.questName ?? "",
});
sections.push(intro);
// 1.25 Livestream metadata — only emitted for livestream-type videos
// when at least one of `liveUrl` / `scheduledTime` is set. Sits right
// after the intro so viewers can grab the live link before scrolling
// through the rest of the description.
if (input.videoType === "livestream") {
const lines: string[] = [];
if (input.scheduledTime && input.scheduledTime.trim()) {
const formatted = formatScheduledTime(input.scheduledTime, input.language);
const line = t("description.livestream.scheduledLine", { time: formatted });
if (line && line !== "description.livestream.scheduledLine") lines.push(line);
}
if (input.liveUrl && input.liveUrl.trim()) {
const line = t("description.livestream.watchLine", { link: input.liveUrl.trim() });
if (line && line !== "description.livestream.watchLine") lines.push(line);
}
if (lines.length > 0) sections.push(lines.join("\n"));
}
// 1.5 Playthrough status — surfaces "is this a blind run / NG+ / …"
// right after the intro because that context frames how viewers read
// everything below. Skipped when creator hasn't picked a value.
if (input.playthroughStatus && input.playthroughStatus !== "none") {
const label = t(`description.playthrough.${input.playthroughStatus}`);
sections.push(t("description.sections.playthrough", { value: label }));
}
// 2. No Commentary tagline
sections.push(t("description.noCommentaryLine"));
// 3. Timestamps
// 3. Timestamps (parsed + localized keywords)
if (input.timestamps && input.timestamps.trim()) {
sections.push(`${t("description.sections.timestamps")}\n${input.timestamps.trim()}`);
const entries = parseTimeline(input.timestamps);
const rendered = renderTimeline(entries, input.language, t);
sections.push(`${t("description.sections.timestamps")}\n${rendered}`);
}
// 4. Store Links (use proper brand names from config)
// 4. Store Links (heading + per-link suffix by pricing category)
if (hasEntries(input.storeLinks)) {
const links = Object.entries(input.storeLinks)
.filter(([, v]) => v && v.trim() !== "")
.map(([id, url]) => `🎮 ${getLabelForId(id, PLATFORMS)}: ${url}`)
.join("\n");
sections.push(`${t("description.sections.storeLinks")}\n${links}`);
const entries = Object.entries(input.storeLinks)
.filter((entry): entry is [string, string] =>
typeof entry[1] === "string" && entry[1].trim() !== "",
)
.map(([id, url]) => ({
id,
url: url.trim(),
type: (input.storeLinkTypes?.[id] ?? "paid") as "paid" | "free" | "demo",
}));
if (entries.length > 0) {
// Majority rule: if more than half the links are free/demo,
// switch the heading to "DOWNLOAD THE GAME". Ties favour "GET".
const nonPaid = entries.filter((e) => e.type !== "paid").length;
const headingKey =
nonPaid > entries.length / 2
? "description.sections.storeLinksDownload"
: "description.sections.storeLinksBuy";
const lines = entries
.map((e) => {
const label = getLabelForId(e.id, PLATFORMS);
const suffix =
e.type === "demo"
? ` (${t("description.storeLinkSuffix.demo")})`
: e.type === "free"
? ` (${t("description.storeLinkSuffix.free")})`
: "";
return `🎮 ${label}${suffix}: ${e.url}`;
})
.join("\n");
sections.push(`${t(headingKey)}\n${lines}`);
}
}
// 5. Video Settings
const settings: string[] = [];
if (input.resolution) settings.push(input.resolution);
if (input.fps) settings.push(`${input.fps} FPS`);
if (input.graphicsPreset) settings.push(input.graphicsPreset);
if (settings.length > 0) {
sections.push(`${t("description.sections.videoSettings")}\n${settings.join(" | ")}`);
// 5. Video Settings — skipped entirely for 2D / pixel-art / no-in-game-
// settings games (the user toggles that explicitly; v0.8 phase 2 also
// auto-suggests it on certain genres but the toggle is the source of
// truth at render time).
//
// v0.8 polish: each token now sits on its own line with a label
// ("Video:", "In-game Setting:", "Art Style:", "Version:"), matching
// the key-value-per-line shape of the rig and timestamps blocks.
// Lines with no value are dropped; if every line is dropped, the
// whole section is dropped.
if (!input.skipGraphicsSettings) {
const lines: string[] = [];
// Capture-side: resolution + FPS, joined with " - " on a single line.
const captureParts: string[] = [];
if (input.resolution) captureParts.push(input.resolution);
if (input.fps) captureParts.push(`${input.fps} FPS`);
if (captureParts.length > 0) {
lines.push(`${t("description.graphics.videoLabel")}: ${captureParts.join(" - ")}`);
}
// In-game side: preset + modifiers + RT.
const gfxPart = composeGraphicsPart(input, t);
if (gfxPart) {
lines.push(`${t("description.graphics.inGameSettingLabel")}: ${gfxPart}`);
}
// Art style — own line so it stays visible alongside the in-game preset.
if (input.artStyle && input.artStyle !== "none") {
const styleKey = `description.graphics.artStyleOptions.${input.artStyle}`;
const styleLabel = t(styleKey);
if (styleLabel && styleLabel !== styleKey) {
lines.push(`${t("description.graphics.artStyle")}: ${styleLabel}`);
}
}
// Driver / game version — free-form, own line.
if (input.versionInfo && input.versionInfo.trim()) {
lines.push(`${t("description.graphics.versionLabel")}: ${input.versionInfo.trim()}`);
}
if (lines.length > 0) {
sections.push(`${t("description.sections.videoSettings")}\n${lines.join("\n")}`);
}
}
// 5.5 Difficulty — sits with Video Settings because a difficulty
// choice is another gameplay setting, not a content warning. For
// `"custom"`, the user's free-form label is used verbatim (not
// translated — intentional: lets creators use game-specific names
// like "Lethal" without per-locale fallback friction).
if (input.difficulty && input.difficulty !== "none") {
const value =
input.difficulty === "custom"
? (input.difficultyCustomLabel ?? "").trim()
: t(`description.difficulty.${input.difficulty}`);
if (value) {
sections.push(`${t("description.sections.difficulty")}\n${value}`);
}
}
// 6. Rig
if (hasEntries(input.rig)) {
const rigLines = Object.entries(input.rig)
.map(([k, v]) => [k, formatRigValue(k, v ?? "")] as const)
.filter(([, v]) => v && v.trim() !== "")
.map(([k, v]) => `${k.toUpperCase()}: ${v}`)
.map(([k, v]) => `${k.replace(/_/g, " ").toUpperCase()}: ${v}`)
.join("\n");
sections.push(`${t("description.sections.rig")}\n${rigLines}`);
if (rigLines) {
sections.push(`${t("description.sections.rig")}\n${rigLines}`);
}
}
// 6.5 Mod list — only meaningful for the `mods` videoType. Free-form
// multi-line text the creator pastes from their mod manager (Wabbajack,
// Vortex, Mod Organizer…). The single-line `modName` field stays in the
// title / intro for short identification; this block lists the full
// load order for the description.
if (
input.videoType === "mods" &&
input.modList &&
input.modList.trim()
) {
sections.push(
`${t("description.sections.modList")}\n${input.modList.trim()}`,
);
}
// 7. Spoiler Warning
@@ -91,11 +375,55 @@ export function buildDescription(
sections.push(t("description.sections.spoilerWarning"));
}
// 7.5 Content warnings — accessibility block. Rendered as a bulleted
// list so viewers using screen readers or avoiding triggers can scan
// quickly. Each warning has its own emoji bullet (⚡ / 🔊 / 😱) and a
// localised label. Empty array → skipped, matching the behaviour for
// every other opt-in section.
if (input.contentWarnings && input.contentWarnings.length > 0) {
const bullets = input.contentWarnings
.map((w) => t(`description.contentWarnings.${w}`))
.filter((line) => line && line.trim() !== "")
.map((line) => `• ${line}`)
.join("\n");
if (bullets) {
sections.push(`${t("description.sections.contentWarnings")}\n${bullets}`);
}
}
// 8. Mature Warning
if (input.matureWarning) {
sections.push(t("description.sections.matureWarning"));
}
// 8.3. Sponsor credit — appears above the music / donate block so the
// "thanks to X" line stands out. Only renders when both the toggle is
// on AND the creator has filled in BOTH the sponsor name and the
// platform; partial data is treated as "not ready, skip" rather than
// rendered with holes.
if (
showSponsorCredit &&
input.sponsorName &&
input.sponsorName.trim() &&
input.sponsorPlatform &&
input.sponsorPlatform.trim()
) {
sections.push(
t("description.sections.sponsorCredit", {
sponsor: input.sponsorName.trim(),
platform: input.sponsorPlatform.trim(),
}),
);
}
// 8.5. Music / sound attribution — sits right before the donate
// block because both are "credits"-adjacent sections.
if (input.musicAttribution && input.musicAttribution.trim()) {
sections.push(
`${t("description.sections.music")}\n${input.musicAttribution.trim()}`,
);
}
// 9. Donate Links (use proper labels + icons)
const donateEntries = Object.entries(input.social)
.filter(([k, v]) => {
@@ -107,6 +435,32 @@ export function buildDescription(
sections.push(`${t("description.sections.donate")}\n${donateEntries.join("\n")}`);
}
// 9.5 Vietnam donate (bank + e-wallets) — gated on output language
// because non-Vietnamese viewers don't typically use VN bank
// transfer / MoMo / ZaloPay. Bank line requires both `vnBankName` and
// `vnBankAccount`; holder is decorative. Each e-wallet line is
// independent.
if (input.language === "vi") {
const vnLines: string[] = [];
const bankName = input.vnBankName?.trim() ?? "";
const bankAccount = input.vnBankAccount?.trim() ?? "";
const bankHolder = input.vnBankHolder?.trim() ?? "";
if (bankName && bankAccount) {
vnLines.push(
bankHolder
? `🏦 ${bankName}: ${bankAccount} (${bankHolder})`
: `🏦 ${bankName}: ${bankAccount}`,
);
}
const momo = input.vnMomo?.trim() ?? "";
if (momo) vnLines.push(`💸 MoMo: ${momo}`);
const zalopay = input.vnZalopay?.trim() ?? "";
if (zalopay) vnLines.push(`💸 ZaloPay: ${zalopay}`);
if (vnLines.length > 0) {
sections.push(`${t("description.sections.vnDonate")}\n${vnLines.join("\n")}`);
}
}
// 10. Social Links (use proper labels + icons)
const socialEntries = Object.entries(input.social)
.filter(([k, v]) => {
@@ -131,11 +485,32 @@ export function buildDescription(
// 13. CTA
sections.push(t("description.sections.cta"));
// 14. Hashtags
// 13.5 Copyright line — auto-generated from channelName + current year.
// Skipped when the creator hasn't set a channel name (nothing to claim).
if (showCopyright && input.channelName.trim()) {
const year = new Date().getFullYear();
sections.push(
t("description.sections.copyright", {
year: String(year),
channelName: input.channelName.trim(),
}),
);
}
// 13.7 Usage policy — fixed localised template behind a Settings toggle.
if (showUsagePolicy) {
const header = t("description.sections.usagePolicyHeader");
const body = t("description.sections.usagePolicy");
sections.push(`${header}\n${body}`);
}
// 14. Hashtags — first genre is the primary tag; any further genres are
// already represented in the tag list so they don't duplicate here.
const primaryGenre = input.genres[0];
const allHashtags = [
`#${gameName.replace(/\s+/g, "")}`,
`#${sanitizeHashtag(gameName)}`,
"#GameplayNoCommentary",
`#${input.genre}`,
...(primaryGenre ? [`#${sanitizeHashtag(primaryGenre)}`] : []),
];
sections.push(allHashtags.slice(0, hashtagCount).join(" "));
+121
View File
@@ -0,0 +1,121 @@
import type { GeneratorInput, TranslationFn, Genre } from "./types";
export interface BuildPinnedCommentOptions {
/**
* When true, include the "what should I play next?" prompt. Creators
* who run a fixed series (e.g. a single long-form playthrough) may
* turn this off to avoid the question feeling out of place.
*/
includeAskNextGame?: boolean;
/**
* When true and `input.playlistLink` is set, the template includes a
* "watch the full series here" line pointing at the playlist.
*/
includePlaylistLink?: boolean;
/**
* When true, the primary genre has a configured playlist URL in
* {@link genrePlaylists}, AND the matching label exists in
* {@link genreLabels}, the template includes a "More <genre>
* gameplay on the channel" line. v0.8 phase 2 — settings → Genre
* Playlists map drives this.
*/
includeGenrePlaylist?: boolean;
/** Per-genre playlist URLs, supplied by the caller from settings. */
genrePlaylists?: Partial<Record<Genre, string>>;
/**
* Per-genre human labels (already i18n-resolved by the caller). Kept
* separate from `genrePlaylists` so the engine stays config-free —
* the caller owns label resolution via the `ui.json` namespace.
*/
genreLabels?: Partial<Record<Genre, string>>;
}
/**
* Composes a localized pinned-comment template from a handful of
* reusable sub-keys plus a per-video-type greeting. Pure — no store
* access, no React, no DOM.
*
* Design:
* - Four shared sub-keys (`thanksForWatching`, `playlistPrompt`,
* `engagementPrompt`, `askNextGame`) keep the bulk of the translator
* burden small — a locale only has to translate these once.
* - One greeting per video type (`pinnedComment.greetings.<videoType>`)
* adds per-type nuance (boss vs ending vs speedrun read differently
* to a viewer, even though the CTA is the same).
* - Missing per-type greeting → fall back to `greetings.part`, which is
* the most generic shape ("Welcome back to {{gameName}} …"). If even
* that is absent, the greeting line is dropped rather than leaving a
* raw key visible in the output.
* - Returns `""` when the composed result would be only whitespace so
* callers can cleanly check `if (pinned) { … }`.
*/
export function buildPinnedComment(
input: GeneratorInput,
t: TranslationFn,
options: BuildPinnedCommentOptions = {},
): string {
const {
includeAskNextGame = true,
includePlaylistLink = true,
includeGenrePlaylist = false,
genrePlaylists,
genreLabels,
} = options;
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
const vars: Record<string, string> = {
gameName,
channelName: input.channelName,
};
// Greeting — per-video-type first, then `part` fallback, then drop.
const greetingKey = `pinnedComment.greetings.${input.videoType}`;
const greetingResolved = t(greetingKey, vars);
let greeting = greetingResolved === greetingKey ? "" : greetingResolved;
if (!greeting) {
const fallbackKey = "pinnedComment.greetings.part";
const fallback = t(fallbackKey, vars);
if (fallback !== fallbackKey) greeting = fallback;
}
const lines: string[] = [];
if (greeting.trim()) lines.push(greeting);
const thanks = t("pinnedComment.thanksForWatching");
if (thanks && thanks !== "pinnedComment.thanksForWatching") lines.push(thanks);
if (includePlaylistLink && input.playlistLink && input.playlistLink.trim()) {
const playlist = t("pinnedComment.playlistPrompt", {
link: input.playlistLink.trim(),
});
if (playlist && playlist !== "pinnedComment.playlistPrompt") lines.push(playlist);
}
// Genre-playlist auto-suggestion. The primary genre (genres[0]) is the
// template trigger; secondary genres don't get their own line because
// the pinned comment would balloon for multi-genre videos.
if (includeGenrePlaylist) {
const primary = input.genres[0];
const url = primary ? genrePlaylists?.[primary]?.trim() : "";
const label = primary ? genreLabels?.[primary] : "";
if (primary && url && label) {
const line = t("pinnedComment.genrePlaylistSuggestion", {
genreLabel: label,
link: url,
});
if (line && line !== "pinnedComment.genrePlaylistSuggestion") {
lines.push(line);
}
}
}
const engagement = t("pinnedComment.engagementPrompt");
if (engagement && engagement !== "pinnedComment.engagementPrompt") lines.push(engagement);
if (includeAskNextGame) {
const ask = t("pinnedComment.askNextGame");
if (ask && ask !== "pinnedComment.askNextGame") lines.push(ask);
}
return lines.filter((l) => l.trim() !== "").join("\n\n");
}
+349 -64
View File
@@ -1,38 +1,223 @@
import type { GeneratorInput } from "./types";
import type { GeneratorInput, SupportedLanguage } from "./types";
import { YT_LIMITS } from "./types";
import { humanizeId } from "@utils/sanitize";
/**
* Reserve a 9-char tail for the most common composite suffix (" gameplay").
* Composites whose suffix is longer than 9 chars may still get filtered out
* by the per-tag char limit, but the bare game name and short composites are
* guaranteed to land — fixing the silent-drop case where a long name made
* every game-name-bearing tag disappear.
*/
const COMPOSITE_NAME_BUDGET = YT_LIMITS.SINGLE_TAG_MAX - 9;
const QUALIFIER_SUFFIX_RE =
/[:\s]+(?:Definitive|Complete|Collector'?s?|Deluxe|Game\s+of\s+the\s+Year|GOTY|Ultimate|Special|Anniversary|Remastered|Remake|Enhanced|HD)(?:\s+(?:Edition|Cut|Version))?\s*$/i;
/**
* Returns a shortened, tag-friendly form of `name` whose length is ≤ `budget`.
*
* Strips trademark marks, then iteratively peels off common edition
* qualifiers ("Definitive Edition", "Remastered", "GOTY", …). If the result
* is still over budget, drops everything after the first colon. Falls back
* to picking leading whole words that fit.
*
* Pure — exported for testing.
*/
export function tagFriendlyGameName(name: string, budget: number): string {
let n = name.replace(/[™®©]/g, "").trim();
let prev: string;
do {
prev = n;
n = n.replace(QUALIFIER_SUFFIX_RE, "").trim();
} while (n !== prev);
if (n.length <= budget) return n;
const colonIdx = n.indexOf(":");
if (colonIdx > 0) {
const head = n.slice(0, colonIdx).trim();
if (head.length <= budget) return head;
n = head;
}
const words = n.split(/\s+/);
const acc: string[] = [];
let len = 0;
for (const w of words) {
const sep = acc.length === 0 ? 0 : 1;
if (len + sep + w.length > budget) break;
acc.push(w);
len += sep + w.length;
}
return acc.join(" ") || n.slice(0, budget);
}
/**
* Genre tag pool registry.
*
* Each entry returns an array of tags for the given game name. These tags
* are language-agnostic (English-based SEO terms commonly searched across
* all regions). Language-specific tags come from CORE_TAGS_BY_LANG and
* MULTILINGUAL_TAGS.
*/
const GENRE_TAG_REGISTRY: Record<string, (gameName: string) => string[]> = {
action: (g) => [`${g} action`, "action game no commentary", "action adventure gameplay"],
horror: (g) => [`${g} horror`, "horror game no commentary", "survival horror gameplay"],
rpg: (g) => [`${g} RPG`, "RPG no commentary", "RPG gameplay", "JRPG no commentary"],
fps: (g) => [`${g} FPS`, "FPS no commentary", "shooter gameplay no commentary"],
openworld: (g) => [`${g} open world`, "open world no commentary", "free roam gameplay"],
indie: (g) => [`${g} indie`, "indie game no commentary", "indie gameplay"],
soulslike: (g) => [`${g} souls like`, "soulsborne no commentary", "souls like gameplay"],
racing: (g) => [`${g} racing`, "racing game no commentary", "racing gameplay"],
story: (g) => [`${g} story`, "story game no commentary", "narrative gameplay"],
simulation: (g) => [`${g} simulation`, "simulation game no commentary", "strategy gameplay"],
fighting: (g) => [`${g} fighting`, "fighting game no commentary", "combo gameplay"],
stealth: (g) => [`${g} stealth`, "stealth game no commentary", "stealth gameplay"],
survival_craft: (g) => [`${g} survival`, "survival crafting no commentary", "base building"],
roguelike: (g) => [`${g} roguelike`, "roguelike no commentary", "roguelite gameplay"],
metroidvania: (g) => [`${g} metroidvania`, "metroidvania no commentary", "exploration gameplay"],
mmo: (g) => [`${g} MMO`, "MMO no commentary", "MMORPG gameplay"],
rhythm: (g) => [`${g} rhythm`, "rhythm game no commentary", "music game gameplay"],
puzzle: (g) => [`${g} puzzle`, "puzzle game no commentary", "brain teaser gameplay"],
tower_defense: (g) => [`${g} tower defense`, "tower defense no commentary", "TD gameplay"],
card_game: (g) => [`${g} card game`, "deck builder no commentary", "card game gameplay"],
battle_royale: (g) => [`${g} battle royale`, "battle royale no commentary", "BR gameplay"],
crpg: (g) => [`${g} CRPG`, "CRPG no commentary", "isometric RPG gameplay"],
tactical: (g) => [`${g} tactical`, "tactical game no commentary", "turn based strategy"],
space: (g) => [`${g} space`, "space game no commentary", "sci-fi gameplay"],
farming: (g) => [`${g} farming`, "farming sim no commentary", "cozy game gameplay"],
fmv: (g) => [`${g} FMV`, "FMV game no commentary", "interactive movie gameplay"],
action: (g) => [`${g} action`, "action game no commentary", "action adventure gameplay", `${g} combat`],
horror: (g) => [`${g} horror`, "horror game no commentary", "survival horror gameplay", `${g} scary`],
rpg: (g) => [`${g} RPG`, "RPG no commentary", "RPG gameplay", "JRPG no commentary", `${g} role playing`],
fps: (g) => [`${g} FPS`, "FPS no commentary", "shooter gameplay no commentary", `${g} shooter`],
openworld: (g) => [`${g} open world`, "open world no commentary", "free roam gameplay", `${g} exploration`],
indie: (g) => [`${g} indie`, `${g} indie game`, "indie game no commentary", "indie gameplay", "best indie games"],
soulslike: (g) => [`${g} souls like`, "soulsborne no commentary", "souls like gameplay", `${g} hardcore`],
racing: (g) => [`${g} racing`, "racing game no commentary", "racing gameplay", `${g} cars`],
story: (g) => [
`${g} story`,
`${g} story mode`,
"story game no commentary",
"narrative gameplay",
"cinematic adventure no commentary",
],
simulation: (g) => [`${g} simulation`, "simulation game no commentary", "strategy gameplay", `${g} sim`],
fighting: (g) => [`${g} fighting`, "fighting game no commentary", "combo gameplay", `${g} fight`],
stealth: (g) => [`${g} stealth`, "stealth game no commentary", "stealth gameplay", `${g} ghost run`],
survival_craft: (g) => [
`${g} survival`,
"survival crafting no commentary",
"base building",
`${g} crafting`,
],
roguelike: (g) => [`${g} roguelike`, "roguelike no commentary", "roguelite gameplay", `${g} run`],
metroidvania: (g) => [
`${g} metroidvania`,
"metroidvania no commentary",
"exploration gameplay",
`${g} platformer`,
],
mmo: (g) => [`${g} MMO`, "MMO no commentary", "MMORPG gameplay", `${g} online`],
rhythm: (g) => [`${g} rhythm`, "rhythm game no commentary", "music game gameplay", `${g} music`],
puzzle: (g) => [`${g} puzzle`, "puzzle game no commentary", "brain teaser gameplay", `${g} logic`],
tower_defense: (g) => [`${g} tower defense`, "tower defense no commentary", "TD gameplay", `${g} strategy`],
card_game: (g) => [`${g} card game`, "deck builder no commentary", "card game gameplay", `${g} TCG`],
battle_royale: (g) => [`${g} battle royale`, "battle royale no commentary", "BR gameplay", `${g} solo`],
crpg: (g) => [`${g} CRPG`, "CRPG no commentary", "isometric RPG gameplay", `${g} party`],
tactical: (g) => [`${g} tactical`, "tactical game no commentary", "turn based strategy", `${g} tactics`],
space: (g) => [`${g} space`, "space game no commentary", "sci-fi gameplay", `${g} sci fi`],
farming: (g) => [`${g} farming`, "farming sim no commentary", "cozy game gameplay", `${g} cozy`],
fmv: (g) => [`${g} FMV`, "FMV game no commentary", "interactive movie gameplay", `${g} live action`],
visual_novel: (g) => [
`${g} visual novel`,
`${g} VN no commentary`,
"visual novel gameplay",
"kinetic novel no commentary",
`${g} story mode`,
],
hack_slash: (g) => [
`${g} hack and slash`,
"hack and slash no commentary",
`${g} combo gameplay`,
"character action game",
],
beatemup: (g) => [
`${g} beat em up`,
"beat em up no commentary",
`${g} brawler`,
"belt scroll action",
],
platformer: (g) => [
`${g} platformer`,
"platformer no commentary",
`${g} 2d platformer`,
`${g} 3d platformer`,
],
survival_horror: (g) => [
`${g} survival horror`,
"survival horror no commentary",
`${g} resource management horror`,
"classic survival horror",
],
psychological_horror: (g) => [
`${g} psychological horror`,
"psychological horror no commentary",
`${g} atmospheric horror`,
"mind bending horror gameplay",
],
jrpg: (g) => [
`${g} JRPG`,
"JRPG no commentary",
`${g} japanese RPG`,
"turn based JRPG gameplay",
],
action_rpg: (g) => [
`${g} action RPG`,
"action RPG no commentary",
`${g} ARPG`,
"action RPG gameplay",
],
arena_shooter: (g) => [
`${g} arena shooter`,
"arena shooter no commentary",
`${g} arena FPS`,
"fast paced shooter gameplay",
],
tactical_fps: (g) => [
`${g} tactical FPS`,
"tactical shooter no commentary",
`${g} milsim`,
"tactical FPS gameplay",
],
boomer_shooter: (g) => [
`${g} boomer shooter`,
"boomer shooter no commentary",
`${g} retro fps`,
"90s shooter gameplay",
],
extraction_shooter: (g) => [
`${g} extraction shooter`,
"extraction shooter no commentary",
`${g} loot and extract`,
"extraction FPS gameplay",
],
shmup: (g) => [
`${g} shmup`,
`${g} bullet hell`,
"shoot em up no commentary",
"danmaku gameplay",
],
city_builder: (g) => [
`${g} city builder`,
"city builder no commentary",
`${g} city building`,
"city sim gameplay",
],
deck_builder: (g) => [
`${g} deck builder`,
"deck builder no commentary",
`${g} deckbuilding roguelike`,
"deck building gameplay",
],
auto_battler: (g) => [
`${g} auto battler`,
"auto battler no commentary",
`${g} auto chess`,
"auto battler gameplay",
],
};
const VIDEO_TYPE_TAGS: Record<string, (gameName: string) => string[]> = {
full: (g) => [`${g} full game`, `${g} full gameplay no commentary`, `${g} longplay`],
part: (g) => [`${g} walkthrough`, `${g} playthrough`, `${g} let's play no commentary`],
full_demo: (g) => [
`${g} demo`,
`${g} full demo`,
`${g} demo gameplay no commentary`,
"game demo no commentary",
],
demo_part: (g) => [
`${g} demo part`,
`${g} demo playthrough`,
`${g} demo walkthrough`,
"demo gameplay no commentary",
],
boss: (g) => [`${g} boss fight`, `${g} boss battle`, "boss fight no commentary"],
boss_nohit: (g) => [`${g} boss no hit`, `${g} no damage boss`, "no hit boss fight"],
ending: (g) => [`${g} ending`, `${g} all endings`, `${g} final boss`],
@@ -45,31 +230,102 @@ const VIDEO_TYPE_TAGS: Record<string, (gameName: string) => string[]> = {
secret: (g) => [`${g} secret`, `${g} hidden`, "secret content no commentary"],
comparison: (g) => [`${g} comparison`, `${g} graphics comparison`, "comparison no commentary"],
guide: (g) => [`${g} guide`, `${g} silent guide`, "guide no commentary"],
mods: (g) => [
`${g} mods`,
`${g} modded gameplay`,
"modded gameplay no commentary",
`${g} mod showcase`,
],
collectibles: (g) => [
`${g} all collectibles`,
`${g} 100% collectibles`,
`${g} completionist no commentary`,
`${g} achievement guide`,
],
livestream: (g) => [
"livestream",
"live gameplay",
`${g} live`,
`${g} stream`,
`${g} livestream`,
],
// One pool for the whole gacha bucket — quest-type-specific tags
// would balloon the pool and rarely surface in YouTube search anyway.
// The intro / title / hashtags already carry the per-quest framing.
gacha_quest: (g) => [
`${g} gameplay no commentary`,
`${g} quest`,
`${g} story`,
`${g} walkthrough`,
"gacha game gameplay",
"gacha rpg",
],
};
const MULTILINGUAL_TAGS: Record<string, (gameName: string) => string[]> = {
ja: (g) => [`${g} ゲームプレイ`, `${g} 実況なし`, "ゲームプレイ 実況なし"],
vi: (g) => [`${g} gameplay không bình luận`, `${g} không bình luận`],
es: (g) => [`${g} sin comentarios`, `${g} gameplay completo`],
ko: (g) => [`${g} 게임플레이`, `${g} 무편집`],
zh: (g) => [`${g} 无解说`, `${g} 游戏实况`],
};
function getCoreTags(gameName: string): string[] {
return [
`${gameName} gameplay`,
`${gameName} no commentary`,
/**
* Language-specific "core" tag pool. Replaces the previous English-only
* getCoreTags. Selected by GeneratorInput.language so the channel can
* match the viewer's region.
*/
const CORE_TAGS_BY_LANG: Record<SupportedLanguage, (gameName: string) => string[]> = {
en: (g) => [
`${g} gameplay`,
`${g} no commentary`,
"gameplay no commentary",
`${gameName} walkthrough`,
`${gameName} full game`,
`${gameName} gameplay no commentary`,
];
}
`${g} walkthrough`,
`${g} full game`,
`${g} gameplay no commentary`,
],
vi: (g) => [
`${g} gameplay`,
`${g} không bình luận`,
`${g} gameplay không bình luận`,
"gameplay không bình luận",
`${g} chơi thử`,
`${g} let's play`,
],
ja: (g) => [
`${g} ゲームプレイ`,
`${g} 実況なし`,
"ゲームプレイ 実況なし",
`${g} 攻略`,
`${g} プレイ動画`,
`${g} 実況プレイ`,
],
es: (g) => [
`${g} gameplay`,
`${g} sin comentarios`,
"gameplay sin comentarios",
`${g} completo`,
`${g} guía`,
`${g} español`,
],
ko: (g) => [`${g} 게임플레이`, `${g} 무편집`, "게임플레이 무편집", `${g} 공략`, `${g} 플레이`, `${g} 한국어`],
zh: (g) => [`${g} 游戏实况`, `${g} 无解说`, "游戏实况 无解说", `${g} 攻略`, `${g} 流程`, `${g} 通关`],
};
/**
* Extra region-specific tags added when includeMultilingualTags is true.
* Only the selected language's entry is used — v0.2.0 incorrectly mixed
* all languages regardless of the user's choice.
*/
const MULTILINGUAL_TAGS: Record<SupportedLanguage, (gameName: string) => string[]> = {
en: (g) => [`${g} english`, "gameplay english no commentary"],
ja: (g) => [`${g} 日本語`, `${g} 実況`, "日本語 ゲームプレイ"],
vi: (g) => [`${g} tiếng Việt`, `${g} thuyết minh`, "gameplay tiếng Việt"],
es: (g) => [`${g} español`, `${g} en español`, "gameplay en español"],
ko: (g) => [`${g} 한국어`, `${g} 플레이`, "한국어 게임플레이"],
zh: (g) => [`${g} 中文`, `${g} 游戏`, "中文 游戏实况"],
};
function getPlatformTags(gameName: string, platform: string): string[] {
if (!platform) return [];
const platformLabel = platform.toUpperCase();
return [`${gameName} ${platformLabel}`, `${platformLabel} gameplay`, `${gameName} ${platformLabel} gameplay`];
return [
`${gameName} ${platformLabel}`,
`${platformLabel} gameplay`,
`${gameName} ${platformLabel} gameplay`,
];
}
function getQualityTags(gameName: string, resolution?: string, fps?: string): string[] {
@@ -88,7 +344,8 @@ function getQualityTags(gameName: string, resolution?: string, fps?: string): st
function getTrendingTags(gameName: string, genre: string): string[] {
const year = new Date().getFullYear().toString();
return [`${gameName} ${year}`, `best ${genre} games ${year}`, `${genre} gameplay ${year}`];
const genreLabel = humanizeId(genre);
return [`${gameName} ${year}`, `best ${genreLabel} games ${year}`, `${genreLabel} gameplay ${year}`];
}
export interface TagOptions {
@@ -98,45 +355,73 @@ export interface TagOptions {
export function generateTags(input: GeneratorInput, options?: TagOptions): string[] {
const { includeMultilingualTags = true, includeTrendingTags = true } = options ?? {};
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
const rawName = input.gameNameLocalized?.[input.language] ?? input.gameName;
// Two friendly forms of the game name:
// • bareNameTag — fits the per-tag 30-char limit; always added so the
// game name appears as a standalone tag even when long.
// • composeName — shorter still, used inside composite tags like
// `${name} gameplay` so the composites also fit ≤ 30.
// For short names both equal `rawName` and behaviour matches v0.7.
const bareNameTag =
rawName.length <= YT_LIMITS.SINGLE_TAG_MAX
? rawName
: tagFriendlyGameName(rawName, YT_LIMITS.SINGLE_TAG_MAX);
const composeName =
rawName.length <= COMPOSITE_NAME_BUDGET
? rawName
: tagFriendlyGameName(rawName, COMPOSITE_NAME_BUDGET);
const allTags: string[] = [];
// Core tags (highest priority)
allTags.push(...getCoreTags(gameName));
// Always seed the bare game-name tag(s) so they survive dedup even when
// the pool composites overflow.
if (bareNameTag) allTags.push(bareNameTag);
if (composeName && composeName !== bareNameTag) allTags.push(composeName);
// Genre tags
const genreFn = GENRE_TAG_REGISTRY[input.genre];
if (genreFn) {
allTags.push(...genreFn(gameName));
// Core tags — language-specific (highest priority)
const coreFn = CORE_TAGS_BY_LANG[input.language] ?? CORE_TAGS_BY_LANG.en;
allTags.push(...coreFn(composeName));
// Genre tags — merge contributions from every selected genre.
// Final dedup at the bottom collapses overlap across the pools.
for (const genre of input.genres) {
const genreFn = GENRE_TAG_REGISTRY[genre];
if (genreFn) {
allTags.push(...genreFn(composeName));
}
}
// Video type tags
const typeFn = VIDEO_TYPE_TAGS[input.videoType];
if (typeFn) {
allTags.push(...typeFn(gameName));
allTags.push(...typeFn(composeName));
}
// Platform tags
allTags.push(...getPlatformTags(gameName, input.platform));
allTags.push(...getPlatformTags(composeName, input.platform));
// Quality tags
allTags.push(...getQualityTags(gameName, input.resolution, input.fps));
allTags.push(...getQualityTags(composeName, input.resolution, input.fps));
// Multilingual tags
// Multilingual tags — only the selected language (v0.3.0 fix: was
// previously iterating over every language entry).
if (includeMultilingualTags) {
for (const [, langFn] of Object.entries(MULTILINGUAL_TAGS)) {
allTags.push(...langFn(gameName));
const langFn = MULTILINGUAL_TAGS[input.language];
if (langFn) {
allTags.push(...langFn(composeName));
}
}
// Trending tags (lowest priority)
if (includeTrendingTags) {
allTags.push(...getTrendingTags(gameName, input.genre));
// Trending tags (lowest priority). The first genre stands in as the
// "primary" genre for the template — multi-genre games usually have
// one headline category that searchers use.
const primaryGenre = input.genres[0];
if (includeTrendingTags && primaryGenre) {
allTags.push(...getTrendingTags(composeName, primaryGenre));
}
// Dedup (case-insensitive)
// Dedup (case-insensitive) and enforce per-tag char limit
const seen = new Set<string>();
const deduped: string[] = [];
for (const tag of allTags) {
+48 -3
View File
@@ -1,4 +1,10 @@
import type { GeneratorInput, GeneratorOutput, TranslationFn, CharLimitWarning } from "./types";
import type {
GeneratorInput,
GeneratorOutput,
TranslationFn,
CharLimitWarning,
TitleFormatConfig,
} from "./types";
import { buildTitle, checkTitleWarning } from "./title-builder";
import { buildDescription, checkDescriptionWarning } from "./description-builder";
import { generateTags, formatTagString, type TagOptions } from "./tag-generator";
@@ -6,6 +12,35 @@ import { YT_LIMITS } from "./types";
export interface RenderOptions extends TagOptions {
hashtagCount?: number;
/**
* When true, buildTitle appends a `[2K 60FPS]`-style badge to the
* video-type segment whenever resolution/fps are above the defaults.
* Defaults to true at the engine level; callers override with the
* user's setting.
*/
showQualityBadge?: boolean;
/**
* Title formatting knobs (badge position, separator, badge case).
* Partial — any omitted sub-key falls back to the v0.6 default inside
* buildTitle. Flowed from the user's Settings.
*/
titleFormat?: Partial<TitleFormatConfig>;
/**
* When true (and channelName is non-empty), the description ends with
* an auto-generated `© <year> <channelName>. All rights reserved.` line.
*/
showCopyright?: boolean;
/**
* When true, the description appends a localised "usage policy" block
* (📋 USAGE POLICY) after the copyright line.
*/
showUsagePolicy?: boolean;
/**
* When true and both `sponsorName` and `sponsorPlatform` are set on
* the input, the description emits a "🎁 Thanks to …" credit line
* above the music / donate block.
*/
showSponsorCredit?: boolean;
}
export function renderAll(
@@ -13,8 +48,18 @@ export function renderAll(
t: TranslationFn,
options?: RenderOptions,
): GeneratorOutput {
const title = buildTitle(input, t);
const description = buildDescription(input, t, options?.hashtagCount);
const title = buildTitle(input, t, {
showQualityBadge: options?.showQualityBadge ?? true,
badgePosition: options?.titleFormat?.badgePosition,
separator: options?.titleFormat?.separator,
badgeCase: options?.titleFormat?.badgeCase,
});
const description = buildDescription(input, t, {
hashtagCount: options?.hashtagCount,
showCopyright: options?.showCopyright,
showUsagePolicy: options?.showUsagePolicy,
showSponsorCredit: options?.showSponsorCredit,
});
const tags = generateTags(input, options);
const tagString = formatTagString(tags);
+181
View File
@@ -0,0 +1,181 @@
import type { SupportedLanguage, TranslationFn } from "./types";
/**
* Canonical keyword IDs recognized by the parser. Each corresponds to a
* translation key under `timeline.keywords.*` in templates.json.
*/
export type TimelineKeyword =
| "chapter"
| "part"
| "boss"
| "final_boss"
| "intro"
| "ending"
| "tutorial"
| "credits";
export interface TimelineEntry {
/** Raw timecode as it appeared in the input (e.g. "0:00", "1:23:45"). */
time: string;
/** Entire label portion after the timecode (trimmed). */
rawLabel: string;
/** Keyword that the label was classified as, if any. */
keyword?: TimelineKeyword;
/** Ordinal number when the keyword supports one (e.g. Chapter 3 -> 3). */
number?: number;
/** Trailing text after the keyword+number, if any (preserved for context). */
rest?: string;
}
// Regex for extracting time + label from a line. Accepts MM:SS or HH:MM:SS.
const LINE_RE = /^\s*((?:\d{1,2}:)?\d{1,2}:\d{2})\s+(.+?)\s*$/;
// Keyword patterns. Order matters — "final boss" must be tried before "boss".
// Each regex captures the optional number group when applicable.
interface KeywordPattern {
re: RegExp;
keyword: TimelineKeyword;
hasNumber: boolean;
}
const KEYWORD_PATTERNS: KeywordPattern[] = [
// Final boss (multi-language, no number). Must come BEFORE "boss".
{
re: /^(final\s+boss|boss\s+cuối\s+cùng|boss\s+cuối|ラスボス|最終\s*ボス|jefe\s+final|최종\s*보스|最终\s*boss|最终\s*首领)(.*)$/i,
keyword: "final_boss",
hasNumber: false,
},
// Chapter — captures various CJK/Latin forms
{
re: /^(?:chapter|chap\.?|chương|chuong|capítulo|capitulo|第\s*(\d+)\s*章|제\s*(\d+)\s*장|章|장)\s*(\d+)?(.*)$/i,
keyword: "chapter",
hasNumber: true,
},
// Part
{
re: /^(?:part|phần|phan|パート|parte|파트|第\s*(\d+)\s*部|部分)\s*(\d+)?(.*)$/i,
keyword: "part",
hasNumber: true,
},
// Boss (single, with optional number)
{
re: /^(?:boss|ボス|jefe|보스)\s*(\d+)?(.*)$/i,
keyword: "boss",
hasNumber: true,
},
// Intro
{
re: /^(intro|introduction|mở\s+đầu|mo\s+dau|オープニング|オープン|introducción|introduccion|인트로|开场|序幕)(.*)$/i,
keyword: "intro",
hasNumber: false,
},
// Ending
{
re: /^(ending|kết\s+thúc|ket\s+thuc|エンディング|final|엔딩|结局|结尾)(.*)$/i,
keyword: "ending",
hasNumber: false,
},
// Tutorial
{
re: /^(tutorial|hướng\s+dẫn|huong\s+dan|チュートリアル|튜토리얼|教程)(.*)$/i,
keyword: "tutorial",
hasNumber: false,
},
// Credits
{
re: /^(credits|credit|クレジット|créditos|creditos|크레딧|片尾|职员表)(.*)$/i,
keyword: "credits",
hasNumber: false,
},
];
/**
* Parse a raw timestamp textarea value into structured entries.
*
* Each non-empty line is expected to start with a timecode. Lines that
* don't match the `time + label` shape are still preserved as entries
* with `time: ""` so the original text isn't lost.
*/
export function parseTimeline(raw: string): TimelineEntry[] {
const entries: TimelineEntry[] = [];
const lines = raw.split(/\r?\n/);
for (const line of lines) {
if (!line.trim()) continue;
const lineMatch = line.match(LINE_RE);
if (!lineMatch) {
// Not a `time label` line — keep the raw text so nothing disappears.
entries.push({ time: "", rawLabel: line.trim() });
continue;
}
const time = lineMatch[1] ?? "";
const label = lineMatch[2] ?? "";
const entry: TimelineEntry = { time, rawLabel: label };
for (const pattern of KEYWORD_PATTERNS) {
const m = label.match(pattern.re);
if (!m) continue;
entry.keyword = pattern.keyword;
if (pattern.hasNumber) {
// Scan every capture group for the first numeric one. Different
// alternatives (e.g. "第N章" vs "Chapter N") place the number in
// different group positions, so treat them uniformly.
for (let i = 1; i < m.length - 1; i++) {
const g = m[i];
if (g && /^\d+$/.test(g)) {
entry.number = parseInt(g, 10);
break;
}
}
}
const rest = m[m.length - 1];
if (rest && rest.trim()) {
entry.rest = rest.trim();
}
break;
}
entries.push(entry);
}
return entries;
}
/**
* Render parsed entries back into the timestamp block, translating
* recognized keywords into the requested language via i18next.
*
* Lines without a recognized keyword keep their original label so
* the user's free-form text is preserved.
*/
export function renderTimeline(
entries: TimelineEntry[],
_language: SupportedLanguage,
t: TranslationFn,
): string {
const rendered: string[] = [];
for (const entry of entries) {
if (!entry.time) {
rendered.push(entry.rawLabel);
continue;
}
if (!entry.keyword) {
rendered.push(`${entry.time} ${entry.rawLabel}`);
continue;
}
const numberVar = entry.number != null ? String(entry.number) : "";
const translated = t(`timeline.keywords.${entry.keyword}`, { n: numberVar });
const withRest = entry.rest ? `${translated} ${entry.rest}` : translated;
rendered.push(`${entry.time} ${withRest}`);
}
return rendered.join("\n");
}
+200 -13
View File
@@ -1,27 +1,214 @@
import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
import type {
GeneratorInput,
TranslationFn,
CharLimitWarning,
TitleBadgePosition,
TitleSeparatorId,
TitleBadgeCase,
} from "./types";
import { YT_LIMITS } from "./types";
import {
DEFAULT_GACHA_QUEST_TYPE,
GACHA_PART_SUFFIX_STYLES,
type GachaQuestType,
} from "@config/gacha-quest-types";
/**
* Compact "[2K 60FPS]" badge appended to the video-type segment when the
* recording quality is above the defaults (1080p / 60fps).
*
* Rules:
* - 1080p + 60fps → empty string (no badge, keeps the title short).
* - Resolution above 1080p → map 1440p to "2K"; 720p/4K pass through.
* - Non-default FPS → include the resolution alongside (e.g. "1080p 120FPS")
* so a lonely FPS number isn't ambiguous.
*
* Always returns upper-case. Callers apply `badgeCase: "lower"` downstream
* — this function is a label producer, not a display formatter.
*/
export function buildQualityBadge(resolution?: string, fps?: string): string {
const res = resolution || "1080p";
const fpsValue = fps || "60";
const resDefault = res === "1080p";
const fpsDefault = fpsValue === "60";
if (resDefault && fpsDefault) return "";
const resLabel = res === "1440p" ? "2K" : res;
return fpsDefault ? resLabel : `${resLabel} ${fpsValue}FPS`;
}
export interface BuildTitleOptions {
/** When true, a `[2K]`-style badge is appended/prefixed according to
* `badgePosition`. When false, the badge is suppressed regardless of
* resolution/fps. Default: true. */
showQualityBadge?: boolean;
/** Where the badge sits. Default: "middle" (v0.6 behavior). */
badgePosition?: TitleBadgePosition;
/** Separator ID, resolved via `templates.title.separators.<id>`.
* Falls back to the legacy `templates.title.separator` when the
* id-keyed form is missing. Default: "emDash". */
separator?: TitleSeparatorId;
/** Case of the badge label. Default: "upper" (v0.6 behavior). */
badgeCase?: TitleBadgeCase;
}
const DEFAULT_TITLE_OPTIONS: Required<BuildTitleOptions> = {
showQualityBadge: true,
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
};
function normalizeOptions(
optsOrShow: BuildTitleOptions | boolean | undefined,
): Required<BuildTitleOptions> {
if (typeof optsOrShow === "boolean") {
return { ...DEFAULT_TITLE_OPTIONS, showQualityBadge: optsOrShow };
}
return { ...DEFAULT_TITLE_OPTIONS, ...(optsOrShow ?? {}) };
}
interface ComposeArgs {
gameName: string;
videoTypeLabel: string;
suffix: string;
badge: string;
separator: string;
position: TitleBadgePosition;
}
/**
* Assembles the final title string. Three positions supported:
*
* - "middle": badge glues to the video-type segment. If that segment is
* empty (e.g. `full` video type renders as ""), the badge becomes its
* own segment between game name and suffix — preserves the v0.6 edge
* case where a 4K full run still surfaces the quality label.
* - "prefix": `[badge] gameName <sep> videoTypeLabel? <sep> suffix`.
* The badge attaches to the game-name segment with a literal space
* (no separator between badge and game — matches the visual
* convention of `qualityFirst` in title-variants.ts).
* - "suffix": `gameName <sep> videoTypeLabel? <sep> [badge] suffix`.
* Badge prefixes the "Gameplay No Commentary" tail.
*
* When `badge` is empty, all three positions collapse to an identical
* string — tested explicitly in title-builder.test.ts.
*/
function composeTitle(args: ComposeArgs): string {
const { gameName, videoTypeLabel, suffix, badge, separator, position } = args;
const badgeTag = badge ? `[${badge}]` : "";
if (position === "prefix") {
const head = badgeTag ? `${badgeTag} ${gameName}` : gameName;
const parts = [head];
if (videoTypeLabel) parts.push(videoTypeLabel);
parts.push(suffix);
return parts.join(separator);
}
if (position === "suffix") {
const tail = badgeTag ? `${badgeTag} ${suffix}` : suffix;
const parts = [gameName];
if (videoTypeLabel) parts.push(videoTypeLabel);
parts.push(tail);
return parts.join(separator);
}
// position === "middle" (default / v0.6 behavior)
const parts = [gameName];
if (videoTypeLabel) {
parts.push(badgeTag ? `${videoTypeLabel} ${badgeTag}` : videoTypeLabel);
} else if (badgeTag) {
parts.push(badgeTag);
}
parts.push(suffix);
return parts.join(separator);
}
/**
* Build the per-quest-type partNumber suffix for a gacha title — e.g.
* `" - Part 5"`, `" - Day 3"`, `" - Floor 12"`. Driven by the
* {@link GACHA_PART_SUFFIX_STYLES} mapping so each quest type renders
* its own canonical wording. Returns an empty string when the part
* number is blank or the quest type doesn't carry a suffix.
*/
export function buildGachaPartSuffix(
questType: GachaQuestType,
partNumber: string | undefined,
t: TranslationFn,
): string {
const n = (partNumber ?? "").trim();
if (!n) return "";
const style = GACHA_PART_SUFFIX_STYLES[questType];
if (style === "none") return "";
const key = `title.gachaPartSuffix.${style}`;
const resolved = t(key, { n });
return resolved && resolved !== key ? resolved : "";
}
export function buildTitle(
input: GeneratorInput,
t: TranslationFn,
optionsOrShowQualityBadge: BuildTitleOptions | boolean = true,
): string {
const opts = normalizeOptions(optionsOrShowQualityBadge);
// Resolve the separator: prefer the id-keyed form, fall back to the
// legacy single key so locales that haven't been migrated still work.
const separatorKey = `title.separators.${opts.separator}`;
const resolved = t(separatorKey);
const separator = resolved && resolved !== separatorKey ? resolved : t("title.separator");
export function buildTitle(input: GeneratorInput, t: TranslationFn): string {
const separator = t("title.separator");
const suffix = t("title.suffix");
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
let badge = opts.showQualityBadge ? buildQualityBadge(input.resolution, input.fps) : "";
if (badge && opts.badgeCase === "lower") badge = badge.toLowerCase();
// Gacha-quest titles compose their own head segment via the
// per-quest-type i18n template (which already embeds gameName +
// chapterName / questName + the optional partSuffix). The standard
// suffix ("Gameplay No Commentary") still tails the result, and the
// quality badge respects `badgePosition` as usual.
if (input.videoType === "gacha_quest") {
const questType = input.gachaQuestType ?? DEFAULT_GACHA_QUEST_TYPE;
const partSuffix = buildGachaPartSuffix(questType, input.partNumber, t);
const gachaHeadKey = `title.gachaQuestType.${questType}`;
const gachaHead = t(gachaHeadKey, {
gameName,
chapterName: input.chapterName ?? "",
questName: input.questName ?? "",
partSuffix,
});
return composeTitle({
gameName: gachaHead,
videoTypeLabel: "",
suffix,
badge,
separator,
position: opts.badgePosition,
});
}
const videoTypeLabel = t(`title.videoType.${input.videoType}`, {
partNumber: input.partNumber ?? "",
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
});
const gameName =
input.gameNameLocalized?.[input.language] ?? input.gameName;
const parts = [gameName];
if (videoTypeLabel) {
parts.push(videoTypeLabel);
}
parts.push(suffix);
return parts.join(separator);
return composeTitle({
gameName,
videoTypeLabel,
suffix,
badge,
separator,
position: opts.badgePosition,
});
}
export function checkTitleWarning(title: string): CharLimitWarning | null {
+72
View File
@@ -0,0 +1,72 @@
import type { GeneratorInput, TranslationFn } from "./types";
import { buildQualityBadge } from "./title-builder";
export type TitleVariantId = "default" | "typeFirst" | "qualityFirst";
export interface TitleVariant {
id: TitleVariantId;
/** i18n key under `output.variants.*`. */
labelKey: string;
title: string;
}
/**
* Builds three alternative title phrasings so a creator can A/B test
* the same video. Reuses `buildQualityBadge` for consistency with the
* primary title builder — a title with the badge off in
* `useGeneratedOutput` will produce variants without the badge too.
*
* - default: Game — Type [2K 60FPS] — Gameplay No Commentary
* - typeFirst: Type — Game [2K 60FPS] — Gameplay No Commentary
* - qualityFirst: [2K 60FPS] Game — Type — Gameplay No Commentary
*
* When the badge is empty (1080p 60fps or toggle off), `qualityFirst`
* collapses to the default shape so callers don't see a duplicate.
*/
export function buildTitleVariants(
input: GeneratorInput,
t: TranslationFn,
showQualityBadge = true,
): TitleVariant[] {
const separator = t("title.separator");
const suffix = t("title.suffix");
const videoTypeLabel = t(`title.videoType.${input.videoType}`, {
partNumber: input.partNumber ?? "",
bossName: input.bossName ?? "",
dlcName: input.dlcName ?? "",
challengeName: input.challengeName ?? "",
modName: input.modName ?? "",
});
const gameName = input.gameNameLocalized?.[input.language] ?? input.gameName;
const badge = showQualityBadge ? buildQualityBadge(input.resolution, input.fps) : "";
const typeWithBadge = videoTypeLabel && badge ? `${videoTypeLabel} [${badge}]` : videoTypeLabel;
const gameWithBadge = badge ? `${gameName} [${badge}]` : gameName;
const joinNonEmpty = (parts: string[]): string =>
parts.filter((p) => p.length > 0).join(separator);
// Variant 1 — default (game [badge after type])
const defaultParts: string[] = [gameName];
if (typeWithBadge) defaultParts.push(typeWithBadge);
defaultParts.push(suffix);
// Variant 2 — type first, keeps the badge attached to the game name
const typeFirstParts: string[] = [];
if (videoTypeLabel) typeFirstParts.push(videoTypeLabel);
typeFirstParts.push(gameWithBadge);
typeFirstParts.push(suffix);
// Variant 3 — quality badge up front; falls back to default when
// there is no badge so we never render two identical variants.
const qualityFirstTitle = badge
? joinNonEmpty([`[${badge}] ${gameName}`, videoTypeLabel, suffix])
: joinNonEmpty(defaultParts);
return [
{ id: "default", labelKey: "output.variants.default", title: joinNonEmpty(defaultParts) },
{ id: "typeFirst", labelKey: "output.variants.typeFirst", title: joinNonEmpty(typeFirstParts) },
{ id: "qualityFirst", labelKey: "output.variants.qualityFirst", title: qualityFirstTitle },
];
}
+242 -5
View File
@@ -1,6 +1,18 @@
import type {
GraphicsPreset,
RTMode,
FrameGenVendor,
FrameGenMultiplier,
UpscaleQuality,
ArtStyle,
} from "@config/graphics-settings";
import type { GachaQuestType } from "@config/gacha-quest-types";
export type VideoType =
| "full"
| "part"
| "full_demo"
| "demo_part"
| "boss"
| "boss_nohit"
| "ending"
@@ -12,19 +24,37 @@ export type VideoType =
| "side_quest"
| "secret"
| "comparison"
| "guide";
| "guide"
| "mods"
| "collectibles"
| "livestream"
| "gacha_quest";
export type Genre =
| "action"
| "hack_slash"
| "beatemup"
| "platformer"
| "horror"
| "survival_horror"
| "psychological_horror"
| "rpg"
| "jrpg"
| "action_rpg"
| "crpg"
| "fps"
| "arena_shooter"
| "tactical_fps"
| "boomer_shooter"
| "extraction_shooter"
| "shmup"
| "openworld"
| "indie"
| "soulslike"
| "racing"
| "story"
| "simulation"
| "city_builder"
| "fighting"
| "stealth"
| "survival_craft"
@@ -35,19 +65,87 @@ export type Genre =
| "puzzle"
| "tower_defense"
| "card_game"
| "deck_builder"
| "auto_battler"
| "battle_royale"
| "crpg"
| "tactical"
| "space"
| "farming"
| "fmv";
| "fmv"
| "visual_novel";
/**
* Max number of genres a user can multi-select in the editor.
* Tag dedup already collapses overlap, but 3 keeps the UI tidy and
* prevents the tag pool from exploding.
*/
export const MAX_GENRES = 3;
export type SupportedLanguage = "en" | "vi" | "ja" | "es" | "ko" | "zh";
/**
* Pricing category of a store link. Decides the heading wording
* ("GET THE GAME" vs "DOWNLOAD THE GAME") and per-link suffix in the
* generated description.
*/
export type StoreLinkType = "paid" | "free" | "demo";
/**
* Playthrough state (v0.7 phase 2). Explains how the creator is
* approaching this run — viewers repeatedly ask "is this your first
* time?" / "NG+?", so surfacing the answer in the description removes a
* whole class of comment friction.
*
* `"none"` is the sentinel for "creator hasn't picked" → section is
* skipped entirely, not rendered with a blank value.
*/
export const PLAYTHROUGH_STATUSES = [
"none",
"blind",
"replay",
"newgame_plus",
"postgame",
] as const;
export type PlaythroughStatus = (typeof PLAYTHROUGH_STATUSES)[number];
/**
* Difficulty level (v0.7 phase 2). Covers the common ladder across most
* games; `"custom"` reveals a free-form label field for games whose
* difficulty names don't fit (e.g. "Lethal", "Fromsoft default").
* `"none"` → skip the section.
*/
export const DIFFICULTY_LEVELS = [
"none",
"easy",
"normal",
"hard",
"nightmare",
"custom",
] as const;
export type DifficultyLevel = (typeof DIFFICULTY_LEVELS)[number];
/**
* Accessibility-oriented content warnings (v0.7 phase 2). Multi-select:
* a single video can have flashing lights AND loud noises AND jump
* scares. Empty array → skip the section entirely.
*/
export const CONTENT_WARNINGS = [
"flashing_lights",
"loud_noises",
"jump_scares",
] as const;
export type ContentWarning = (typeof CONTENT_WARNINGS)[number];
export interface GeneratorInput {
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
/**
* Selected genres in user-preferred order. The first entry drives the
* genre hashtag and the trending-tag template; the rest contribute
* extra tags through the genre registry (dedup strips overlap).
* Consumers should assume at least one genre is present.
*/
genres: Genre[];
gameName: string;
gameNameLocalized?: Partial<Record<SupportedLanguage, string>>;
channelName: string;
@@ -56,17 +154,128 @@ export interface GeneratorInput {
bossName?: string;
dlcName?: string;
challengeName?: string;
modName?: string;
/**
* Long-form mod credit list (multi-line text). Renders into a separate
* `🧩 MOD LIST` description section when {@link videoType} is `"mods"`.
* Free-form so creators can paste straight from a Wabbajack / Vortex /
* Mod Organizer modlist.
*/
modList?: string;
/** Livestream-only: canonical YouTube/Twitch live URL. */
liveUrl?: string;
/** Livestream-only: ISO datetime (`<input type="datetime-local">`). */
scheduledTime?: string;
/**
* Gacha-quest-only (v0.9 phase 1). Selected quest pattern; drives both
* the per-type title format and the per-type intro template. Defaults
* to `"main_story"` in the editor; missing values in pre-v0.9 drafts
* fall through to `"main_story"` via the editor-store v6→v7 migration.
*/
gachaQuestType?: GachaQuestType;
/**
* Gacha-quest-only: human chapter / story-arc label, e.g.
* `"Chapter 5 Act 2: Where the Stars Fall"`, `"Penacony 2.0"`.
*/
chapterName?: string;
/**
* Gacha-quest-only: individual quest / event name, e.g.
* `"A Solitary Constellation"`. Optional — `main_story`-style videos
* usually rely on `chapterName` only.
*/
questName?: string;
resolution?: string;
fps?: string;
graphicsPreset?: string;
/**
* Graphics-quality preset (v0.8 enum + `"custom"` escape hatch).
* Pre-v0.8 drafts persisted this as free-form text — the editor-store
* v4→v5 migration maps known labels to enum values and routes anything
* else into {@link graphicsPresetCustom}.
*/
graphicsPreset?: GraphicsPreset;
/** Free-form preset name when {@link graphicsPreset} === `"custom"`. */
graphicsPresetCustom?: string;
/**
* When true, the entire 🖥 VIDEO SETTINGS section is omitted from the
* description — for 2D / pixel-art / web games that have no in-game
* graphics settings to talk about.
*/
skipGraphicsSettings?: boolean;
/** Multi-select RT modes layered on the graphics line. */
rayTracingModes?: RTMode[];
/** GPU vendor whose upscaling / frame-gen the creator used. */
frameGenVendor?: FrameGenVendor;
/** Frame-generation multiplier (only meaningful when vendor !== "none"). */
frameGenMultiplier?: FrameGenMultiplier;
/** Upscaling quality (DLSS / FSR / XeSS quality preset). */
upscaleQuality?: UpscaleQuality;
/** High-level art-style descriptor — surfaces a separate line. */
artStyle?: ArtStyle;
/**
* Free-form short string for driver / game version, e.g.
* "GeForce 565.90 | Game v1.4". Surfaces as the trailing token of the
* video-settings line.
*/
versionInfo?: string;
timestamps?: string;
playlistLink?: string;
contactEmail?: string;
/**
* Music / sound attribution credit. Free-form multiline string.
* When set, adds a "🎵 MUSIC / SOUND" section to the description
* before the donate links.
*/
musicAttribution?: string;
/**
* Name of the publisher / developer who provided the game key. Combined
* with {@link sponsorPlatform} and the `showSponsorCredit` render
* option to emit a "🎁 Thanks to …" line in the description.
*/
sponsorName?: string;
/**
* Storefront the provided key unlocks on (e.g. "Steam", "Epic Games").
* Free-form string so regional / non-listed stores still work.
*/
sponsorPlatform?: string;
spoilerWarning: boolean;
matureWarning: boolean;
/**
* Playthrough state — renders a "🎯 Playthrough: …" block above
* `noCommentaryLine`. Defaults to `"none"` (skipped).
*/
playthroughStatus?: PlaythroughStatus;
/**
* Preset / custom difficulty — renders a "🎮 DIFFICULTY" block after
* the Video Settings section. When `"custom"`, the value is taken
* from {@link difficultyCustomLabel} instead of the locale preset.
*/
difficulty?: DifficultyLevel;
/** Free-form label used when `difficulty === "custom"`. */
difficultyCustomLabel?: string;
/**
* Accessibility warnings — renders a "⚠️ CONTENT WARNINGS" bulleted
* block after the spoiler section. Empty / missing → skipped.
*/
contentWarnings?: ContentWarning[];
storeLinks: Partial<Record<string, string>>;
/**
* Parallel map from the same platform id to a pricing category.
* Missing entries default to "paid" so pre-v0.4.0 drafts keep working.
*/
storeLinkTypes?: Partial<Record<string, StoreLinkType>>;
social: Partial<Record<string, string>>;
rig: Partial<Record<string, string>>;
/**
* Vietnam-specific donate metadata (v0.8 polish). The corresponding
* `🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ` description block is gated on
* {@link language} === `"vi"` — non-Vietnamese viewers don't typically
* use VN bank transfer, so the block stays out of their description.
*/
vnBankName?: string;
vnBankAccount?: string;
vnBankHolder?: string;
vnMomo?: string;
vnZalopay?: string;
}
export interface GeneratorOutput {
@@ -100,3 +309,31 @@ export const YT_LIMITS = {
export interface TranslationFn {
(key: string, options?: Record<string, string>): string;
}
/**
* Where the quality-badge ("[2K]") sits relative to the other title segments:
* - "middle" → attached to the video-type segment (v0.6 behavior)
* - "prefix" → before the game name, e.g. "[2K] Elden Ring — …"
* - "suffix" → before the "Gameplay No Commentary" tail
*/
export type TitleBadgePosition = "prefix" | "middle" | "suffix";
/**
* Stable IDs for the segment separator. The actual character is resolved
* per-locale via `templates.title.separators.<id>` so locales can pick
* their own punctuation conventions.
*/
export type TitleSeparatorId = "emDash" | "hyphen" | "colon" | "pipe";
/** Case of the quality-badge label in the rendered title ("2K" vs "2k"). */
export type TitleBadgeCase = "upper" | "lower";
/**
* User-configurable title formatting. Defaults (middle / emDash / upper)
* reproduce v0.6 output byte-for-byte.
*/
export interface TitleFormatConfig {
badgePosition: TitleBadgePosition;
separator: TitleSeparatorId;
badgeCase: TitleBadgeCase;
}
+129
View File
@@ -0,0 +1,129 @@
import { useMemo } from "react";
import { useEditorStore } from "@store/editor-store";
import type { GeneratorInput, SupportedLanguage } from "@engine/types";
/**
* Shapes the editor-store state into a {@link GeneratorInput} — the
* exact blob that every engine function (title / description / tags /
* pinned comment) consumes.
*
* Why a hook: four call sites (two hooks + BatchPage + OutputExtras)
* used to hand-roll the same 25-field object. Adding a new editor
* field meant editing every site; drift was likely. Centralising here
* means one place to update when v0.8 adds more input fields.
*
* Takes an optional `language` override — BatchPage builds the same
* input for multiple languages, so the hook supports passing a target
* instead of reading `state.language` from the store.
*/
export function useCurrentGeneratorInput(languageOverride?: SupportedLanguage): GeneratorInput {
const state = useEditorStore();
return useMemo<GeneratorInput>(
() => ({
videoType: state.videoType,
language: languageOverride ?? state.language,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: state.partNumber,
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
modName: state.modName,
modList: state.modList,
liveUrl: state.liveUrl,
scheduledTime: state.scheduledTime,
gachaQuestType: state.gachaQuestType,
chapterName: state.chapterName,
questName: state.questName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
graphicsPresetCustom: state.graphicsPresetCustom,
skipGraphicsSettings: state.skipGraphicsSettings,
rayTracingModes: state.rayTracingModes,
frameGenVendor: state.frameGenVendor,
frameGenMultiplier: state.frameGenMultiplier,
upscaleQuality: state.upscaleQuality,
artStyle: state.artStyle,
versionInfo: state.versionInfo,
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
sponsorName: state.sponsorName,
sponsorPlatform: state.sponsorPlatform,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
playthroughStatus: state.playthroughStatus,
difficulty: state.difficulty,
difficultyCustomLabel: state.difficultyCustomLabel,
contentWarnings: state.contentWarnings,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
vnBankName: state.vnBankName,
vnBankAccount: state.vnBankAccount,
vnBankHolder: state.vnBankHolder,
vnMomo: state.vnMomo,
vnZalopay: state.vnZalopay,
}),
[
languageOverride,
state.videoType,
state.language,
state.genres,
state.gameName,
state.gameNameLocalized,
state.channelName,
state.platform,
state.partNumber,
state.bossName,
state.dlcName,
state.challengeName,
state.modName,
state.modList,
state.liveUrl,
state.scheduledTime,
state.gachaQuestType,
state.chapterName,
state.questName,
state.resolution,
state.fps,
state.graphicsPreset,
state.graphicsPresetCustom,
state.skipGraphicsSettings,
state.rayTracingModes,
state.frameGenVendor,
state.frameGenMultiplier,
state.upscaleQuality,
state.artStyle,
state.versionInfo,
state.timestamps,
state.playlistLink,
state.contactEmail,
state.musicAttribution,
state.sponsorName,
state.sponsorPlatform,
state.spoilerWarning,
state.matureWarning,
state.playthroughStatus,
state.difficulty,
state.difficultyCustomLabel,
state.contentWarnings,
state.storeLinks,
state.storeLinkTypes,
state.social,
state.rig,
state.vnBankName,
state.vnBankAccount,
state.vnBankHolder,
state.vnMomo,
state.vnZalopay,
],
);
}
+31 -57
View File
@@ -1,66 +1,24 @@
import { useMemo } from "react";
import i18n from "i18next";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { renderAll } from "@engine/template-renderer";
import type { GeneratorOutput, GeneratorInput } from "@engine/types";
import type { GeneratorOutput } from "@engine/types";
import { useCurrentGeneratorInput } from "./use-current-generator-input";
export function useGeneratedOutput(): GeneratorOutput {
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const input = useCurrentGeneratorInput();
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
} = useSettingsStore();
const input: GeneratorInput = useMemo(
() => ({
videoType: state.videoType,
language: state.language,
genre: state.genre,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: state.partNumber,
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
}),
[
state.videoType,
state.language,
state.genre,
state.gameName,
state.gameNameLocalized,
state.channelName,
state.platform,
state.partNumber,
state.bossName,
state.dlcName,
state.challengeName,
state.resolution,
state.fps,
state.graphicsPreset,
state.timestamps,
state.playlistLink,
state.contactEmail,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.social,
state.rig,
],
);
const t = useMemo(() => i18n.getFixedT(state.language, "templates"), [state.language]);
const t = useMemo(() => i18n.getFixedT(input.language, "templates"), [input.language]);
return useMemo(
() =>
@@ -68,7 +26,23 @@ export function useGeneratedOutput(): GeneratorOutput {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
}),
[input, t, includeMultilingualTags, includeTrendingTags, hashtagCount],
[
input,
t,
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
],
);
}
+23 -1
View File
@@ -17,7 +17,7 @@ export function useKeyboardShortcuts({ onToggleHelp }: ShortcutOptions) {
const handleKeyDown = (e: KeyboardEvent) => {
const ctrl = e.ctrlKey || e.metaKey;
if (ctrl && e.key === "Enter") {
if (ctrl && (e.key === "Enter" || e.key === "g" || e.key === "G")) {
e.preventDefault();
navigate("/output");
} else if (ctrl && e.shiftKey && e.key === "C") {
@@ -29,6 +29,16 @@ export function useKeyboardShortcuts({ onToggleHelp }: ShortcutOptions) {
} else if (ctrl && e.key === "/") {
e.preventDefault();
onToggleHelp();
} else if (
// Bare `?` (Shift+/) opens the cheatsheet too. Skip when the
// user is typing into a form field — `?` is a legitimate
// character in titles, descriptions, and other inputs.
e.key === "?" &&
!ctrl &&
!isEditableTarget(e.target)
) {
e.preventDefault();
onToggleHelp();
}
};
@@ -36,3 +46,15 @@ export function useKeyboardShortcuts({ onToggleHelp }: ShortcutOptions) {
return () => window.removeEventListener("keydown", handleKeyDown);
}, [navigate, output.title, output.description, copy, onToggleHelp]);
}
/**
* True when the keydown target is an input the user might be typing
* into. Used to gate bare-character shortcuts (e.g. `?`) so they don't
* hijack normal text entry.
*/
function isEditableTarget(target: EventTarget | null): boolean {
if (!(target instanceof HTMLElement)) return false;
const tag = target.tagName;
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return true;
return target.isContentEditable;
}
+25 -49
View File
@@ -1,76 +1,52 @@
import { useMemo } from "react";
import i18n from "i18next";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { renderAll } from "@engine/template-renderer";
import type { GeneratorInput, GeneratorOutput, SupportedLanguage } from "@engine/types";
import type { GeneratorOutput, SupportedLanguage } from "@engine/types";
import { useCurrentGeneratorInput } from "./use-current-generator-input";
export function useMultilangOutput(
languages: SupportedLanguage[],
): Record<string, GeneratorOutput> {
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const baseInput = useCurrentGeneratorInput();
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
} = useSettingsStore();
return useMemo(() => {
const results: Record<string, GeneratorOutput> = {};
for (const lang of languages) {
const tFn = i18n.getFixedT(lang, "templates");
const input: GeneratorInput = {
videoType: state.videoType,
language: lang,
genre: state.genre,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: state.partNumber,
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
};
const input = { ...baseInput, language: lang };
results[lang] = renderAll(input, tFn, {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
});
}
return results;
}, [
languages,
state.videoType,
state.genre,
state.gameName,
state.gameNameLocalized,
state.channelName,
state.platform,
state.partNumber,
state.bossName,
state.dlcName,
state.challengeName,
state.resolution,
state.fps,
state.graphicsPreset,
state.timestamps,
state.playlistLink,
state.contactEmail,
state.spoilerWarning,
state.matureWarning,
state.storeLinks,
state.social,
state.rig,
baseInput,
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
]);
}
+107 -17
View File
@@ -2,55 +2,145 @@
"ui": {
"app": ["title", "subtitle"],
"tabs": ["editor", "output", "profiles", "history", "settings", "batch", "playlist", "logs"],
"editor.sections": ["gameInfo", "videoSettings", "contentDetails", "attribution", "rig", "storeAndSocial"],
"editor": [
"videoType", "language", "genre", "gameName", "gameNamePlaceholder",
"channelName", "channelNamePlaceholder", "platform",
"partNumber", "partNumberPlaceholder", "bossName", "bossNamePlaceholder",
"dlcName", "dlcNamePlaceholder", "challengeName", "challengeNamePlaceholder",
"modName", "modNamePlaceholder",
"modList", "modListPlaceholder",
"gachaQuestType",
"chapterName", "chapterNamePlaceholder",
"questName", "questNamePlaceholder",
"vnDonate", "vnDonateHelp",
"vnBankName", "vnBankNamePlaceholder",
"vnBankAccount", "vnBankAccountPlaceholder",
"vnBankHolder", "vnBankHolderPlaceholder",
"vnMomo", "vnMomoPlaceholder",
"vnZalopay", "vnZalopayPlaceholder",
"resolution", "fps", "graphicsPreset",
"graphicsPresetCustom", "graphicsPresetCustomPlaceholder",
"skipGraphicsSettings", "skipGraphicsSettingsHelp",
"rayTracing", "frameGenVendor", "frameGenMultiplier", "upscaleQuality",
"artStyle", "versionInfo", "versionInfoPlaceholder",
"liveUrl", "liveUrlPlaceholder", "scheduledTime",
"skipGraphicsHintLabel", "skipGraphicsHintHide", "skipGraphicsHintKeep",
"timestamps", "timestampsPlaceholder",
"storeLinks", "rig", "social", "warnings",
"storeLinks", "storeLinkType", "rig", "social", "warnings",
"spoilerWarning", "matureWarning",
"playlistLink", "playlistLinkPlaceholder",
"contactEmail", "contactEmailPlaceholder", "contactEmailHelp",
"videoSettings", "quickPreview",
"clearDraft", "draftSaved", "clearDraftConfirm"
"musicAttribution", "musicAttributionPlaceholder",
"sponsorName", "sponsorNamePlaceholder",
"sponsorPlatform", "sponsorPlatformPlaceholder",
"thumbnailText", "thumbnailTextPlaceholder",
"pinnedComment", "pinnedCommentPlaceholder",
"playthrough", "difficulty", "difficultyCustomLabel", "difficultyCustomPlaceholder",
"contentWarnings",
"videoSettings", "quickPreview", "version",
"clearDraft", "draftSaved", "clearDraftConfirm",
"genreSearchPlaceholder", "genreSearchNoResults"
],
"editor.genreGroups": ["rpg", "shooter", "horror"],
"editor.graphicsPresetOptions": ["low", "medium", "high", "very_high", "cinematic", "ultra", "extreme", "custom"],
"editor.rtOptions": ["ray_tracing", "full_rt", "path_tracing", "ray_reconstruction"],
"editor.frameGenVendorOptions": ["none", "nvidia", "amd", "intel"],
"editor.frameGenMultiplierOptions": ["none", "x2", "x3", "x4", "x6"],
"editor.upscaleQualityOptions": ["none", "native_aa", "quality", "balanced", "performance", "ultra_performance"],
"editor.artStyleOptions": ["none", "realistic", "stylized", "anime", "cel_shaded", "low_poly", "voxel", "pixel_art", "hand_drawn", "comic", "photorealistic"],
"editor.toast": ["urlAutoFilled"],
"editor.warning": ["linkNameMismatch"],
"editor.playthroughOptions": ["none", "blind", "replay", "newgame_plus", "postgame"],
"editor.difficultyOptions": ["none", "easy", "normal", "hard", "nightmare", "custom"],
"editor.contentWarningOptions": ["flashing_lights", "loud_noises", "jump_scares"],
"editor.gachaQuestTypeOptions": [
"main_story", "world_quest", "side_quest", "spinoff_quest", "companion_quest", "bond_quest",
"event", "anniversary", "crossover", "dating_event",
"tutorial_quest", "guide_quest", "trial_quest",
"endgame", "coop", "daily_commission",
"showcase"
],
"editor.gachaQuestTypeGroups": ["story", "events", "tutorial_trial", "endgame_multiplayer", "showcase"],
"storeLinkTypes": ["paid", "free", "demo"],
"output": [
"title", "description", "tags",
"copyTitle", "copyDescription", "copyTags", "copyAll",
"copied", "charCount", "selectLanguages"
"copied", "charCount", "selectLanguages",
"thumbnailText", "copyThumbnailText",
"pinnedComment", "copyPinnedComment",
"pinnedCommentTemplate", "copyPinnedCommentTemplate",
"generateAlternatives", "saveAsTemplate"
],
"common": ["save", "cancel", "delete", "confirm", "export", "import", "reset", "search", "generate"],
"videoTypes": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"genres": ["action", "horror", "rpg", "fps", "openworld", "indie", "soulslike", "racing", "story", "simulation", "fighting", "stealth", "survival_craft", "roguelike", "metroidvania", "mmo", "rhythm", "puzzle", "tower_defense", "card_game", "battle_royale", "crpg", "tactical", "space", "farming", "fmv"],
"rig": ["cpu", "gpu", "ram", "storage", "monitor", "capture", "motherboard", "controller"],
"output.variants": ["default", "typeFirst", "qualityFirst"],
"common": ["save", "cancel", "delete", "confirm", "export", "import", "reset", "search", "generate", "undo", "dismiss"],
"videoTypes": ["full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles", "livestream", "gacha_quest"],
"genres": ["action", "hack_slash", "beatemup", "platformer", "horror", "survival_horror", "psychological_horror", "rpg", "jrpg", "action_rpg", "crpg", "fps", "arena_shooter", "tactical_fps", "boomer_shooter", "extraction_shooter", "shmup", "openworld", "indie", "soulslike", "racing", "story", "simulation", "city_builder", "fighting", "stealth", "survival_craft", "roguelike", "metroidvania", "mmo", "rhythm", "puzzle", "tower_defense", "card_game", "deck_builder", "auto_battler", "battle_royale", "tactical", "space", "farming", "fmv", "visual_novel"],
"rig": ["cpu", "gpu", "ram", "storage", "monitor", "capture", "motherboard", "controller", "video_editor"],
"social": ["kofi", "patreon", "buymeacoffee", "paypal", "github", "twitter", "discord", "website", "twitch", "tiktok", "instagram", "streamlabs", "bluesky", "mastodon", "facebook", "fb_page", "fb_group"],
"resolutions": ["720p", "1080p", "1440p", "4K"],
"fpsOptions": ["30", "60", "120", "144"],
"profiles": ["title", "createNew", "editProfile", "profileName", "profileNamePlaceholder", "loadProfile", "deleteConfirm", "emptyState", "exportProfiles", "importProfiles"],
"presets": ["title", "createNew", "editPreset", "loadPreset", "deleteConfirm", "emptyState", "selectPreset", "noPresets", "exportPresets", "importPresets"],
"templates": ["title", "createNew", "saveAsTemplate", "templateName", "templateNamePlaceholder", "loadTemplate", "deleteConfirm", "emptyState", "saveHint", "savedAs", "appliedToast", "exportTemplates", "importTemplates"],
"history": ["title", "emptyState", "clearAll", "clearConfirm", "searchPlaceholder"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "appLanguage", "defaultOutputLanguage", "defaultGenre", "autoSaveDraft", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount"],
"settings": ["title", "appearance", "defaults", "editorSettings", "tagSettings", "historySettings", "theme", "appLanguage", "defaultOutputLanguage", "defaultGenre", "showCharCount", "compactTagDisplay", "historyLimit", "multilingualTags", "trendingTags", "hashtagCount", "showQualityBadge", "showCopyright", "showUsagePolicy", "showSponsorCredit", "titleFormatTitle", "descriptionSettingsTitle", "badgePosition", "badgePositionPrefix", "badgePositionMiddle", "badgePositionSuffix", "titleSeparator", "titleSeparatorEmDash", "titleSeparatorHyphen", "titleSeparatorColon", "titleSeparatorPipe", "badgeCase", "badgeCaseUpper", "badgeCaseLower", "showPinnedCommentTemplate", "pinnedCommentIncludeAskNextGame", "pinnedCommentIncludeGenrePlaylist", "genrePlaylistsTitle", "genrePlaylistsHelp", "genrePlaylistsEmptyHint"],
"batch": ["title", "startPart", "endPart", "generateBatch", "copyAllBatch", "emptyState"],
"shortcuts": ["title", "generate", "copyAll", "saveDraft", "help", "close"],
"validation": ["emailInvalid", "emailMaxExceeded", "urlInvalid", "urlPrefixMismatch"],
"shortcuts": ["title", "generate", "copyAll", "saveDraft", "help", "close", "searchPlaceholder", "noResults"],
"validation": ["emailInvalid", "emailMaxExceeded", "urlInvalid", "urlPrefixMismatch", "playlistUrlInvalid"],
"logs": ["title", "emptyState", "clearAll", "clearConfirm", "searchPlaceholder"],
"playlist": ["title", "status", "contentType", "totalVideos", "customNote", "generatePlaylist"]
},
"templates": {
"title": ["separator", "suffix"],
"title.videoType": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"description.intro": ["full", "part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide"],
"title.separators": ["emDash", "hyphen", "colon", "pipe"],
"title.videoType": ["full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles", "livestream", "gacha_quest"],
"title.gachaQuestType": [
"main_story", "world_quest", "side_quest", "spinoff_quest", "companion_quest", "bond_quest",
"event", "anniversary", "crossover", "dating_event",
"tutorial_quest", "guide_quest", "trial_quest",
"endgame", "coop", "daily_commission",
"showcase"
],
"title.gachaPartSuffix": ["part", "day", "floor"],
"description.intro": [
"full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending", "speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest", "secret", "comparison", "guide", "mods", "collectibles", "livestream",
"gacha_quest_main_story", "gacha_quest_world_quest", "gacha_quest_side_quest", "gacha_quest_spinoff_quest", "gacha_quest_companion_quest", "gacha_quest_bond_quest",
"gacha_quest_event", "gacha_quest_anniversary", "gacha_quest_crossover", "gacha_quest_dating_event",
"gacha_quest_tutorial_quest", "gacha_quest_guide_quest", "gacha_quest_trial_quest",
"gacha_quest_endgame", "gacha_quest_coop", "gacha_quest_daily_commission",
"gacha_quest_showcase"
],
"description": ["noCommentaryLine"],
"description.sections": [
"timestamps", "storeLinks", "videoSettings", "rig",
"spoilerWarning", "matureWarning", "donate", "social",
"playlist", "contact", "cta"
"timestamps", "storeLinksBuy", "storeLinksDownload", "videoSettings", "rig",
"modList", "vnDonate",
"spoilerWarning", "matureWarning", "sponsorCredit", "music", "donate", "social",
"playlist", "contact", "cta",
"copyright", "usagePolicyHeader", "usagePolicy",
"playthrough", "difficulty", "contentWarnings"
],
"description.playthrough": ["blind", "replay", "newgame_plus", "postgame"],
"description.difficulty": ["easy", "normal", "hard", "nightmare"],
"description.contentWarnings": ["flashing_lights", "loud_noises", "jump_scares"],
"description.storeLinkSuffix": ["free", "demo"],
"description.graphics": ["with", "artStyle", "videoLabel", "inGameSettingLabel", "versionLabel"],
"description.graphics.presetOptions": ["low", "medium", "high", "very_high", "cinematic", "ultra", "extreme"],
"description.graphics.rtOptions": ["ray_tracing", "full_rt", "path_tracing", "ray_reconstruction"],
"description.graphics.upscaleQualityOptions": ["native_aa", "quality", "balanced", "performance", "ultra_performance"],
"description.graphics.artStyleOptions": ["realistic", "stylized", "anime", "cel_shaded", "low_poly", "voxel", "pixel_art", "hand_drawn", "comic", "photorealistic"],
"description.livestream": ["scheduledLine", "watchLine"],
"pinnedComment": ["thanksForWatching", "playlistPrompt", "engagementPrompt", "askNextGame", "genrePlaylistSuggestion"],
"pinnedComment.greetings": [
"full", "part", "full_demo", "demo_part", "boss", "boss_nohit", "ending",
"speedrun", "100percent", "dlc", "newgame_plus", "challenge", "side_quest",
"secret", "comparison", "guide", "mods", "collectibles", "livestream",
"gacha_quest"
],
"hashtags": ["gameplay", "noCommentary", "genre"],
"playlist.status": ["completed", "dropped", "incomplete", "in_progress"],
"playlist": ["titleFormat", "videoCount", "storeSection", "footer"],
"playlist.description": ["full_gameplay", "boss_fights", "speedrun", "all_endings", "dlc", "100_percent", "guide", "highlights"]
"playlist.description": ["full_gameplay", "boss_fights", "speedrun", "all_endings", "dlc", "100_percent", "guide", "highlights"],
"timeline.keywords": ["chapter", "part", "boss", "final_boss", "intro", "ending", "tutorial", "credits"]
}
}
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "Part {{partNumber}}",
"full_demo": "Demo",
"demo_part": "Demo Part {{partNumber}}",
"boss": "{{bossName}} Boss Fight",
"boss_nohit": "{{bossName}} Boss No Hit",
"ending": "Ending",
@@ -16,13 +24,43 @@
"side_quest": "Side Quest",
"secret": "Secret",
"comparison": "Comparison",
"guide": "Guide"
"guide": "Guide",
"mods": "{{modName}} Mods",
"collectibles": "All Collectibles",
"livestream": "🔴 LIVE",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — World Quest: {{questName}}",
"side_quest": "{{gameName}} — Side Quest: {{questName}}",
"spinoff_quest": "{{gameName}} — Spinoff: {{questName}}",
"companion_quest": "{{gameName}} — Companion Quest: {{questName}}",
"bond_quest": "{{gameName}} — Bond Quest: {{questName}}",
"event": "{{gameName}} — Event: {{questName}}",
"anniversary": "{{gameName}} — {{chapterName}} Anniversary{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Dating Event: {{questName}}",
"tutorial_quest": "{{gameName}} — Tutorial: {{questName}}",
"guide_quest": "{{gameName}} — Guide: {{questName}}",
"trial_quest": "{{gameName}} — Trial: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Daily Commissions{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Part {{n}}",
"day": " - Day {{n}}",
"floor": " - Floor {{n}}"
}
},
"description": {
"intro": {
"full": "This video features the full gameplay of {{gameName}} on {{channelName}}.",
"part": "This video features Part {{partNumber}} of {{gameName}} on {{channelName}}.",
"full_demo": "This video features the full demo of {{gameName}} on {{channelName}}.",
"demo_part": "This video features Part {{partNumber}} of the {{gameName}} demo on {{channelName}}.",
"boss": "This video features the {{bossName}} boss fight from {{gameName}} on {{channelName}}.",
"boss_nohit": "This video features the {{bossName}} boss fight (No Hit) from {{gameName}} on {{channelName}}.",
"ending": "This video features the ending of {{gameName}} on {{channelName}}.",
@@ -34,21 +72,147 @@
"side_quest": "This video features side quests and optional content from {{gameName}} on {{channelName}}.",
"secret": "This video features secrets and hidden content from {{gameName}} on {{channelName}}.",
"comparison": "This video compares the graphics/performance of {{gameName}} on {{channelName}}.",
"guide": "This video is a silent guide for {{gameName}} on {{channelName}}."
"guide": "This video is a silent guide for {{gameName}} on {{channelName}}.",
"mods": "This video features the {{modName}} mod for {{gameName}} on {{channelName}}.",
"collectibles": "This video covers all collectibles and 100% completion of {{gameName}} on {{channelName}}.",
"livestream": "Live stream of {{gameName}} on {{channelName}}. Join the chat and say hi!",
"gacha_quest_main_story": "Welcome to {{chapterName}} of {{gameName}} on {{channelName}}!",
"gacha_quest_world_quest": "Today's video covers the World Quest \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_side_quest": "Side Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_spinoff_quest": "Spinoff quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_companion_quest": "Companion Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_bond_quest": "Bond Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_event": "Limited-time Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_anniversary": "{{chapterName}} Anniversary celebration in {{gameName}} on {{channelName}}.",
"gacha_quest_crossover": "Crossover Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_dating_event": "Dating Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_tutorial_quest": "Tutorial \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_guide_quest": "Guide Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_trial_quest": "Trial Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_endgame": "Endgame mode \"{{chapterName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_coop": "Co-op session \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_daily_commission": "Daily Commissions in {{gameName}} on {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" from {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "No Commentary — pure gameplay for your enjoyment.",
"storeLinkSuffix": {
"free": "free",
"demo": "free demo"
},
"sections": {
"timestamps": "⏱ TIMESTAMPS",
"storeLinks": "🎮 GET THE GAME",
"storeLinksBuy": "🎮 GET THE GAME (if you want to buy)",
"storeLinksDownload": "⬇️ DOWNLOAD THE GAME (if you want to play)",
"videoSettings": "🖥 VIDEO SETTINGS",
"rig": "💻 MY RIG",
"modList": "🧩 MOD LIST",
"vnDonate": "🏦 BANK TRANSFER / E-WALLET (Vietnam)",
"spoilerWarning": "⚠️ SPOILER WARNING: This video may contain spoilers. Watch at your own risk!",
"matureWarning": "🔞 MATURE CONTENT (18+): Contains violence / strong language / graphic content.",
"sponsorCredit": "🎁 Thanks to {{sponsor}} for providing the {{platform}} key of this game.",
"music": "🎵 MUSIC / SOUND",
"donate": "☕ SUPPORT THE CHANNEL",
"social": "🔗 FOLLOW ME",
"playlist": "▶️ Watch the full series: {{link}}",
"contact": "📧 Business inquiries: {{email}}",
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share"
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 USAGE POLICY",
"usagePolicy": "• Always credit with a link to the original video AND channel (at minimum in the description).\n• Don't re-upload the full video or large portions as your own content.\n• Don't monetize footage without explicit consent.\n• Don't edit footage to misrepresent the original content or creator.\n• Compilation, review, commentary, and reaction videos are OK — as long as you credit.\nIf in doubt, reach out via the social links or email in the description.",
"playthrough": "🎯 Playthrough: {{value}}",
"difficulty": "🎮 DIFFICULTY",
"contentWarnings": "⚠️ CONTENT WARNINGS"
},
"playthrough": {
"blind": "Blind run (first time playing)",
"replay": "Replay (returning to this one)",
"newgame_plus": "New Game+",
"postgame": "Post-game / endgame content"
},
"difficulty": {
"easy": "Easy",
"normal": "Normal",
"hard": "Hard",
"nightmare": "Nightmare / Extreme"
},
"contentWarnings": {
"flashing_lights": "⚡ Flashing lights / strobe effects",
"loud_noises": "🔊 Loud noises / sudden volume spikes",
"jump_scares": "😱 Jump scares"
},
"graphics": {
"with": "with",
"artStyle": "Art Style",
"presetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 LIVE on {{time}}",
"watchLine": "Watch / replay: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "Thanks for watching! Hope you enjoyed the gameplay.",
"playlistPrompt": "📺 Watch the full series here: {{link}}",
"engagementPrompt": "Don't forget to like & subscribe if you want to see more — it really helps out the channel 💚",
"askNextGame": "💬 What game should I play next? Drop your suggestions below!",
"genrePlaylistSuggestion": "📺 More {{genreLabel}} gameplay on the channel: {{link}}",
"greetings": {
"full": "This one's the full run of {{gameName}} — hope you enjoy every minute of it.",
"part": "Welcome back to {{gameName}} on {{channelName}}!",
"full_demo": "Full demo of {{gameName}} — should I play the full game when it launches?",
"demo_part": "Demo continues — hyped for the full release. Are you in?",
"boss": "That boss was a ride. Let me know in the comments how your fight went!",
"boss_nohit": "No-hit run — took a few tries. If you enjoyed the attempt, drop a like!",
"ending": "⚠️ That's the ending — thanks for following the journey on {{channelName}}.",
"speedrun": "Speedrun attempt complete — times and routes welcome in the comments!",
"100percent": "100% complete 🏆 Thanks for sticking with the run to the very end.",
"dlc": "DLC run for {{gameName}} — let me know which moment hit hardest.",
"newgame_plus": "NG+ means harder everything. Respect to anyone replaying with me.",
"challenge": "Challenge run complete. Respect to anyone attempting the same.",
"side_quest": "Side-quest detour — thanks for the break from the main story!",
"secret": "Secret content unlocked 🔓 Let me know if you want more deep-dive hunts.",
"comparison": "Graphics comparison for {{gameName}} — which one wins for you?",
"guide": "Hope this silent guide helped. Timestamps in the description.",
"mods": "Modded run — full load order / credits in the description.",
"collectibles": "Every collectible in one video. Thanks for the support!",
"livestream": "Welcome to the stream of {{gameName}}! Drop a hello in the chat 👋",
"gacha_quest": "Welcome back to {{gameName}} on {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 Incomplete",
"in_progress": "▶️ In Progress"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video(s)",
"storeSection": "🎮 Get the game:",
"footer": "👍 Like | 🔔 Subscribe for more gameplay!",
@@ -77,5 +241,17 @@
"guide": "This playlist is a silent guide for {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
"highlights": "This playlist contains gameplay highlights from {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience."
}
},
"timeline": {
"keywords": {
"chapter": "Chapter {{n}}",
"part": "Part {{n}}",
"boss": "Boss {{n}}",
"final_boss": "Final Boss",
"intro": "Intro",
"ending": "Ending",
"tutorial": "Tutorial",
"credits": "Credits"
}
}
}
+272 -16
View File
@@ -14,6 +14,14 @@
"logs": "Logs"
},
"editor": {
"sections": {
"gameInfo": "Game Info",
"videoSettings": "Video Settings",
"contentDetails": "Content Details",
"attribution": "Attribution",
"rig": "My Rig",
"storeAndSocial": "Store & Social"
},
"videoType": "Video Type",
"language": "Output Language",
"genre": "Game Genre",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "e.g. Shadow of the Erdtree",
"challengeName": "Challenge Name",
"challengeNamePlaceholder": "e.g. No Hit Run",
"modName": "Mod Name",
"modNamePlaceholder": "e.g. Requiem, NaturalVision Evolved",
"modList": "Mod List",
"modListPlaceholder": "List the mods you used, one per line. Paste from your mod manager works.",
"gachaQuestType": "Quest Type",
"gachaQuestTypeOptions": {
"main_story": "Main Story",
"world_quest": "World Quest",
"side_quest": "Side Quest",
"spinoff_quest": "Spinoff Quest",
"companion_quest": "Companion Quest",
"bond_quest": "Bond Quest",
"event": "Event",
"anniversary": "Anniversary",
"crossover": "Crossover",
"dating_event": "Dating Event",
"tutorial_quest": "Tutorial",
"guide_quest": "Guide Quest",
"trial_quest": "Trial Quest",
"endgame": "Endgame Mode",
"coop": "Co-op",
"daily_commission": "Daily Commissions",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Story",
"events": "Events",
"tutorial_trial": "Tutorial / Trial",
"endgame_multiplayer": "Endgame / Multiplayer",
"showcase": "Showcase"
},
"chapterName": "Chapter / Story Arc",
"chapterNamePlaceholder": "e.g. Chapter 5 Act 2: Where the Stars Fall",
"questName": "Quest Name",
"questNamePlaceholder": "e.g. A Solitary Constellation",
"vnDonate": "Donate (Vietnam)",
"vnDonateHelp": "Only rendered into the description when output language is Vietnamese.",
"vnBankName": "Bank name",
"vnBankNamePlaceholder": "e.g. Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Account number",
"vnBankAccountPlaceholder": "e.g. 0123456789",
"vnBankHolder": "Account holder",
"vnBankHolderPlaceholder": "e.g. NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "MoMo phone number",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "ZaloPay phone number",
"resolution": "Resolution",
"fps": "FPS",
"graphicsPreset": "Graphics Preset",
"graphicsPresetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme",
"custom": "Custom…"
},
"graphicsPresetCustom": "Custom preset name",
"graphicsPresetCustomPlaceholder": "e.g. Epic, Maximum",
"skipGraphicsSettings": "This game has no in-game graphics settings",
"skipGraphicsSettingsHelp": "Hide the Video Settings section in the description for 2D / pixel-art / web games.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Frame Gen Vendor",
"frameGenVendorOptions": {
"none": "None",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Frame Gen Multiplier",
"frameGenMultiplierOptions": {
"none": "None",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Upscaling Quality",
"upscaleQualityOptions": {
"none": "None",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Art Style",
"artStyleOptions": {
"none": "— Not set —",
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"versionInfo": "Driver / Game Version",
"versionInfoPlaceholder": "e.g. GeForce 565.90 | Game v1.4",
"liveUrl": "Live URL",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Scheduled Time",
"skipGraphicsHintLabel": "This looks like a game without graphics settings — hide the section?",
"skipGraphicsHintHide": "Hide",
"skipGraphicsHintKeep": "Keep",
"timestamps": "Timestamps",
"timestampsPlaceholder": "0:00 Intro\n5:30 Chapter 1\n15:00 Boss Fight",
"storeLinks": "Store Links",
"storeLinkType": "Type",
"rig": "My Rig",
"social": "Social & Donate Links",
"warnings": "Warnings",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Contact Email",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "Music / Sound Attribution",
"musicAttributionPlaceholder": "Music by Karl Casey @ White Bat Audio\nSFX from Freesound.org",
"sponsorName": "Sponsor (publisher / developer)",
"sponsorNamePlaceholder": "e.g. Ubisoft, Capcom, Devolver Digital",
"sponsorPlatform": "Key platform",
"sponsorPlatformPlaceholder": "e.g. Steam, Epic Games, GOG",
"thumbnailText": "Thumbnail Text",
"thumbnailTextPlaceholder": "e.g. SECRET BOSS NO HIT",
"pinnedComment": "Pinned Comment Template",
"pinnedCommentPlaceholder": "What should viewers do if they liked the video?",
"playthrough": "Playthrough",
"playthroughOptions": {
"none": "— Not set —",
"blind": "Blind (first time)",
"replay": "Replay",
"newgame_plus": "New Game+",
"postgame": "Post-game / endgame"
},
"difficulty": "Difficulty",
"difficultyOptions": {
"none": "— Not set —",
"easy": "Easy",
"normal": "Normal",
"hard": "Hard",
"nightmare": "Nightmare / Extreme",
"custom": "Custom…"
},
"difficultyCustomLabel": "Custom difficulty label",
"difficultyCustomPlaceholder": "e.g. Lethal, NG+7, Fromsoft default",
"contentWarnings": "Content warnings",
"contentWarningOptions": {
"flashing_lights": "⚡ Flashing lights",
"loud_noises": "🔊 Loud noises",
"jump_scares": "😱 Jump scares"
},
"videoSettings": "Video Settings",
"quickPreview": "Quick Preview",
"version": "Version",
"clearDraft": "Clear Draft",
"draftSaved": "Draft saved",
"clearDraftConfirm": "Are you sure you want to clear all form data?",
"contactEmailHelp": "Up to 3 emails, comma-separated"
"genreSearchPlaceholder": "Search genres",
"genreSearchNoResults": "No matching genres",
"genreGroups": {
"rpg": "All RPGs",
"shooter": "All Shooters",
"horror": "All Horror"
},
"contactEmailHelp": "Up to 3 emails, comma-separated",
"toast": {
"urlAutoFilled": "Auto-filled '{{name}}' from URL"
},
"warning": {
"linkNameMismatch": "Check link and add again — '{{host}}' suggests '{{suggestedName}}', but Game Name is '{{gameName}}'."
}
},
"output": {
"title": "Title",
@@ -62,7 +234,20 @@
"copyAll": "Copy All",
"copied": "Copied!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Select Languages"
"selectLanguages": "Select Languages",
"thumbnailText": "Thumbnail Text",
"copyThumbnailText": "Copy thumbnail text",
"pinnedComment": "Pinned Comment",
"copyPinnedComment": "Copy pinned comment",
"pinnedCommentTemplate": "Pinned Comment (Template)",
"copyPinnedCommentTemplate": "Copy pinned comment template",
"generateAlternatives": "Generate Alternatives",
"saveAsTemplate": "Save as Template",
"variants": {
"default": "Default",
"typeFirst": "Type First",
"qualityFirst": "Quality First"
}
},
"common": {
"save": "Save",
@@ -73,11 +258,15 @@
"import": "Import",
"reset": "Reset",
"search": "Search",
"generate": "Generate"
"generate": "Generate",
"undo": "Undo",
"dismiss": "Dismiss"
},
"videoTypes": {
"full": "Full Gameplay",
"part": "Gameplay Part",
"full_demo": "Full Demo",
"demo_part": "Demo Part",
"boss": "Boss Fight",
"boss_nohit": "Boss No Hit",
"ending": "Ending / All Endings",
@@ -89,19 +278,37 @@
"side_quest": "Side Quests",
"secret": "Secrets / Hidden",
"comparison": "Graphics Comparison",
"guide": "Silent Guide"
"guide": "Silent Guide",
"mods": "Modded Gameplay",
"collectibles": "All Collectibles",
"livestream": "Livestream",
"gacha_quest": "Gacha Quest"
},
"genres": {
"action": "Action / Adventure",
"hack_slash": "Hack & Slash",
"beatemup": "Beat 'em Up",
"platformer": "Platformer",
"horror": "Horror / Survival",
"rpg": "RPG / JRPG",
"survival_horror": "Survival Horror",
"psychological_horror": "Psychological Horror",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isometric",
"fps": "FPS / Shooter",
"arena_shooter": "Arena Shooter",
"tactical_fps": "Tactical FPS",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "SHMUP / Bullet Hell",
"openworld": "Open World / Sandbox",
"indie": "Indie / Platformer",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Racing / Sports",
"story": "Story / Visual Novel",
"story": "Story / Narrative",
"simulation": "Simulation / Strategy",
"city_builder": "City Builder",
"fighting": "Fighting",
"stealth": "Stealth / Espionage",
"survival_craft": "Survival / Crafting",
@@ -111,13 +318,15 @@
"rhythm": "Rhythm / Music",
"puzzle": "Puzzle",
"tower_defense": "Tower Defense",
"card_game": "Card / Deck Builder",
"card_game": "Card Game",
"deck_builder": "Deck Builder",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isometric",
"tactical": "Tactical / Turn-based",
"space": "Space / Sci-Fi",
"farming": "Farming / Life Sim",
"fmv": "FMV / Interactive Movie"
"fmv": "FMV / Interactive Movie",
"visual_novel": "Visual Novel"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "Monitor",
"capture": "Capture Software",
"motherboard": "Motherboard",
"controller": "Controller"
"controller": "Controller",
"video_editor": "Video Editor"
},
"social": {
"kofi": "Ko-fi",
@@ -184,6 +394,21 @@
"exportPresets": "Export Presets",
"importPresets": "Import Presets"
},
"templates": {
"title": "Templates",
"createNew": "Create Template",
"saveAsTemplate": "Save as Template",
"templateName": "Template Name",
"templateNamePlaceholder": "e.g. Elden Ring Boss Run",
"loadTemplate": "Apply",
"deleteConfirm": "Are you sure you want to delete this template?",
"emptyState": "No templates yet. Save your current form as a template to reuse later.",
"saveHint": "Saves every field in the editor so you can restore the exact state later.",
"savedAs": "Saved as '{{name}}'",
"appliedToast": "Applied '{{name}}'",
"exportTemplates": "Export Templates",
"importTemplates": "Import Templates"
},
"history": {
"title": "History",
"emptyState": "No generation history yet.",
@@ -201,14 +426,37 @@
"theme": "Theme",
"appLanguage": "App Language",
"defaultOutputLanguage": "Default Output Language",
"defaultGenre": "Default Genre",
"autoSaveDraft": "Auto-save Draft",
"defaultGenre": "Default Genres",
"showCharCount": "Show Character Count",
"compactTagDisplay": "Compact Tag Display",
"historyLimit": "History Limit",
"multilingualTags": "Include Multilingual Tags",
"trendingTags": "Include Trending Tags",
"hashtagCount": "Hashtag Count"
"hashtagCount": "Hashtag Count",
"showQualityBadge": "Show quality badge in title (e.g. [2K 60FPS])",
"showCopyright": "Append © copyright line to description",
"showUsagePolicy": "Append usage policy block to description",
"showSponsorCredit": "Show sponsor credit line in description (thanks for the key)",
"titleFormatTitle": "Title Format",
"descriptionSettingsTitle": "Description",
"badgePosition": "Quality badge position",
"badgePositionPrefix": "Prefix (before game name)",
"badgePositionMiddle": "Middle (attached to video type)",
"badgePositionSuffix": "Suffix (before tail)",
"titleSeparator": "Segment separator",
"titleSeparatorEmDash": "Em dash ( — )",
"titleSeparatorHyphen": "Hyphen ( - )",
"titleSeparatorColon": "Colon ( : )",
"titleSeparatorPipe": "Pipe ( | )",
"badgeCase": "Badge case",
"badgeCaseUpper": "UPPERCASE (2K)",
"badgeCaseLower": "lowercase (2k)",
"showPinnedCommentTemplate": "Generate a pinned-comment template alongside output",
"pinnedCommentIncludeAskNextGame": "Include \"what game should I play next?\" prompt",
"pinnedCommentIncludeGenrePlaylist": "Include genre-playlist suggestion in pinned comment",
"genrePlaylistsTitle": "Genre Playlists",
"genrePlaylistsHelp": "Configure a YouTube playlist URL per genre. The pinned-comment template will auto-suggest the matching playlist when the video's primary genre is selected.",
"genrePlaylistsEmptyHint": "Leave empty to skip a genre."
},
"batch": {
"title": "Batch Mode",
@@ -224,13 +472,21 @@
"copyAll": "Copy All",
"saveDraft": "Save Draft",
"help": "Show Shortcuts",
"close": "Close Modal"
"close": "Close Modal",
"searchPlaceholder": "Search shortcuts",
"noResults": "No matching shortcuts"
},
"validation": {
"emailInvalid": "Invalid email: {{email}}",
"emailMaxExceeded": "Maximum {{max}} emails allowed (currently {{count}})",
"urlInvalid": "Invalid URL. Must start with https://",
"urlPrefixMismatch": "Expected URL starting with {{expected}}"
"urlPrefixMismatch": "Expected URL starting with {{expected}}",
"playlistUrlInvalid": "Invalid YouTube playlist URL. Expected: {{expected}}"
},
"storeLinkTypes": {
"paid": "Paid",
"free": "Free",
"demo": "Free Demo"
},
"playlist": {
"title": "Playlist Generator",
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "Parte {{partNumber}}",
"full_demo": "Demo Completa",
"demo_part": "Demo Parte {{partNumber}}",
"boss": "{{bossName}} Pelea de Jefe",
"boss_nohit": "{{bossName}} Jefe Sin Golpes",
"ending": "Final",
@@ -16,13 +24,43 @@
"side_quest": "Misiones Secundarias",
"secret": "Secretos",
"comparison": "Comparación de Gráficos",
"guide": "Guía Silenciosa"
"guide": "Guía Silenciosa",
"mods": "Mod {{modName}}",
"collectibles": "Todos los Coleccionables",
"livestream": "🔴 EN VIVO",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — World Quest: {{questName}}",
"side_quest": "{{gameName}} — Side Quest: {{questName}}",
"spinoff_quest": "{{gameName}} — Spinoff: {{questName}}",
"companion_quest": "{{gameName}} — Companion Quest: {{questName}}",
"bond_quest": "{{gameName}} — Bond Quest: {{questName}}",
"event": "{{gameName}} — Event: {{questName}}",
"anniversary": "{{gameName}} — {{chapterName}} Anniversary{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Dating Event: {{questName}}",
"tutorial_quest": "{{gameName}} — Tutorial: {{questName}}",
"guide_quest": "{{gameName}} — Guide: {{questName}}",
"trial_quest": "{{gameName}} — Trial: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Daily Commissions{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Part {{n}}",
"day": " - Day {{n}}",
"floor": " - Floor {{n}}"
}
},
"description": {
"intro": {
"full": "Este video presenta el gameplay completo de {{gameName}} en {{channelName}}.",
"part": "Este video presenta la Parte {{partNumber}} de {{gameName}} en {{channelName}}.",
"full_demo": "Este video presenta la demo completa de {{gameName}} en {{channelName}}.",
"demo_part": "Este video presenta la Parte {{partNumber}} de la demo de {{gameName}} en {{channelName}}.",
"boss": "Este video presenta la pelea del jefe {{bossName}} de {{gameName}} en {{channelName}}.",
"boss_nohit": "Este video presenta la pelea del jefe {{bossName}} (Sin Golpes) de {{gameName}} en {{channelName}}.",
"ending": "Este video presenta el final de {{gameName}} en {{channelName}}.",
@@ -34,21 +72,147 @@
"side_quest": "Este video presenta misiones secundarias y contenido opcional de {{gameName}} en {{channelName}}.",
"secret": "Este video presenta secretos y contenido oculto de {{gameName}} en {{channelName}}.",
"comparison": "Este video presenta una comparación de gráficos de {{gameName}} en {{channelName}}.",
"guide": "Este video presenta una guía silenciosa de {{gameName}} en {{channelName}}."
"guide": "Este video presenta una guía silenciosa de {{gameName}} en {{channelName}}.",
"mods": "Este video presenta el mod {{modName}} para {{gameName}} en {{channelName}}.",
"collectibles": "Este video cubre todos los coleccionables y el 100% de {{gameName}} en {{channelName}}.",
"livestream": "Stream en vivo de {{gameName}} en {{channelName}}. ¡Únete al chat y saluda!",
"gacha_quest_main_story": "Welcome to {{chapterName}} of {{gameName}} on {{channelName}}!",
"gacha_quest_world_quest": "Today's video covers the World Quest \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_side_quest": "Side Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_spinoff_quest": "Spinoff quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_companion_quest": "Companion Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_bond_quest": "Bond Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_event": "Limited-time Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_anniversary": "{{chapterName}} Anniversary celebration in {{gameName}} on {{channelName}}.",
"gacha_quest_crossover": "Crossover Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_dating_event": "Dating Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_tutorial_quest": "Tutorial \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_guide_quest": "Guide Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_trial_quest": "Trial Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_endgame": "Endgame mode \"{{chapterName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_coop": "Co-op session \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_daily_commission": "Daily Commissions in {{gameName}} on {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" from {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "Sin Comentarios — gameplay puro para tu disfrute.",
"storeLinkSuffix": {
"free": "gratis",
"demo": "demo gratis"
},
"sections": {
"timestamps": "⏱ MARCAS DE TIEMPO",
"storeLinks": "🎮 CONSIGUE EL JUEGO",
"storeLinksBuy": "🎮 CONSIGUE EL JUEGO (si quieres comprarlo)",
"storeLinksDownload": "⬇️ DESCARGA EL JUEGO (si quieres jugar)",
"videoSettings": "🖥 AJUSTES DE VIDEO",
"rig": "💻 MI EQUIPO",
"modList": "🧩 LISTA DE MODS",
"vnDonate": "🏦 BANK TRANSFER / E-WALLET (Vietnam)",
"spoilerWarning": "⚠️ ADVERTENCIA DE SPOILERS: Este video puede contener spoilers. ¡Míralo bajo tu propio riesgo!",
"matureWarning": "🔞 CONTENIDO PARA ADULTOS (18+): Contiene violencia / lenguaje fuerte / contenido gráfico.",
"sponsorCredit": "🎁 Gracias a {{sponsor}} por proporcionar la clave de {{platform}} de este juego.",
"music": "🎵 MÚSICA / SONIDO",
"donate": "☕ APOYA EL CANAL",
"social": "🔗 SÍGUEME",
"playlist": "▶️ Ver la serie completa: {{link}}",
"contact": "📧 Consultas comerciales: {{email}}",
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte"
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte",
"copyright": "© {{year}} {{channelName}}. Todos los derechos reservados.",
"usagePolicyHeader": "📋 POLÍTICA DE USO",
"usagePolicy": "• Siempre acredita con un enlace al vídeo original Y al canal (al menos en la descripción).\n• No reuploadees el vídeo completo ni porciones grandes como contenido propio.\n• No monetices el material sin consentimiento explícito.\n• No edites el material de forma que tergiverse el contenido original o al creador.\n• Compilaciones, reseñas, comentarios y reacciones están OK — siempre que acredites.\nSi tienes dudas, contáctame por las redes sociales o el email de la descripción.",
"playthrough": "🎯 Partida: {{value}}",
"difficulty": "🎮 DIFICULTAD",
"contentWarnings": "⚠️ ADVERTENCIAS DE CONTENIDO"
},
"playthrough": {
"blind": "Partida a ciegas (primera vez)",
"replay": "Rejugada",
"newgame_plus": "New Game+",
"postgame": "Post-game / contenido final"
},
"difficulty": {
"easy": "Fácil",
"normal": "Normal",
"hard": "Difícil",
"nightmare": "Pesadilla / Extremo"
},
"contentWarnings": {
"flashing_lights": "⚡ Luces parpadeantes / efecto estroboscópico",
"loud_noises": "🔊 Ruidos fuertes / picos de volumen",
"jump_scares": "😱 Sustos repentinos"
},
"graphics": {
"with": "con",
"artStyle": "Estilo Artístico",
"presetOptions": {
"low": "Bajo",
"medium": "Medio",
"high": "Alto",
"very_high": "Muy Alto",
"cinematic": "Cinematográfico",
"ultra": "Ultra",
"extreme": "Extremo"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "Realista",
"stylized": "Estilizado",
"anime": "Anime",
"cel_shaded": "Cel-shading",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Dibujo a mano",
"comic": "Cómic",
"photorealistic": "Fotorrealista"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 EN VIVO el {{time}}",
"watchLine": "Ver / repetir: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "¡Gracias por ver! Espero que hayas disfrutado la partida.",
"playlistPrompt": "📺 Mira la serie completa aquí: {{link}}",
"engagementPrompt": "No olvides dar like y suscribirte si quieres ver más — ayuda muchísimo al canal 💚",
"askNextGame": "💬 ¿Qué juego debería jugar a continuación? ¡Déjame tus sugerencias!",
"genrePlaylistSuggestion": "📺 Más gameplay de {{genreLabel}} en el canal: {{link}}",
"greetings": {
"full": "Partida completa de {{gameName}} — espero que la disfrutes de principio a fin.",
"part": "¡Bienvenidos de vuelta a {{gameName}} en {{channelName}}!",
"full_demo": "Demo completa de {{gameName}} — ¿debería jugar el juego completo cuando salga?",
"demo_part": "La demo continúa — con muchas ganas del lanzamiento. ¿Ustedes también?",
"boss": "Ese jefe fue intenso. ¡Cuéntame en los comentarios cómo te fue en tu pelea!",
"boss_nohit": "Run sin recibir daño — me tomó varios intentos. Si te gustó, deja un like.",
"ending": "⚠️ Este es el final — gracias por acompañarme en este viaje en {{channelName}}.",
"speedrun": "Intento de speedrun completado — bienvenidos tiempos y rutas en los comentarios.",
"100percent": "100% completado 🏆 Gracias por quedarte hasta el final.",
"dlc": "DLC de {{gameName}} — ¿qué momento te impactó más?",
"newgame_plus": "NG+ significa que todo es más difícil. Respeto a quienes lo están rejugando conmigo.",
"challenge": "Desafío completado. Respeto a quien intente lo mismo.",
"side_quest": "Desvío de misión secundaria — ¡gracias por la pausa de la historia principal!",
"secret": "Contenido secreto desbloqueado 🔓 Dime si quieres más búsquedas a fondo.",
"comparison": "Comparación gráfica de {{gameName}} — ¿cuál gana para ti?",
"guide": "Espero que esta guía silenciosa te haya ayudado. Los tiempos están en la descripción.",
"mods": "Partida con mods — el orden de carga y créditos están en la descripción.",
"collectibles": "Todos los coleccionables en un solo vídeo. ¡Gracias por el apoyo!",
"livestream": "¡Bienvenidos al stream de {{gameName}}! Déjenme un saludo en el chat 👋",
"gacha_quest": "Welcome back to {{gameName}} on {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 Incompleto",
"in_progress": "▶️ En progreso"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video(s)",
"storeSection": "🎮 Obtener el juego:",
"footer": "👍 Me gusta | 🔔 ¡Suscríbete para más gameplay!",
@@ -77,5 +241,17 @@
"guide": "Esta playlist es una guía silenciosa de {{gameName}} en {{channelName}}.\nSin comentarios.",
"highlights": "Esta playlist contiene los momentos destacados de {{gameName}} en {{channelName}}.\nSin comentarios."
}
},
"timeline": {
"keywords": {
"chapter": "Capítulo {{n}}",
"part": "Parte {{n}}",
"boss": "Jefe {{n}}",
"final_boss": "Jefe Final",
"intro": "Introducción",
"ending": "Final",
"tutorial": "Tutorial",
"credits": "Créditos"
}
}
}
+271 -15
View File
@@ -14,6 +14,14 @@
"logs": "Registros"
},
"editor": {
"sections": {
"gameInfo": "Info del Juego",
"videoSettings": "Ajustes de Video",
"contentDetails": "Detalles del Contenido",
"attribution": "Créditos",
"rig": "Mi Equipo",
"storeAndSocial": "Tiendas y Social"
},
"videoType": "Tipo de Video",
"language": "Idioma de Salida",
"genre": "Género del Juego",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "ej. Shadow of the Erdtree",
"challengeName": "Nombre del Desafío",
"challengeNamePlaceholder": "ej. Sin Golpes",
"modName": "Nombre del Mod",
"modNamePlaceholder": "ej. Requiem, NaturalVision Evolved",
"modList": "Mod List",
"modListPlaceholder": "List the mods you used, one per line. Paste from your mod manager works.",
"gachaQuestType": "Quest Type",
"gachaQuestTypeOptions": {
"main_story": "Main Story",
"world_quest": "World Quest",
"side_quest": "Side Quest",
"spinoff_quest": "Spinoff Quest",
"companion_quest": "Companion Quest",
"bond_quest": "Bond Quest",
"event": "Event",
"anniversary": "Anniversary",
"crossover": "Crossover",
"dating_event": "Dating Event",
"tutorial_quest": "Tutorial",
"guide_quest": "Guide Quest",
"trial_quest": "Trial Quest",
"endgame": "Endgame Mode",
"coop": "Co-op",
"daily_commission": "Daily Commissions",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Story",
"events": "Events",
"tutorial_trial": "Tutorial / Trial",
"endgame_multiplayer": "Endgame / Multiplayer",
"showcase": "Showcase"
},
"chapterName": "Chapter / Story Arc",
"chapterNamePlaceholder": "e.g. Chapter 5 Act 2: Where the Stars Fall",
"questName": "Quest Name",
"questNamePlaceholder": "e.g. A Solitary Constellation",
"vnDonate": "Donate (Vietnam)",
"vnDonateHelp": "Only rendered into the description when output language is Vietnamese.",
"vnBankName": "Bank name",
"vnBankNamePlaceholder": "e.g. Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Account number",
"vnBankAccountPlaceholder": "e.g. 0123456789",
"vnBankHolder": "Account holder",
"vnBankHolderPlaceholder": "e.g. NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "MoMo phone number",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "ZaloPay phone number",
"resolution": "Resolución",
"fps": "FPS",
"graphicsPreset": "Calidad Gráfica",
"graphicsPresetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme",
"custom": "Custom…"
},
"graphicsPresetCustom": "Custom preset name",
"graphicsPresetCustomPlaceholder": "e.g. Epic, Maximum",
"skipGraphicsSettings": "This game has no in-game graphics settings",
"skipGraphicsSettingsHelp": "Hide the Video Settings section in the description for 2D / pixel-art / web games.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Frame Gen Vendor",
"frameGenVendorOptions": {
"none": "None",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Frame Gen Multiplier",
"frameGenMultiplierOptions": {
"none": "None",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Upscaling Quality",
"upscaleQualityOptions": {
"none": "None",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Art Style",
"artStyleOptions": {
"none": "— Not set —",
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"versionInfo": "Driver / Game Version",
"versionInfoPlaceholder": "e.g. GeForce 565.90 | Game v1.4",
"liveUrl": "Live URL",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Scheduled Time",
"skipGraphicsHintLabel": "This looks like a game without graphics settings — hide the section?",
"skipGraphicsHintHide": "Hide",
"skipGraphicsHintKeep": "Keep",
"timestamps": "Marcas de Tiempo",
"timestampsPlaceholder": "0:00 Intro\n5:30 Capítulo 1\n15:00 Pelea de Jefe",
"storeLinks": "Enlaces de Tienda",
"storeLinkType": "Tipo",
"rig": "Mi Equipo",
"social": "Redes Sociales y Donaciones",
"warnings": "Advertencias",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Correo de Contacto",
"contactEmailPlaceholder": "negocios@ejemplo.com",
"musicAttribution": "Crédito Musical / Sonidos",
"musicAttributionPlaceholder": "Música: Karl Casey @ White Bat Audio\nEfectos: Freesound.org",
"sponsorName": "Patrocinador (editor / desarrollador)",
"sponsorNamePlaceholder": "ej. Ubisoft, Capcom, Devolver Digital",
"sponsorPlatform": "Plataforma de la clave",
"sponsorPlatformPlaceholder": "ej. Steam, Epic Games, GOG",
"thumbnailText": "Texto de Miniatura",
"thumbnailTextPlaceholder": "ej. JEFE SECRETO SIN GOLPES",
"pinnedComment": "Plantilla de Comentario Fijado",
"pinnedCommentPlaceholder": "Contenido del comentario fijado...",
"playthrough": "Tipo de partida",
"playthroughOptions": {
"none": "— Sin elegir —",
"blind": "A ciegas (primera vez)",
"replay": "Rejugada",
"newgame_plus": "New Game+",
"postgame": "Post-game / contenido final"
},
"difficulty": "Dificultad",
"difficultyOptions": {
"none": "— Sin elegir —",
"easy": "Fácil",
"normal": "Normal",
"hard": "Difícil",
"nightmare": "Pesadilla / Extremo",
"custom": "Personalizada…"
},
"difficultyCustomLabel": "Etiqueta de dificultad personalizada",
"difficultyCustomPlaceholder": "ej. Lethal, NG+7, Fromsoft default",
"contentWarnings": "Advertencias de contenido",
"contentWarningOptions": {
"flashing_lights": "⚡ Luces parpadeantes",
"loud_noises": "🔊 Ruidos fuertes",
"jump_scares": "😱 Sustos repentinos"
},
"videoSettings": "Ajustes de Video",
"quickPreview": "Vista Previa Rápida",
"version": "Versión",
"clearDraft": "Limpiar Borrador",
"draftSaved": "Borrador guardado",
"clearDraftConfirm": "¿Estás seguro de que quieres borrar todos los datos del formulario?",
"contactEmailHelp": "Hasta 3 emails, separados por comas"
"genreSearchPlaceholder": "Buscar géneros",
"genreSearchNoResults": "No se encontraron géneros",
"genreGroups": {
"rpg": "Todos los RPG",
"shooter": "Todos los Shooter",
"horror": "Todo Horror"
},
"contactEmailHelp": "Hasta 3 emails, separados por comas",
"toast": {
"urlAutoFilled": "'{{name}}' rellenado automáticamente desde URL"
},
"warning": {
"linkNameMismatch": "Comprueba el enlace y vuelve a añadirlo — '{{host}}' sugiere '{{suggestedName}}', pero el Nombre del juego es '{{gameName}}'."
}
},
"output": {
"title": "Título",
@@ -62,7 +234,20 @@
"copyAll": "Copiar Todo",
"copied": "¡Copiado!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Seleccionar Idiomas"
"selectLanguages": "Seleccionar Idiomas",
"thumbnailText": "Texto de Miniatura",
"copyThumbnailText": "Copiar texto de miniatura",
"pinnedComment": "Comentario Fijado",
"copyPinnedComment": "Copiar comentario fijado",
"pinnedCommentTemplate": "Comentario Fijado (Plantilla)",
"copyPinnedCommentTemplate": "Copiar plantilla de comentario fijado",
"generateAlternatives": "Generar Alternativas",
"saveAsTemplate": "Guardar como Plantilla",
"variants": {
"default": "Predeterminado",
"typeFirst": "Tipo Primero",
"qualityFirst": "Calidad Primero"
}
},
"common": {
"save": "Guardar",
@@ -73,11 +258,15 @@
"import": "Importar",
"reset": "Restablecer",
"search": "Buscar",
"generate": "Generar"
"generate": "Generar",
"undo": "Deshacer",
"dismiss": "Descartar"
},
"videoTypes": {
"full": "Gameplay Completo",
"part": "Gameplay Parte",
"full_demo": "Demo Completa",
"demo_part": "Demo Parte",
"boss": "Pelea de Jefe",
"boss_nohit": "Jefe Sin Golpes",
"ending": "Final / Todos los Finales",
@@ -89,19 +278,37 @@
"side_quest": "Misiones Secundarias",
"secret": "Secretos / Ocultos",
"comparison": "Comparación de Gráficos",
"guide": "Guía Silenciosa"
"guide": "Guía Silenciosa",
"mods": "Gameplay con Mods",
"collectibles": "Todos los Coleccionables",
"livestream": "Livestream",
"gacha_quest": "Gacha Quest"
},
"genres": {
"action": "Acción / Aventura",
"hack_slash": "Hack & Slash",
"beatemup": "Beat 'em Up",
"platformer": "Plataformas",
"horror": "Horror / Supervivencia",
"rpg": "RPG / JRPG",
"survival_horror": "Survival Horror",
"psychological_horror": "Terror Psicológico",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isométrico",
"fps": "FPS / Shooter",
"arena_shooter": "Shooter de Arena",
"tactical_fps": "FPS Táctico",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "SHMUP / Bullet Hell",
"openworld": "Mundo Abierto / Sandbox",
"indie": "Indie / Plataformas",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Carreras / Deportes",
"story": "Historia / Novela Visual",
"story": "Historia / Narrativa",
"simulation": "Simulación / Estrategia",
"city_builder": "Constructor de Ciudades",
"fighting": "Lucha",
"stealth": "Sigilo / Espionaje",
"survival_craft": "Supervivencia / Crafting",
@@ -112,12 +319,14 @@
"puzzle": "Rompecabezas",
"tower_defense": "Tower Defense",
"card_game": "Juego de Cartas",
"deck_builder": "Deck Builder",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isométrico",
"tactical": "Táctico / Por Turnos",
"space": "Espacio / Sci-Fi",
"farming": "Granja / Life Sim",
"fmv": "FMV / Película Interactiva"
"fmv": "FMV / Película Interactiva",
"visual_novel": "Novela Visual"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "Monitor",
"capture": "Software de Captura",
"motherboard": "Placa Base",
"controller": "Mando"
"controller": "Mando",
"video_editor": "Editor de Video"
},
"social": {
"kofi": "Ko-fi",
@@ -172,6 +382,21 @@
"exportProfiles": "Exportar Perfiles",
"importProfiles": "Importar Perfiles"
},
"templates": {
"title": "Plantillas",
"createNew": "Crear Plantilla",
"saveAsTemplate": "Guardar como Plantilla",
"templateName": "Nombre de Plantilla",
"templateNamePlaceholder": "ej. Elden Ring Boss Run",
"loadTemplate": "Aplicar",
"deleteConfirm": "¿Seguro que quieres eliminar esta plantilla?",
"emptyState": "Aún no hay plantillas. Guarda el formulario actual para reutilizarlo más tarde.",
"saveHint": "Guarda todos los campos del editor para restaurar el estado exacto después.",
"savedAs": "Guardado como '{{name}}'",
"appliedToast": "Aplicado '{{name}}'",
"exportTemplates": "Exportar Plantillas",
"importTemplates": "Importar Plantillas"
},
"presets": {
"title": "Preajustes de Juego",
"createNew": "Crear Preajuste",
@@ -201,14 +426,37 @@
"theme": "Tema",
"appLanguage": "Idioma de la App",
"defaultOutputLanguage": "Idioma de Salida Predeterminado",
"defaultGenre": "Género Predeterminado",
"autoSaveDraft": "Guardar Borrador Automáticamente",
"defaultGenre": "Géneros Predeterminados",
"showCharCount": "Mostrar Contador de Caracteres",
"compactTagDisplay": "Vista Compacta de Etiquetas",
"historyLimit": "Límite de Historial",
"multilingualTags": "Etiquetas Multilingües",
"trendingTags": "Etiquetas Tendencia",
"hashtagCount": "Cantidad de Hashtags"
"hashtagCount": "Cantidad de Hashtags",
"showQualityBadge": "Mostrar insignia de calidad en el título (ej. [2K 60FPS])",
"showCopyright": "Agregar línea de © copyright a la descripción",
"showUsagePolicy": "Agregar bloque de política de uso a la descripción",
"showSponsorCredit": "Mostrar línea de agradecimiento al patrocinador (clave) en la descripción",
"titleFormatTitle": "Formato del título",
"descriptionSettingsTitle": "Descripción",
"badgePosition": "Posición de la insignia de calidad",
"badgePositionPrefix": "Prefijo (antes del nombre del juego)",
"badgePositionMiddle": "Medio (junto al tipo de vídeo)",
"badgePositionSuffix": "Sufijo (antes de la cola)",
"titleSeparator": "Separador de segmentos",
"titleSeparatorEmDash": "Raya ( — )",
"titleSeparatorHyphen": "Guion ( - )",
"titleSeparatorColon": "Dos puntos ( : )",
"titleSeparatorPipe": "Barra vertical ( | )",
"badgeCase": "Mayúsculas / minúsculas",
"badgeCaseUpper": "MAYÚSCULAS (2K)",
"badgeCaseLower": "minúsculas (2k)",
"showPinnedCommentTemplate": "Generar plantilla de comentario fijado junto al resultado",
"pinnedCommentIncludeAskNextGame": "Incluir la pregunta \"¿qué juego debería jugar a continuación?\"",
"pinnedCommentIncludeGenrePlaylist": "Include genre-playlist suggestion in pinned comment",
"genrePlaylistsTitle": "Genre Playlists",
"genrePlaylistsHelp": "Configure a YouTube playlist URL per genre. The pinned-comment template will auto-suggest the matching playlist when the video's primary genre is selected.",
"genrePlaylistsEmptyHint": "Leave empty to skip a genre."
},
"batch": {
"title": "Generación por Lote",
@@ -224,13 +472,21 @@
"copyAll": "Copiar Todo",
"saveDraft": "Guardar Borrador",
"help": "Ayuda",
"close": "Cerrar"
"close": "Cerrar",
"searchPlaceholder": "Buscar atajos",
"noResults": "No se encontraron atajos"
},
"validation": {
"emailInvalid": "Email inválido: {{email}}",
"emailMaxExceeded": "Máximo {{max}} emails permitidos (actualmente {{count}})",
"urlInvalid": "URL inválida. Debe comenzar con https://",
"urlPrefixMismatch": "Se espera URL que comience con {{expected}}"
"urlPrefixMismatch": "Se espera URL que comience con {{expected}}",
"playlistUrlInvalid": "URL de lista de reproducción de YouTube inválida. Se espera: {{expected}}"
},
"storeLinkTypes": {
"paid": "De pago",
"free": "Gratis",
"demo": "Demo gratis"
},
"playlist": {
"title": "Generador de Playlist",
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "パート{{partNumber}}",
"full_demo": "体験版フルプレイ",
"demo_part": "体験版 パート{{partNumber}}",
"boss": "{{bossName}} ボス戦",
"boss_nohit": "{{bossName}} ボス ノーヒット",
"ending": "エンディング",
@@ -16,13 +24,43 @@
"side_quest": "サブクエスト",
"secret": "隠し要素",
"comparison": "グラフィック比較",
"guide": "攻略ガイド"
"guide": "攻略ガイド",
"mods": "{{modName}} MOD",
"collectibles": "全コレクション",
"livestream": "🔴 LIVE",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — World Quest: {{questName}}",
"side_quest": "{{gameName}} — Side Quest: {{questName}}",
"spinoff_quest": "{{gameName}} — Spinoff: {{questName}}",
"companion_quest": "{{gameName}} — Companion Quest: {{questName}}",
"bond_quest": "{{gameName}} — Bond Quest: {{questName}}",
"event": "{{gameName}} — Event: {{questName}}",
"anniversary": "{{gameName}} — {{chapterName}} Anniversary{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Dating Event: {{questName}}",
"tutorial_quest": "{{gameName}} — Tutorial: {{questName}}",
"guide_quest": "{{gameName}} — Guide: {{questName}}",
"trial_quest": "{{gameName}} — Trial: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Daily Commissions{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Part {{n}}",
"day": " - Day {{n}}",
"floor": " - Floor {{n}}"
}
},
"description": {
"intro": {
"full": "この動画は{{channelName}}による{{gameName}}のフルゲームプレイです。",
"part": "この動画は{{channelName}}による{{gameName}}のパート{{partNumber}}です。",
"full_demo": "この動画は{{channelName}}による{{gameName}}体験版のフルプレイです。",
"demo_part": "この動画は{{channelName}}による{{gameName}}体験版のパート{{partNumber}}です。",
"boss": "この動画は{{channelName}}による{{gameName}}の{{bossName}}ボス戦です。",
"boss_nohit": "この動画は{{channelName}}による{{gameName}}の{{bossName}}ボス戦(ノーヒット)です。",
"ending": "この動画は{{channelName}}による{{gameName}}のエンディングです。",
@@ -34,21 +72,147 @@
"side_quest": "この動画は{{channelName}}による{{gameName}}のサブクエストです。",
"secret": "この動画は{{channelName}}による{{gameName}}の隠し要素です。",
"comparison": "この動画は{{channelName}}による{{gameName}}のグラフィック比較です。",
"guide": "この動画は{{channelName}}による{{gameName}}の攻略ガイドです。"
"guide": "この動画は{{channelName}}による{{gameName}}の攻略ガイドです。",
"mods": "この動画は{{channelName}}による{{gameName}}の{{modName}} MODプレイです。",
"collectibles": "この動画は{{channelName}}による{{gameName}}のコレクション完全攻略です。",
"livestream": "{{channelName}}にて{{gameName}}のライブ配信中。チャットで一緒に盛り上がろう!",
"gacha_quest_main_story": "Welcome to {{chapterName}} of {{gameName}} on {{channelName}}!",
"gacha_quest_world_quest": "Today's video covers the World Quest \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_side_quest": "Side Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_spinoff_quest": "Spinoff quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_companion_quest": "Companion Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_bond_quest": "Bond Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_event": "Limited-time Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_anniversary": "{{chapterName}} Anniversary celebration in {{gameName}} on {{channelName}}.",
"gacha_quest_crossover": "Crossover Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_dating_event": "Dating Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_tutorial_quest": "Tutorial \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_guide_quest": "Guide Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_trial_quest": "Trial Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_endgame": "Endgame mode \"{{chapterName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_coop": "Co-op session \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_daily_commission": "Daily Commissions in {{gameName}} on {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" from {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "実況なし — 純粋なゲームプレイをお楽しみください。",
"storeLinkSuffix": {
"free": "無料",
"demo": "無料体験版"
},
"sections": {
"timestamps": "⏱ タイムスタンプ",
"storeLinks": "🎮 ゲームを購入",
"storeLinksBuy": "🎮 ゲームを購入 (応援したい方へ)",
"storeLinksDownload": "⬇️ ゲームをダウンロード (遊びたい方へ)",
"videoSettings": "🖥 動画設定",
"rig": "💻 PC構成",
"modList": "🧩 MODリスト",
"vnDonate": "🏦 BANK TRANSFER / E-WALLET (Vietnam)",
"spoilerWarning": "⚠️ ネタバレ注意:この動画にはネタバレが含まれている可能性があります。自己責任でご視聴ください!",
"matureWarning": "🔞 成人向けコンテンツ (18+):暴力 / 強い言葉 / グラフィックコンテンツを含みます。",
"sponsorCredit": "🎁 本作の {{platform}} キーをご提供いただいた {{sponsor}} 様、ありがとうございます。",
"music": "🎵 音楽・サウンド",
"donate": "☕ チャンネルを応援",
"social": "🔗 フォローする",
"playlist": "▶️ シリーズ全体を見る:{{link}}",
"contact": "📧 お仕事の依頼:{{email}}",
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア"
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 動画利用ポリシー",
"usagePolicy": "• 元動画のリンクとチャンネル名を必ずクレジットしてください(最低でも説明欄に)。\n• 動画全体または大部分の再アップロードは禁止です。\n• 明示的な許可なしに収益化しないでください。\n• 元の内容や制作者を歪曲するような編集は禁止です。\n• クレジットを明記すれば、コンピレーション、レビュー、解説、リアクション動画はOKです。\n不明な点があれば、説明欄のソーシャルアカウントまたはメールでご連絡ください。",
"playthrough": "🎯 プレイスタイル: {{value}}",
"difficulty": "🎮 難易度",
"contentWarnings": "⚠️ コンテンツ警告"
},
"playthrough": {
"blind": "初見プレイ",
"replay": "再プレイ",
"newgame_plus": "New Game+",
"postgame": "エンドゲーム / 裏ボス後"
},
"difficulty": {
"easy": "イージー",
"normal": "ノーマル",
"hard": "ハード",
"nightmare": "ナイトメア / 最難関"
},
"contentWarnings": {
"flashing_lights": "⚡ 光の点滅 / ストロボ効果",
"loud_noises": "🔊 大音量 / 突発的な音量",
"jump_scares": "😱 ジャンプスケア"
},
"graphics": {
"with": "+",
"artStyle": "アートスタイル",
"presetOptions": {
"low": "低",
"medium": "中",
"high": "高",
"very_high": "最高",
"cinematic": "シネマティック",
"ultra": "ウルトラ",
"extreme": "エクストリーム"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "リアル",
"stylized": "スタイライズド",
"anime": "アニメ",
"cel_shaded": "セルシェーディング",
"low_poly": "ローポリ",
"voxel": "ボクセル",
"pixel_art": "ピクセルアート",
"hand_drawn": "手描き",
"comic": "コミック",
"photorealistic": "フォトリアル"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 LIVE 配信日時: {{time}}",
"watchLine": "視聴・見逃し配信: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "ご視聴ありがとうございました!楽しんでいただけたら嬉しいです。",
"playlistPrompt": "📺 シリーズ全部はこちら: {{link}}",
"engagementPrompt": "気に入っていただけたら高評価&チャンネル登録をお願いします — チャンネルの支えになります 💚",
"askNextGame": "💬 次は何のゲームを実況してほしい?コメントで教えてください!",
"genrePlaylistSuggestion": "📺 もっと {{genreLabel}} のゲームプレイ動画はこちら: {{link}}",
"greetings": {
"full": "{{gameName}} のフルプレイです — 最後まで楽しんでいただけたら幸いです。",
"part": "{{channelName}} の {{gameName}} 実況へようこそ!",
"full_demo": "{{gameName}} の体験版フルプレイ — 本編もプレイしてほしいですか?",
"demo_part": "体験版の続きです — 本編がとても楽しみ。皆さんも期待してますか?",
"boss": "今回のボス戦、熱かったですね。皆さんの戦いもコメントで教えてください!",
"boss_nohit": "ノーヒット挑戦 — 何度もトライしました。楽しんでもらえたら高評価お願いします!",
"ending": "⚠️ エンディングです — {{channelName}} の旅に最後までお付き合いいただきありがとうございました。",
"speedrun": "RTA 挑戦完了 — タイムやルートはコメント歓迎!",
"100percent": "100% 達成 🏆 最後までお付き合いいただきありがとうございました。",
"dlc": "{{gameName}} の DLC プレイ — 印象に残った瞬間を教えてください。",
"newgame_plus": "NG+ は全て強化されています。一緒に再プレイしている皆さん、リスペクトです。",
"challenge": "チャレンジ達成。同じ縛りに挑む皆さんにリスペクトを。",
"side_quest": "サイドクエスト寄り道 — メインから少し離れた息抜きをありがとう!",
"secret": "隠し要素を発見 🔓 もっと深堀りを見たい方はコメントしてください。",
"comparison": "{{gameName}} のグラフィック比較 — どちらが好みですか?",
"guide": "サイレント攻略がお役に立てば幸いです。タイムスタンプは説明欄に。",
"mods": "MOD プレイ — ロードオーダーとクレジットは説明欄に。",
"collectibles": "全収集要素を 1 本に。応援ありがとうございました!",
"livestream": "{{gameName}} のライブ配信へようこそ!チャットで挨拶してね 👋",
"gacha_quest": "Welcome back to {{gameName}} on {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 未完了",
"in_progress": "▶️ プレイ中"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}本の動画",
"storeSection": "🎮 ゲーム購入:",
"footer": "👍 高評価 | 🔔 チャンネル登録お願いします!",
@@ -77,5 +241,17 @@
"guide": "このプレイリストは{{channelName}}での{{gameName}}の攻略ガイドです。\n解説なし — 純粋なゲームプレイ体験。",
"highlights": "このプレイリストは{{channelName}}での{{gameName}}のハイライト集です。\n解説なし — 純粋なゲームプレイ体験。"
}
},
"timeline": {
"keywords": {
"chapter": "第{{n}}章",
"part": "パート{{n}}",
"boss": "ボス{{n}}",
"final_boss": "ラスボス",
"intro": "オープニング",
"ending": "エンディング",
"tutorial": "チュートリアル",
"credits": "クレジット"
}
}
}
+270 -14
View File
@@ -14,6 +14,14 @@
"logs": "ログ"
},
"editor": {
"sections": {
"gameInfo": "ゲーム情報",
"videoSettings": "動画設定",
"contentDetails": "コンテンツ詳細",
"attribution": "クレジット",
"rig": "PCスペック",
"storeAndSocial": "ストア・SNS"
},
"videoType": "動画タイプ",
"language": "出力言語",
"genre": "ゲームジャンル",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "例:Shadow of the Erdtree",
"challengeName": "チャレンジ名",
"challengeNamePlaceholder": "例:ノーヒットラン",
"modName": "MOD名",
"modNamePlaceholder": "例: Requiem, NaturalVision Evolved",
"modList": "Mod List",
"modListPlaceholder": "List the mods you used, one per line. Paste from your mod manager works.",
"gachaQuestType": "Quest Type",
"gachaQuestTypeOptions": {
"main_story": "Main Story",
"world_quest": "World Quest",
"side_quest": "Side Quest",
"spinoff_quest": "Spinoff Quest",
"companion_quest": "Companion Quest",
"bond_quest": "Bond Quest",
"event": "Event",
"anniversary": "Anniversary",
"crossover": "Crossover",
"dating_event": "Dating Event",
"tutorial_quest": "Tutorial",
"guide_quest": "Guide Quest",
"trial_quest": "Trial Quest",
"endgame": "Endgame Mode",
"coop": "Co-op",
"daily_commission": "Daily Commissions",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Story",
"events": "Events",
"tutorial_trial": "Tutorial / Trial",
"endgame_multiplayer": "Endgame / Multiplayer",
"showcase": "Showcase"
},
"chapterName": "Chapter / Story Arc",
"chapterNamePlaceholder": "e.g. Chapter 5 Act 2: Where the Stars Fall",
"questName": "Quest Name",
"questNamePlaceholder": "e.g. A Solitary Constellation",
"vnDonate": "Donate (Vietnam)",
"vnDonateHelp": "Only rendered into the description when output language is Vietnamese.",
"vnBankName": "Bank name",
"vnBankNamePlaceholder": "e.g. Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Account number",
"vnBankAccountPlaceholder": "e.g. 0123456789",
"vnBankHolder": "Account holder",
"vnBankHolderPlaceholder": "e.g. NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "MoMo phone number",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "ZaloPay phone number",
"resolution": "解像度",
"fps": "FPS",
"graphicsPreset": "グラフィック設定",
"graphicsPresetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme",
"custom": "Custom…"
},
"graphicsPresetCustom": "Custom preset name",
"graphicsPresetCustomPlaceholder": "e.g. Epic, Maximum",
"skipGraphicsSettings": "This game has no in-game graphics settings",
"skipGraphicsSettingsHelp": "Hide the Video Settings section in the description for 2D / pixel-art / web games.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Frame Gen Vendor",
"frameGenVendorOptions": {
"none": "None",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Frame Gen Multiplier",
"frameGenMultiplierOptions": {
"none": "None",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Upscaling Quality",
"upscaleQualityOptions": {
"none": "None",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Art Style",
"artStyleOptions": {
"none": "— Not set —",
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"versionInfo": "Driver / Game Version",
"versionInfoPlaceholder": "e.g. GeForce 565.90 | Game v1.4",
"liveUrl": "Live URL",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Scheduled Time",
"skipGraphicsHintLabel": "This looks like a game without graphics settings — hide the section?",
"skipGraphicsHintHide": "Hide",
"skipGraphicsHintKeep": "Keep",
"timestamps": "タイムスタンプ",
"timestampsPlaceholder": "0:00 イントロ\n5:30 チャプター1\n15:00 ボス戦",
"storeLinks": "購入リンク",
"storeLinkType": "種別",
"rig": "PC構成",
"social": "SNS・寄付リンク",
"warnings": "警告",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "連絡先メール",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "音楽・サウンドクレジット",
"musicAttributionPlaceholder": "音楽: Karl Casey @ White Bat Audio\n効果音: Freesound.org",
"sponsorName": "スポンサー (パブリッシャー / デベロッパー)",
"sponsorNamePlaceholder": "例: Ubisoft、カプコン、Devolver Digital",
"sponsorPlatform": "キーのプラットフォーム",
"sponsorPlatformPlaceholder": "例: Steam、Epic Games、GOG",
"thumbnailText": "サムネイルテキスト",
"thumbnailTextPlaceholder": "例: 隠しボス ノーヒット",
"pinnedComment": "固定コメントのテンプレート",
"pinnedCommentPlaceholder": "固定コメントに載せたい内容...",
"playthrough": "プレイスタイル",
"playthroughOptions": {
"none": "— 未選択 —",
"blind": "初見",
"replay": "再プレイ",
"newgame_plus": "New Game+",
"postgame": "エンドゲーム"
},
"difficulty": "難易度",
"difficultyOptions": {
"none": "— 未選択 —",
"easy": "イージー",
"normal": "ノーマル",
"hard": "ハード",
"nightmare": "ナイトメア / 最難関",
"custom": "カスタム…"
},
"difficultyCustomLabel": "カスタム難易度ラベル",
"difficultyCustomPlaceholder": "例: Lethal, NG+7, Fromsoft default",
"contentWarnings": "コンテンツ警告",
"contentWarningOptions": {
"flashing_lights": "⚡ 光の点滅",
"loud_noises": "🔊 大音量",
"jump_scares": "😱 ジャンプスケア"
},
"videoSettings": "動画設定",
"quickPreview": "クイックプレビュー",
"version": "バージョン",
"clearDraft": "下書きをクリア",
"draftSaved": "下書き保存済み",
"clearDraftConfirm": "フォームデータをすべてクリアしますか?",
"contactEmailHelp": "最大3つのメール、カンマ区切り"
"genreSearchPlaceholder": "ジャンルを検索",
"genreSearchNoResults": "該当するジャンルはありません",
"genreGroups": {
"rpg": "すべての RPG",
"shooter": "すべてのシューター",
"horror": "すべてのホラー"
},
"contactEmailHelp": "最大3つのメール、カンマ区切り",
"toast": {
"urlAutoFilled": "URLから「{{name}}」を自動入力しました"
},
"warning": {
"linkNameMismatch": "リンクを確認して再追加してください — 「{{host}}」は「{{suggestedName}}」を指していますが、ゲーム名は「{{gameName}}」です。"
}
},
"output": {
"title": "タイトル",
@@ -62,7 +234,20 @@
"copyAll": "全てコピー",
"copied": "コピーしました!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "言語を選択"
"selectLanguages": "言語を選択",
"thumbnailText": "サムネイルテキスト",
"copyThumbnailText": "サムネイルテキストをコピー",
"pinnedComment": "固定コメント",
"copyPinnedComment": "固定コメントをコピー",
"pinnedCommentTemplate": "固定コメント (テンプレート)",
"copyPinnedCommentTemplate": "固定コメントのテンプレートをコピー",
"generateAlternatives": "タイトル案を生成",
"saveAsTemplate": "テンプレートとして保存",
"variants": {
"default": "デフォルト",
"typeFirst": "タイプ優先",
"qualityFirst": "画質優先"
}
},
"common": {
"save": "保存",
@@ -73,11 +258,15 @@
"import": "インポート",
"reset": "リセット",
"search": "検索",
"generate": "生成"
"generate": "生成",
"undo": "元に戻す",
"dismiss": "閉じる"
},
"videoTypes": {
"full": "フルゲームプレイ",
"part": "ゲームプレイ パート",
"full_demo": "体験版フルプレイ",
"demo_part": "体験版 パート",
"boss": "ボス戦",
"boss_nohit": "ボス ノーヒット",
"ending": "エンディング",
@@ -89,19 +278,37 @@
"side_quest": "サブクエスト",
"secret": "隠し要素",
"comparison": "グラフィック比較",
"guide": "攻略ガイド"
"guide": "攻略ガイド",
"mods": "MODプレイ",
"collectibles": "全コレクション",
"livestream": "ライブ配信",
"gacha_quest": "Gacha Quest"
},
"genres": {
"action": "アクション / アドベンチャー",
"hack_slash": "ハック&スラッシュ",
"beatemup": "ベルトスクロール",
"platformer": "プラットフォーマー",
"horror": "ホラー / サバイバル",
"rpg": "RPG / JRPG",
"survival_horror": "サバイバルホラー",
"psychological_horror": "サイコホラー",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "アクションRPG",
"crpg": "CRPG / アイソメトリック",
"fps": "FPS / シューター",
"arena_shooter": "アリーナシューター",
"tactical_fps": "タクティカルFPS",
"boomer_shooter": "ブーマーシューター",
"extraction_shooter": "脱出シューター",
"shmup": "シューティング / 弾幕",
"openworld": "オープンワールド / サンドボックス",
"indie": "インディー / プラットフォーマー",
"indie": "インディー",
"soulslike": "ソウルライク",
"racing": "レーシング / スポーツ",
"story": "ストーリー / ビジュアルノベル",
"story": "ストーリー / ナラティブ",
"simulation": "シミュレーション / ストラテジー",
"city_builder": "街づくり",
"fighting": "格闘ゲーム",
"stealth": "ステルス / スパイ",
"survival_craft": "サバイバル / クラフト",
@@ -112,12 +319,14 @@
"puzzle": "パズル",
"tower_defense": "タワーディフェンス",
"card_game": "カードゲーム",
"deck_builder": "デッキビルダー",
"auto_battler": "オートバトラー",
"battle_royale": "バトルロイヤル",
"crpg": "CRPG / アイソメトリック",
"tactical": "タクティカル / ターン制",
"space": "宇宙 / SF",
"farming": "農業 / ライフシム",
"fmv": "FMV / インタラクティブムービー"
"fmv": "FMV / インタラクティブムービー",
"visual_novel": "ビジュアルノベル"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "モニター",
"capture": "キャプチャソフト",
"motherboard": "マザーボード",
"controller": "コントローラー"
"controller": "コントローラー",
"video_editor": "動画編集ソフト"
},
"social": {
"kofi": "Ko-fi",
@@ -172,6 +382,21 @@
"exportProfiles": "プロフィールをエクスポート",
"importProfiles": "プロフィールをインポート"
},
"templates": {
"title": "テンプレート",
"createNew": "新規作成",
"saveAsTemplate": "テンプレートとして保存",
"templateName": "テンプレート名",
"templateNamePlaceholder": "例: エルデンリング ボス戦",
"loadTemplate": "適用",
"deleteConfirm": "このテンプレートを削除してもよろしいですか?",
"emptyState": "まだテンプレートがありません。現在のフォームを保存して再利用できます。",
"saveHint": "エディタの全フィールドを保存し、あとで同じ状態に戻せます。",
"savedAs": "'{{name}}' として保存しました",
"appliedToast": "'{{name}}' を適用しました",
"exportTemplates": "テンプレートをエクスポート",
"importTemplates": "テンプレートをインポート"
},
"presets": {
"title": "ゲームプリセット",
"createNew": "プリセット作成",
@@ -202,13 +427,36 @@
"appLanguage": "アプリの言語",
"defaultOutputLanguage": "デフォルト出力言語",
"defaultGenre": "デフォルトジャンル",
"autoSaveDraft": "下書き自動保存",
"showCharCount": "文字数を表示",
"compactTagDisplay": "コンパクトタグ表示",
"historyLimit": "履歴上限",
"multilingualTags": "多言語タグを含む",
"trendingTags": "トレンドタグを含む",
"hashtagCount": "ハッシュタグ数"
"hashtagCount": "ハッシュタグ数",
"showQualityBadge": "タイトルに画質バッジを表示 (例: [2K 60FPS])",
"showCopyright": "説明欄に © 著作権行を追加",
"showUsagePolicy": "説明欄に動画利用ポリシーを追加",
"showSponsorCredit": "説明欄にスポンサーへの感謝行を追加 (キー提供)",
"titleFormatTitle": "タイトル書式",
"descriptionSettingsTitle": "説明欄",
"badgePosition": "品質バッジの位置",
"badgePositionPrefix": "先頭 (ゲーム名の前)",
"badgePositionMiddle": "中央 (動画タイプに付随)",
"badgePositionSuffix": "末尾 (末尾の前)",
"titleSeparator": "区切り文字",
"titleSeparatorEmDash": "エムダッシュ ( — )",
"titleSeparatorHyphen": "ハイフン ( - )",
"titleSeparatorColon": "コロン ( : )",
"titleSeparatorPipe": "パイプ ( | )",
"badgeCase": "バッジの大文字小文字",
"badgeCaseUpper": "大文字 (2K)",
"badgeCaseLower": "小文字 (2k)",
"showPinnedCommentTemplate": "出力と並べて固定コメントのテンプレートを生成する",
"pinnedCommentIncludeAskNextGame": "「次は何のゲーム?」の呼びかけを含める",
"pinnedCommentIncludeGenrePlaylist": "Include genre-playlist suggestion in pinned comment",
"genrePlaylistsTitle": "Genre Playlists",
"genrePlaylistsHelp": "Configure a YouTube playlist URL per genre. The pinned-comment template will auto-suggest the matching playlist when the video's primary genre is selected.",
"genrePlaylistsEmptyHint": "Leave empty to skip a genre."
},
"batch": {
"title": "一括モード",
@@ -224,13 +472,21 @@
"copyAll": "すべてコピー",
"saveDraft": "下書き保存",
"help": "ショートカット表示",
"close": "モーダルを閉じる"
"close": "モーダルを閉じる",
"searchPlaceholder": "ショートカットを検索",
"noResults": "該当するショートカットはありません"
},
"validation": {
"emailInvalid": "無効なメール: {{email}}",
"emailMaxExceeded": "最大{{max}}件のメール (現在{{count}}件)",
"urlInvalid": "無効なURL。https://で始める必要があります",
"urlPrefixMismatch": "{{expected}}で始まるURLが必要です"
"urlPrefixMismatch": "{{expected}}で始まるURLが必要です",
"playlistUrlInvalid": "無効なYouTubeプレイリストURLです。期待される形式: {{expected}}"
},
"storeLinkTypes": {
"paid": "有料",
"free": "無料",
"demo": "無料体験版"
},
"playlist": {
"title": "プレイリスト生成",
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "파트 {{partNumber}}",
"full_demo": "전체 데모",
"demo_part": "데모 파트 {{partNumber}}",
"boss": "{{bossName}} 보스전",
"boss_nohit": "{{bossName}} 보스 노히트",
"ending": "엔딩",
@@ -16,13 +24,43 @@
"side_quest": "서브 퀘스트",
"secret": "비밀",
"comparison": "그래픽 비교",
"guide": "무음 가이드"
"guide": "무음 가이드",
"mods": "{{modName}} 모드",
"collectibles": "모든 수집품",
"livestream": "🔴 LIVE",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — World Quest: {{questName}}",
"side_quest": "{{gameName}} — Side Quest: {{questName}}",
"spinoff_quest": "{{gameName}} — Spinoff: {{questName}}",
"companion_quest": "{{gameName}} — Companion Quest: {{questName}}",
"bond_quest": "{{gameName}} — Bond Quest: {{questName}}",
"event": "{{gameName}} — Event: {{questName}}",
"anniversary": "{{gameName}} — {{chapterName}} Anniversary{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Dating Event: {{questName}}",
"tutorial_quest": "{{gameName}} — Tutorial: {{questName}}",
"guide_quest": "{{gameName}} — Guide: {{questName}}",
"trial_quest": "{{gameName}} — Trial: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Daily Commissions{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Part {{n}}",
"day": " - Day {{n}}",
"floor": " - Floor {{n}}"
}
},
"description": {
"intro": {
"full": "이 영상은 {{channelName}}에서 {{gameName}}의 전체 게임플레이를 담고 있습니다.",
"part": "이 영상은 {{channelName}}에서 {{gameName}} 파트 {{partNumber}}를 담고 있습니다.",
"full_demo": "이 영상은 {{channelName}}에서 {{gameName}}의 전체 데모를 담고 있습니다.",
"demo_part": "이 영상은 {{channelName}}에서 {{gameName}} 데모 파트 {{partNumber}}를 담고 있습니다.",
"boss": "이 영상은 {{channelName}}에서 {{gameName}}의 {{bossName}} 보스전을 담고 있습니다.",
"boss_nohit": "이 영상은 {{channelName}}에서 {{gameName}}의 {{bossName}} 보스전 (노히트)을 담고 있습니다.",
"ending": "이 영상은 {{channelName}}에서 {{gameName}}의 엔딩을 담고 있습니다.",
@@ -34,21 +72,147 @@
"side_quest": "이 영상은 {{channelName}}에서 {{gameName}}의 서브 퀘스트와 선택 콘텐츠를 담고 있습니다.",
"secret": "이 영상은 {{channelName}}에서 {{gameName}}의 비밀과 숨겨진 요소를 담고 있습니다.",
"comparison": "이 영상은 {{channelName}}에서 {{gameName}}의 그래픽 비교를 담고 있습니다.",
"guide": "이 영상은 {{channelName}}에서 {{gameName}}의 무음 가이드를 담고 있습니다."
"guide": "이 영상은 {{channelName}}에서 {{gameName}}의 무음 가이드를 담고 있습니다.",
"mods": "이 영상은 {{channelName}}에서 {{gameName}}의 {{modName}} 모드 플레이를 담고 있습니다.",
"collectibles": "이 영상은 {{channelName}}에서 {{gameName}}의 모든 수집 요소와 100% 완료 플레이를 담고 있습니다.",
"livestream": "{{channelName}} 채널의 {{gameName}} 라이브 방송입니다. 채팅에서 인사 남겨주세요!",
"gacha_quest_main_story": "Welcome to {{chapterName}} of {{gameName}} on {{channelName}}!",
"gacha_quest_world_quest": "Today's video covers the World Quest \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_side_quest": "Side Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_spinoff_quest": "Spinoff quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_companion_quest": "Companion Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_bond_quest": "Bond Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_event": "Limited-time Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_anniversary": "{{chapterName}} Anniversary celebration in {{gameName}} on {{channelName}}.",
"gacha_quest_crossover": "Crossover Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_dating_event": "Dating Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_tutorial_quest": "Tutorial \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_guide_quest": "Guide Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_trial_quest": "Trial Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_endgame": "Endgame mode \"{{chapterName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_coop": "Co-op session \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_daily_commission": "Daily Commissions in {{gameName}} on {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" from {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "무음 플레이 — 순수한 게임플레이를 즐겨보세요.",
"storeLinkSuffix": {
"free": "무료",
"demo": "무료 데모"
},
"sections": {
"timestamps": "⏱ 타임스탬프",
"storeLinks": "🎮 게임 구매",
"storeLinksBuy": "🎮 게임 구매 (구매하고 싶다면)",
"storeLinksDownload": "⬇️ 게임 다운로드 (플레이하고 싶다면)",
"videoSettings": "🖥 영상 설정",
"rig": "💻 내 장비",
"modList": "🧩 모드 목록",
"vnDonate": "🏦 BANK TRANSFER / E-WALLET (Vietnam)",
"spoilerWarning": "⚠️ 스포일러 경고: 이 영상에는 스포일러가 포함될 수 있습니다. 주의하여 시청하세요!",
"matureWarning": "🔞 성인 콘텐츠 (18+): 폭력 / 강한 언어 / 선정적 콘텐츠를 포함합니다.",
"sponsorCredit": "🎁 이 게임의 {{platform}} 키를 제공해 주신 {{sponsor}}님께 감사드립니다.",
"music": "🎵 음악 / 사운드",
"donate": "☕ 채널 후원",
"social": "🔗 팔로우",
"playlist": "▶️ 전체 시리즈 보기: {{link}}",
"contact": "📧 비즈니스 문의: {{email}}",
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유"
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유",
"copyright": "© {{year}} {{channelName}}. All rights reserved.",
"usagePolicyHeader": "📋 영상 사용 정책",
"usagePolicy": "• 원본 영상 링크와 채널을 반드시 크레딧해주세요 (최소한 설명란에).\n• 전체 영상 또는 상당 부분을 본인 콘텐츠로 재업로드하지 마세요.\n• 명시적 동의 없이 수익화하지 마세요.\n• 원본 내용이나 제작자를 왜곡하는 방식으로 편집하지 마세요.\n• 컴필레이션, 리뷰, 해설, 리액션 영상은 크레딧만 하면 OK입니다.\n불확실한 경우 설명란의 소셜 계정이나 이메일로 연락주세요.",
"playthrough": "🎯 플레이 방식: {{value}}",
"difficulty": "🎮 난이도",
"contentWarnings": "⚠️ 콘텐츠 경고"
},
"playthrough": {
"blind": "초회차 플레이 (블라인드)",
"replay": "재플레이",
"newgame_plus": "New Game+",
"postgame": "엔드 콘텐츠 / 후반부"
},
"difficulty": {
"easy": "쉬움",
"normal": "보통",
"hard": "어려움",
"nightmare": "악몽 / 최고 난이도"
},
"contentWarnings": {
"flashing_lights": "⚡ 점멸 / 스트로보 효과",
"loud_noises": "🔊 큰 소리 / 갑작스러운 볼륨 변화",
"jump_scares": "😱 점프 스케어"
},
"graphics": {
"with": "+",
"artStyle": "아트 스타일",
"presetOptions": {
"low": "낮음",
"medium": "중간",
"high": "높음",
"very_high": "매우 높음",
"cinematic": "시네마틱",
"ultra": "울트라",
"extreme": "극한"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "사실적",
"stylized": "양식화",
"anime": "애니메이션",
"cel_shaded": "셀 셰이딩",
"low_poly": "로우 폴리",
"voxel": "복셀",
"pixel_art": "픽셀 아트",
"hand_drawn": "손 그림",
"comic": "만화",
"photorealistic": "포토리얼"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 LIVE 방송 일시: {{time}}",
"watchLine": "시청 / 다시보기: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "시청해 주셔서 감사합니다! 즐겁게 보셨기를 바랄게요.",
"playlistPrompt": "📺 전체 시리즈는 여기에서 보세요: {{link}}",
"engagementPrompt": "더 많은 영상을 원하시면 좋아요와 구독 부탁드립니다 — 채널에 큰 힘이 됩니다 💚",
"askNextGame": "💬 다음에는 어떤 게임을 플레이할까요? 댓글로 추천해 주세요!",
"genrePlaylistSuggestion": "📺 채널의 다른 {{genreLabel}} 플레이 영상: {{link}}",
"greetings": {
"full": "{{gameName}} 전체 플레이입니다 — 끝까지 즐겁게 봐주세요.",
"part": "{{channelName}} 의 {{gameName}} 실황에 오신 것을 환영합니다!",
"full_demo": "{{gameName}} 데모 풀 플레이 — 정식 출시되면 본편도 플레이할까요?",
"demo_part": "데모가 이어집니다 — 정식 출시가 기대되네요. 여러분도 같이 기다리시나요?",
"boss": "이번 보스전 정말 치열했죠. 여러분의 전투도 댓글로 공유해 주세요!",
"boss_nohit": "노히트 도전 — 여러 번 시도했어요. 즐거우셨다면 좋아요 부탁드립니다!",
"ending": "⚠️ 엔딩입니다 — {{channelName}} 의 여정을 끝까지 함께해 주셔서 감사합니다.",
"speedrun": "스피드런 시도 완료 — 타임과 루트는 댓글 환영!",
"100percent": "100% 달성 🏆 끝까지 함께해 주셔서 감사합니다.",
"dlc": "{{gameName}} DLC 플레이 — 어떤 순간이 가장 인상적이었나요?",
"newgame_plus": "NG+ 는 모든 게 더 어렵죠. 같이 재도전하는 분들께 리스펙트!",
"challenge": "챌린지 런 완주. 같은 도전에 나선 분들께 리스펙트.",
"side_quest": "사이드 퀘스트 여정 — 메인 스토리 잠시 쉬어가게 해주셔서 감사합니다!",
"secret": "비밀 콘텐츠 해제 🔓 더 깊은 탐험을 원하시면 댓글로 알려주세요.",
"comparison": "{{gameName}} 그래픽 비교 — 어느 쪽이 더 좋으신가요?",
"guide": "이 무음 가이드가 도움이 되었길 바랍니다. 타임스탬프는 설명란에.",
"mods": "모드 플레이 — 로드 오더와 크레딧은 설명란에.",
"collectibles": "모든 수집 요소를 한 영상에. 응원해 주셔서 감사합니다!",
"livestream": "{{gameName}} 라이브 방송에 오신 걸 환영합니다! 채팅에 인사 한 마디 부탁드려요 👋",
"gacha_quest": "Welcome back to {{gameName}} on {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 미완료",
"in_progress": "▶️ 진행 중"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}개 영상",
"storeSection": "🎮 게임 구매:",
"footer": "👍 좋아요 | 🔔 구독 부탁드립니다!",
@@ -77,5 +241,17 @@
"guide": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 무음 가이드입니다.\n해설 없음.",
"highlights": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 하이라이트 모음입니다.\n해설 없음."
}
},
"timeline": {
"keywords": {
"chapter": "제{{n}}장",
"part": "파트 {{n}}",
"boss": "보스 {{n}}",
"final_boss": "최종 보스",
"intro": "인트로",
"ending": "엔딩",
"tutorial": "튜토리얼",
"credits": "크레딧"
}
}
}
+270 -14
View File
@@ -14,6 +14,14 @@
"logs": "로그"
},
"editor": {
"sections": {
"gameInfo": "게임 정보",
"videoSettings": "비디오 설정",
"contentDetails": "콘텐츠 상세",
"attribution": "크레딧",
"rig": "내 장비",
"storeAndSocial": "스토어 & 소셜"
},
"videoType": "영상 유형",
"language": "출력 언어",
"genre": "게임 장르",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "예: Shadow of the Erdtree",
"challengeName": "챌린지 이름",
"challengeNamePlaceholder": "예: 노히트 런",
"modName": "모드 이름",
"modNamePlaceholder": "예: Requiem, NaturalVision Evolved",
"modList": "Mod List",
"modListPlaceholder": "List the mods you used, one per line. Paste from your mod manager works.",
"gachaQuestType": "Quest Type",
"gachaQuestTypeOptions": {
"main_story": "Main Story",
"world_quest": "World Quest",
"side_quest": "Side Quest",
"spinoff_quest": "Spinoff Quest",
"companion_quest": "Companion Quest",
"bond_quest": "Bond Quest",
"event": "Event",
"anniversary": "Anniversary",
"crossover": "Crossover",
"dating_event": "Dating Event",
"tutorial_quest": "Tutorial",
"guide_quest": "Guide Quest",
"trial_quest": "Trial Quest",
"endgame": "Endgame Mode",
"coop": "Co-op",
"daily_commission": "Daily Commissions",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Story",
"events": "Events",
"tutorial_trial": "Tutorial / Trial",
"endgame_multiplayer": "Endgame / Multiplayer",
"showcase": "Showcase"
},
"chapterName": "Chapter / Story Arc",
"chapterNamePlaceholder": "e.g. Chapter 5 Act 2: Where the Stars Fall",
"questName": "Quest Name",
"questNamePlaceholder": "e.g. A Solitary Constellation",
"vnDonate": "Donate (Vietnam)",
"vnDonateHelp": "Only rendered into the description when output language is Vietnamese.",
"vnBankName": "Bank name",
"vnBankNamePlaceholder": "e.g. Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Account number",
"vnBankAccountPlaceholder": "e.g. 0123456789",
"vnBankHolder": "Account holder",
"vnBankHolderPlaceholder": "e.g. NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "MoMo phone number",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "ZaloPay phone number",
"resolution": "해상도",
"fps": "FPS",
"graphicsPreset": "그래픽 프리셋",
"graphicsPresetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme",
"custom": "Custom…"
},
"graphicsPresetCustom": "Custom preset name",
"graphicsPresetCustomPlaceholder": "e.g. Epic, Maximum",
"skipGraphicsSettings": "This game has no in-game graphics settings",
"skipGraphicsSettingsHelp": "Hide the Video Settings section in the description for 2D / pixel-art / web games.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Frame Gen Vendor",
"frameGenVendorOptions": {
"none": "None",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Frame Gen Multiplier",
"frameGenMultiplierOptions": {
"none": "None",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Upscaling Quality",
"upscaleQualityOptions": {
"none": "None",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Art Style",
"artStyleOptions": {
"none": "— Not set —",
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"versionInfo": "Driver / Game Version",
"versionInfoPlaceholder": "e.g. GeForce 565.90 | Game v1.4",
"liveUrl": "Live URL",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Scheduled Time",
"skipGraphicsHintLabel": "This looks like a game without graphics settings — hide the section?",
"skipGraphicsHintHide": "Hide",
"skipGraphicsHintKeep": "Keep",
"timestamps": "타임스탬프",
"timestampsPlaceholder": "0:00 인트로\n5:30 챕터 1\n15:00 보스전",
"storeLinks": "스토어 링크",
"storeLinkType": "유형",
"rig": "내 장비",
"social": "소셜 및 후원 링크",
"warnings": "경고",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "문의 이메일",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "음악 / 사운드 크레딧",
"musicAttributionPlaceholder": "음악: Karl Casey @ White Bat Audio\n효과음: Freesound.org",
"sponsorName": "스폰서 (퍼블리셔 / 개발사)",
"sponsorNamePlaceholder": "예: Ubisoft, 캡콤, Devolver Digital",
"sponsorPlatform": "키 플랫폼",
"sponsorPlatformPlaceholder": "예: Steam, Epic Games, GOG",
"thumbnailText": "썸네일 텍스트",
"thumbnailTextPlaceholder": "예: 시크릿 보스 노히트",
"pinnedComment": "고정 댓글 템플릿",
"pinnedCommentPlaceholder": "고정 댓글 내용...",
"playthrough": "플레이 방식",
"playthroughOptions": {
"none": "— 선택 안 함 —",
"blind": "초회차 (블라인드)",
"replay": "재플레이",
"newgame_plus": "New Game+",
"postgame": "엔드 콘텐츠 / 후반부"
},
"difficulty": "난이도",
"difficultyOptions": {
"none": "— 선택 안 함 —",
"easy": "쉬움",
"normal": "보통",
"hard": "어려움",
"nightmare": "악몽 / 최고 난이도",
"custom": "사용자 지정…"
},
"difficultyCustomLabel": "사용자 지정 난이도 라벨",
"difficultyCustomPlaceholder": "예: Lethal, NG+7, Fromsoft default",
"contentWarnings": "콘텐츠 경고",
"contentWarningOptions": {
"flashing_lights": "⚡ 점멸 효과",
"loud_noises": "🔊 큰 소리",
"jump_scares": "😱 점프 스케어"
},
"videoSettings": "영상 설정",
"quickPreview": "빠른 미리보기",
"version": "버전",
"clearDraft": "초안 지우기",
"draftSaved": "초안 저장됨",
"clearDraftConfirm": "모든 양식 데이터를 지우시겠습니까?",
"contactEmailHelp": "최대 3개 이메일, 쉼표로 구분"
"genreSearchPlaceholder": "장르 검색",
"genreSearchNoResults": "일치하는 장르 없음",
"genreGroups": {
"rpg": "모든 RPG",
"shooter": "모든 슈터",
"horror": "모든 호러"
},
"contactEmailHelp": "최대 3개 이메일, 쉼표로 구분",
"toast": {
"urlAutoFilled": "URL에서 '{{name}}'을(를) 자동 채웠습니다"
},
"warning": {
"linkNameMismatch": "링크를 확인하고 다시 추가하세요 — '{{host}}'은(는) '{{suggestedName}}'을(를) 가리키지만, 게임 이름은 '{{gameName}}'입니다."
}
},
"output": {
"title": "제목",
@@ -62,7 +234,20 @@
"copyAll": "전체 복사",
"copied": "복사 완료!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "언어 선택"
"selectLanguages": "언어 선택",
"thumbnailText": "썸네일 텍스트",
"copyThumbnailText": "썸네일 텍스트 복사",
"pinnedComment": "고정 댓글",
"copyPinnedComment": "고정 댓글 복사",
"pinnedCommentTemplate": "고정 댓글 (템플릿)",
"copyPinnedCommentTemplate": "고정 댓글 템플릿 복사",
"generateAlternatives": "제목 대안 생성",
"saveAsTemplate": "템플릿으로 저장",
"variants": {
"default": "기본",
"typeFirst": "유형 우선",
"qualityFirst": "화질 우선"
}
},
"common": {
"save": "저장",
@@ -73,11 +258,15 @@
"import": "가져오기",
"reset": "초기화",
"search": "검색",
"generate": "생성"
"generate": "생성",
"undo": "되돌리기",
"dismiss": "닫기"
},
"videoTypes": {
"full": "전체 게임플레이",
"part": "게임플레이 파트",
"full_demo": "전체 데모",
"demo_part": "데모 파트",
"boss": "보스전",
"boss_nohit": "보스 노히트",
"ending": "엔딩 / 모든 엔딩",
@@ -89,19 +278,37 @@
"side_quest": "서브 퀘스트",
"secret": "비밀 / 숨겨진 요소",
"comparison": "그래픽 비교",
"guide": "무음 가이드"
"guide": "무음 가이드",
"mods": "모드 플레이",
"collectibles": "모든 수집품",
"livestream": "라이브 방송",
"gacha_quest": "Gacha Quest"
},
"genres": {
"action": "액션 / 어드벤처",
"hack_slash": "핵앤슬래시",
"beatemup": "벨트스크롤 액션",
"platformer": "플랫포머",
"horror": "호러 / 서바이벌",
"rpg": "RPG / JRPG",
"survival_horror": "서바이벌 호러",
"psychological_horror": "심리 호러",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "액션 RPG",
"crpg": "CRPG / 아이소메트릭",
"fps": "FPS / 슈터",
"arena_shooter": "아레나 슈터",
"tactical_fps": "택티컬 FPS",
"boomer_shooter": "부머 슈터",
"extraction_shooter": "익스트랙션 슈터",
"shmup": "슈팅 / 탄막",
"openworld": "오픈 월드 / 샌드박스",
"indie": "인디 / 플랫포머",
"indie": "인디",
"soulslike": "소울라이크",
"racing": "레이싱 / 스포츠",
"story": "스토리 / 비주얼 노벨",
"story": "스토리 / 내러티브",
"simulation": "시뮬레이션 / 전략",
"city_builder": "도시 건설",
"fighting": "격투",
"stealth": "잠입 / 첩보",
"survival_craft": "서바이벌 / 크래프팅",
@@ -112,12 +319,14 @@
"puzzle": "퍼즐",
"tower_defense": "타워 디펜스",
"card_game": "카드 게임",
"deck_builder": "덱 빌더",
"auto_battler": "오토 배틀러",
"battle_royale": "배틀로얄",
"crpg": "CRPG / 아이소메트릭",
"tactical": "전술 / 턴제",
"space": "우주 / SF",
"farming": "농장 / 라이프 시뮬",
"fmv": "FMV / 인터랙티브 무비"
"fmv": "FMV / 인터랙티브 무비",
"visual_novel": "비주얼 노벨"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "모니터",
"capture": "캡처 소프트웨어",
"motherboard": "메인보드",
"controller": "컨트롤러"
"controller": "컨트롤러",
"video_editor": "영상 편집 프로그램"
},
"social": {
"kofi": "Ko-fi",
@@ -172,6 +382,21 @@
"exportProfiles": "프로필 내보내기",
"importProfiles": "프로필 가져오기"
},
"templates": {
"title": "템플릿",
"createNew": "템플릿 만들기",
"saveAsTemplate": "템플릿으로 저장",
"templateName": "템플릿 이름",
"templateNamePlaceholder": "예: 엘든 링 보스전",
"loadTemplate": "적용",
"deleteConfirm": "이 템플릿을 삭제하시겠습니까?",
"emptyState": "아직 템플릿이 없습니다. 현재 폼을 저장하여 재사용하세요.",
"saveHint": "에디터의 모든 필드를 저장하여 나중에 동일한 상태로 복원할 수 있습니다.",
"savedAs": "'{{name}}'(으)로 저장됨",
"appliedToast": "'{{name}}' 적용됨",
"exportTemplates": "템플릿 내보내기",
"importTemplates": "템플릿 가져오기"
},
"presets": {
"title": "게임 프리셋",
"createNew": "프리셋 만들기",
@@ -202,13 +427,36 @@
"appLanguage": "앱 언어",
"defaultOutputLanguage": "기본 출력 언어",
"defaultGenre": "기본 장르",
"autoSaveDraft": "초안 자동 저장",
"showCharCount": "글자 수 표시",
"compactTagDisplay": "태그 간략 표시",
"historyLimit": "기록 제한",
"multilingualTags": "다국어 태그",
"trendingTags": "인기 태그",
"hashtagCount": "해시태그 수"
"hashtagCount": "해시태그 수",
"showQualityBadge": "제목에 화질 배지 표시 (예: [2K 60FPS])",
"showCopyright": "설명란에 © 저작권 줄 추가",
"showUsagePolicy": "설명란에 영상 사용 정책 블록 추가",
"showSponsorCredit": "설명란에 스폰서 감사 문구 추가 (키 제공)",
"titleFormatTitle": "제목 형식",
"descriptionSettingsTitle": "설명",
"badgePosition": "품질 배지 위치",
"badgePositionPrefix": "접두부 (게임명 앞)",
"badgePositionMiddle": "중간 (영상 유형에 부착)",
"badgePositionSuffix": "접미부 (끝 앞)",
"titleSeparator": "구분자",
"titleSeparatorEmDash": "엠 대시 ( — )",
"titleSeparatorHyphen": "하이픈 ( - )",
"titleSeparatorColon": "콜론 ( : )",
"titleSeparatorPipe": "파이프 ( | )",
"badgeCase": "배지 대소문자",
"badgeCaseUpper": "대문자 (2K)",
"badgeCaseLower": "소문자 (2k)",
"showPinnedCommentTemplate": "출력과 함께 고정 댓글 템플릿 생성",
"pinnedCommentIncludeAskNextGame": "\"다음에 어떤 게임을 플레이할까요?\" 문구 포함",
"pinnedCommentIncludeGenrePlaylist": "Include genre-playlist suggestion in pinned comment",
"genrePlaylistsTitle": "Genre Playlists",
"genrePlaylistsHelp": "Configure a YouTube playlist URL per genre. The pinned-comment template will auto-suggest the matching playlist when the video's primary genre is selected.",
"genrePlaylistsEmptyHint": "Leave empty to skip a genre."
},
"batch": {
"title": "일괄 생성",
@@ -224,13 +472,21 @@
"copyAll": "전체 복사",
"saveDraft": "초안 저장",
"help": "도움말",
"close": "닫기"
"close": "닫기",
"searchPlaceholder": "단축키 검색",
"noResults": "일치하는 단축키 없음"
},
"validation": {
"emailInvalid": "잘못된 이메일: {{email}}",
"emailMaxExceeded": "최대 {{max}}개 이메일 허용 (현재 {{count}}개)",
"urlInvalid": "잘못된 URL입니다. https://로 시작해야 합니다",
"urlPrefixMismatch": "{{expected}}로 시작하는 URL이 필요합니다"
"urlPrefixMismatch": "{{expected}}로 시작하는 URL이 필요합니다",
"playlistUrlInvalid": "잘못된 YouTube 재생목록 URL입니다. 예상 형식: {{expected}}"
},
"storeLinkTypes": {
"paid": "유료",
"free": "무료",
"demo": "무료 데모"
},
"playlist": {
"title": "플레이리스트 생성기",
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "Phần {{partNumber}}",
"full_demo": "Bản Demo",
"demo_part": "Demo Phần {{partNumber}}",
"boss": "{{bossName}} Boss Fight",
"boss_nohit": "{{bossName}} Boss No Hit",
"ending": "Kết thúc",
@@ -16,13 +24,43 @@
"side_quest": "Nhiệm vụ phụ",
"secret": "Bí mật",
"comparison": "So sánh",
"guide": "Hướng dẫn"
"guide": "Hướng dẫn",
"mods": "Mod {{modName}}",
"collectibles": "Tất cả Sưu tầm",
"livestream": "🔴 LIVE",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — Nhiệm vụ thế giới: {{questName}}",
"side_quest": "{{gameName}} — Nhiệm vụ phụ: {{questName}}",
"spinoff_quest": "{{gameName}} — Ngoại truyện: {{questName}}",
"companion_quest": "{{gameName}} — Nhiệm vụ đồng hành: {{questName}}",
"bond_quest": "{{gameName}} — Nhiệm vụ thân mật: {{questName}}",
"event": "{{gameName}} — Sự kiện: {{questName}}",
"anniversary": "{{gameName}} — Kỷ niệm {{chapterName}}{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Hẹn hò: {{questName}}",
"tutorial_quest": "{{gameName}} — Hướng dẫn: {{questName}}",
"guide_quest": "{{gameName}} — Chỉ dẫn: {{questName}}",
"trial_quest": "{{gameName}} — Thử thách: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Nhiệm vụ hàng ngày{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Phần {{n}}",
"day": " - Ngày {{n}}",
"floor": " - Tầng {{n}}"
}
},
"description": {
"intro": {
"full": "Video này là full gameplay của {{gameName}} trên kênh {{channelName}}.",
"part": "Video này là Phần {{partNumber}} của {{gameName}} trên kênh {{channelName}}.",
"full_demo": "Video này là bản demo đầy đủ của {{gameName}} trên kênh {{channelName}}.",
"demo_part": "Video này là Phần {{partNumber}} của bản demo {{gameName}} trên kênh {{channelName}}.",
"boss": "Video này là trận đánh boss {{bossName}} trong {{gameName}} trên kênh {{channelName}}.",
"boss_nohit": "Video này là trận đánh boss {{bossName}} (No Hit) trong {{gameName}} trên kênh {{channelName}}.",
"ending": "Video này là phần kết thúc của {{gameName}} trên kênh {{channelName}}.",
@@ -34,21 +72,147 @@
"side_quest": "Video này là các nhiệm vụ phụ trong {{gameName}} trên kênh {{channelName}}.",
"secret": "Video này là nội dung bí mật và ẩn trong {{gameName}} trên kênh {{channelName}}.",
"comparison": "Video này so sánh đồ họa/hiệu suất của {{gameName}} trên kênh {{channelName}}.",
"guide": "Video này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}."
"guide": "Video này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}.",
"mods": "Video này showcase mod {{modName}} cho {{gameName}} trên kênh {{channelName}}.",
"collectibles": "Video này gom đủ mọi vật phẩm sưu tầm và 100% completion trong {{gameName}} trên kênh {{channelName}}.",
"livestream": "Livestream {{gameName}} trên kênh {{channelName}}. Tham gia chat và chào mọi người nhé!",
"gacha_quest_main_story": "Chào mừng đến với {{chapterName}} của {{gameName}} trên kênh {{channelName}}!",
"gacha_quest_world_quest": "Hôm nay mình làm Nhiệm vụ thế giới \"{{questName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_side_quest": "Nhiệm vụ phụ \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_spinoff_quest": "Nhiệm vụ ngoại truyện \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_companion_quest": "Nhiệm vụ đồng hành \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_bond_quest": "Nhiệm vụ thân mật \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_event": "Sự kiện \"{{questName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_anniversary": "Lễ kỷ niệm {{chapterName}} của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_crossover": "Sự kiện Crossover \"{{questName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_dating_event": "Sự kiện hẹn hò \"{{questName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_tutorial_quest": "Hướng dẫn \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_guide_quest": "Nhiệm vụ chỉ dẫn \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_trial_quest": "Nhiệm vụ thử thách \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_endgame": "Chế độ cuối game \"{{chapterName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_coop": "Co-op \"{{questName}}\" trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_daily_commission": "Nhiệm vụ hàng ngày trong {{gameName}} trên kênh {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" của {{gameName}} trên kênh {{channelName}}."
},
"noCommentaryLine": "Không bình luận — gameplay thuần túy để bạn thưởng thức.",
"storeLinkSuffix": {
"free": "miễn phí",
"demo": "demo miễn phí"
},
"sections": {
"timestamps": "⏱ MỐC THỜI GIAN",
"storeLinks": "🎮 MUA GAME",
"storeLinksBuy": "🎮 MUA GAME (nếu bạn muốn ủng hộ)",
"storeLinksDownload": "⬇️ TẢI GAME (nếu bạn muốn chơi)",
"videoSettings": "🖥 CÀI ĐẶT VIDEO",
"rig": "💻 CẤU HÌNH MÁY",
"modList": "🧩 DANH SÁCH MOD",
"vnDonate": "🏦 CHUYỂN KHOẢN / VÍ ĐIỆN TỬ (Việt Nam)",
"spoilerWarning": "⚠️ CẢNH BÁO SPOILER: Video này có thể chứa nội dung spoiler. Xem theo ý muốn của bạn!",
"matureWarning": "🔞 NỘI DUNG NGƯỜI LỚN (18+): Chứa bạo lực / ngôn ngữ mạnh / nội dung nhạy cảm.",
"sponsorCredit": "🎁 Cảm ơn {{sponsor}} đã tặng key {{platform}} của game này.",
"music": "🎵 NHẠC / ÂM THANH",
"donate": "☕ ỦNG HỘ KÊNH",
"social": "🔗 THEO DÕI MÌNH",
"playlist": "▶️ Xem toàn bộ series: {{link}}",
"contact": "📧 Liên hệ hợp tác: {{email}}",
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ"
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ",
"copyright": "© {{year}} {{channelName}}. Đã đăng ký bản quyền.",
"usagePolicyHeader": "📋 ĐIỀU KIỆN DÙNG VIDEO",
"usagePolicy": "• Luôn luôn ghi credit kèm link video gốc VÀ kênh (tối thiểu trong phần mô tả).\n• Không re-upload toàn bộ video hoặc phần lớn nội dung dưới dạng content của bạn.\n• Không kiếm tiền từ footage mà chưa có sự đồng ý rõ ràng.\n• Không chỉnh sửa footage theo cách xuyên tạc nội dung gốc hoặc người tạo.\n• Compilation, review, commentary, reaction video đều OK miễn là có credit.\nNếu không chắc, liên hệ qua các kênh social hoặc email ở phần mô tả.",
"playthrough": "🎯 Playthrough: {{value}}",
"difficulty": "🎮 ĐỘ KHÓ",
"contentWarnings": "⚠️ CẢNH BÁO NỘI DUNG"
},
"playthrough": {
"blind": "Chơi lần đầu (blind run)",
"replay": "Chơi lại",
"newgame_plus": "New Game+",
"postgame": "Post-game / endgame"
},
"difficulty": {
"easy": "Dễ",
"normal": "Thường",
"hard": "Khó",
"nightmare": "Ác mộng / Cực khó"
},
"contentWarnings": {
"flashing_lights": "⚡ Ánh sáng chớp / hiệu ứng strobe",
"loud_noises": "🔊 Âm thanh lớn / tiếng nổ bất ngờ",
"jump_scares": "😱 Jump scare"
},
"graphics": {
"with": "với",
"artStyle": "Phong cách hình ảnh",
"presetOptions": {
"low": "Thấp",
"medium": "Trung bình",
"high": "Cao",
"very_high": "Rất cao",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Cực đại"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "Hiện thực",
"stylized": "Cách điệu",
"anime": "Anime",
"cel_shaded": "Cel-shading",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Vẽ tay",
"comic": "Truyện tranh",
"photorealistic": "Siêu thực"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 LIVE vào {{time}}",
"watchLine": "Xem / xem lại: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "Cảm ơn mọi người đã xem! Hi vọng các bạn thích video gameplay này.",
"playlistPrompt": "📺 Xem toàn bộ series tại đây: {{link}}",
"engagementPrompt": "Đừng quên like & subscribe nếu muốn xem thêm — ủng hộ kênh rất nhiều 💚",
"askNextGame": "💬 Các bạn muốn mình chơi game nào tiếp theo? Comment gợi ý nha!",
"genrePlaylistSuggestion": "📺 Xem thêm các video {{genreLabel}} khác trên kênh: {{link}}",
"greetings": {
"full": "Đây là bản chơi full {{gameName}} — chúc mọi người thưởng thức trọn vẹn.",
"part": "Chào mừng các bạn quay lại với {{gameName}} trên {{channelName}}!",
"full_demo": "Full demo của {{gameName}} — các bạn có muốn mình chơi bản full khi ra mắt không?",
"demo_part": "Demo tiếp tục — đang hype chờ bản full. Các bạn cùng hype không?",
"boss": "Con boss này căng thật. Comment chia sẻ trận của bạn nhé!",
"boss_nohit": "No-hit run — thử mấy lần mới được. Thấy hay nhớ thả like!",
"ending": "⚠️ Đây là ending — cảm ơn mọi người đã đồng hành cùng {{channelName}}.",
"speedrun": "Speedrun hoàn tất — times và route chia sẻ ở comment nhé!",
"100percent": "100% hoàn thành 🏆 Cảm ơn các bạn đã theo dõi đến tận cuối.",
"dlc": "Bản DLC của {{gameName}} — moment nào ấn tượng nhất với bạn?",
"newgame_plus": "NG+ tức là mọi thứ khó hơn. Respect ai đang chơi lại cùng mình.",
"challenge": "Challenge run hoàn tất. Respect ai định thử thách tương tự.",
"side_quest": "Đi side-quest đổi gió — cảm ơn các bạn đã tạm xa main story!",
"secret": "Mở khóa nội dung bí mật 🔓 Muốn xem thêm deep-dive thì comment nha.",
"comparison": "So sánh đồ hoạ {{gameName}} — bản nào thắng với bạn?",
"guide": "Hy vọng silent guide này hữu ích. Timestamps có trong mô tả.",
"mods": "Modded run — full load order / credits trong mô tả.",
"collectibles": "Full collectible trong 1 video. Cảm ơn các bạn đã ủng hộ!",
"livestream": "Chào mừng đến với buổi stream {{gameName}}! Để lại lời chào trong chat nhé 👋",
"gacha_quest": "Chào các bạn đã quay trở lại với {{gameName}} trên kênh {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 Chưa hoàn thành",
"in_progress": "▶️ Đang chơi"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}} video",
"storeSection": "🎮 Tải / mua game:",
"footer": "👍 Like | 🔔 Subscribe để xem thêm gameplay!",
@@ -77,5 +241,17 @@
"guide": "Playlist này là hướng dẫn không lời cho {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
"highlights": "Playlist này là tổng hợp khoảnh khắc hay nhất của {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy."
}
},
"timeline": {
"keywords": {
"chapter": "Chương {{n}}",
"part": "Phần {{n}}",
"boss": "Boss {{n}}",
"final_boss": "Boss cuối",
"intro": "Mở đầu",
"ending": "Kết thúc",
"tutorial": "Hướng dẫn",
"credits": "Credits"
}
}
}
+270 -14
View File
@@ -14,6 +14,14 @@
"logs": "Nhật ký"
},
"editor": {
"sections": {
"gameInfo": "Thông tin game",
"videoSettings": "Cài đặt video",
"contentDetails": "Nội dung video",
"attribution": "Credit / Ghi chú",
"rig": "Cấu hình máy",
"storeAndSocial": "Store & Mạng xã hội"
},
"videoType": "Loại Video",
"language": "Ngôn ngữ đầu ra",
"genre": "Thể loại Game",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "VD: Shadow of the Erdtree",
"challengeName": "Tên Challenge",
"challengeNamePlaceholder": "VD: No Hit Run",
"modName": "Tên Mod",
"modNamePlaceholder": "vd: Requiem, NaturalVision Evolved",
"modList": "Danh sách mod",
"modListPlaceholder": "Liệt kê các mod đã dùng, mỗi mod một dòng. Có thể paste trực tiếp từ mod manager.",
"gachaQuestType": "Loại nhiệm vụ",
"gachaQuestTypeOptions": {
"main_story": "Cốt truyện chính",
"world_quest": "Nhiệm vụ thế giới",
"side_quest": "Nhiệm vụ phụ",
"spinoff_quest": "Nhiệm vụ ngoại truyện",
"companion_quest": "Nhiệm vụ đồng hành",
"bond_quest": "Nhiệm vụ thân mật",
"event": "Sự kiện",
"anniversary": "Kỷ niệm",
"crossover": "Crossover",
"dating_event": "Sự kiện hẹn hò",
"tutorial_quest": "Hướng dẫn",
"guide_quest": "Nhiệm vụ chỉ dẫn",
"trial_quest": "Nhiệm vụ thử thách",
"endgame": "Chế độ cuối game",
"coop": "Co-op",
"daily_commission": "Nhiệm vụ hàng ngày",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Cốt truyện",
"events": "Sự kiện",
"tutorial_trial": "Hướng dẫn / Thử thách",
"endgame_multiplayer": "Cuối game / Nhiều người chơi",
"showcase": "Showcase"
},
"chapterName": "Chương / Cốt truyện",
"chapterNamePlaceholder": "vd: Chương 5 Hồi 2 — Nơi Vì Sao Rơi",
"questName": "Tên nhiệm vụ",
"questNamePlaceholder": "vd: Chòm Sao Đơn Độc",
"vnDonate": "Donate (Việt Nam)",
"vnDonateHelp": "Chỉ hiển thị trong description khi ngôn ngữ đầu ra là Tiếng Việt.",
"vnBankName": "Tên ngân hàng",
"vnBankNamePlaceholder": "vd: Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Số tài khoản",
"vnBankAccountPlaceholder": "vd: 0123456789",
"vnBankHolder": "Chủ tài khoản",
"vnBankHolderPlaceholder": "vd: NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "Số điện thoại MoMo",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "Số điện thoại ZaloPay",
"resolution": "Độ phân giải",
"fps": "FPS",
"graphicsPreset": "Cài đặt đồ họa",
"graphicsPresetOptions": {
"low": "Thấp",
"medium": "Trung bình",
"high": "Cao",
"very_high": "Rất cao",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Cực đại",
"custom": "Tùy chỉnh…"
},
"graphicsPresetCustom": "Tên preset tuỳ chỉnh",
"graphicsPresetCustomPlaceholder": "vd: Epic, Maximum",
"skipGraphicsSettings": "Game này không có cài đặt đồ hoạ trong game",
"skipGraphicsSettingsHelp": "Ẩn phần Video Settings trong description cho các game 2D / pixel-art / web.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Nhà SX Frame Gen",
"frameGenVendorOptions": {
"none": "Không",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Hệ số Frame Gen",
"frameGenMultiplierOptions": {
"none": "Không",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Chất lượng Upscale",
"upscaleQualityOptions": {
"none": "Không",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Phong cách hình ảnh",
"artStyleOptions": {
"none": "— Chưa chọn —",
"realistic": "Hiện thực",
"stylized": "Cách điệu",
"anime": "Anime",
"cel_shaded": "Cel-shading",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Vẽ tay",
"comic": "Truyện tranh",
"photorealistic": "Siêu thực"
},
"versionInfo": "Phiên bản Driver / Game",
"versionInfoPlaceholder": "vd: GeForce 565.90 | Game v1.4",
"liveUrl": "URL Livestream",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Thời gian phát",
"skipGraphicsHintLabel": "Có vẻ game này không có cài đặt đồ hoạ — ẩn phần này luôn nhé?",
"skipGraphicsHintHide": "Ẩn",
"skipGraphicsHintKeep": "Giữ",
"timestamps": "Mốc thời gian",
"timestampsPlaceholder": "0:00 Giới thiệu\n5:30 Chương 1\n15:00 Đánh Boss",
"storeLinks": "Link mua game",
"storeLinkType": "Loại",
"rig": "Cấu hình máy",
"social": "Mạng xã hội & Donate",
"warnings": "Cảnh báo",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "Email liên hệ",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "Credit nhạc / âm thanh",
"musicAttributionPlaceholder": "Nhạc: Karl Casey @ White Bat Audio\nSFX: Freesound.org",
"sponsorName": "Sponsor (publisher / developer)",
"sponsorNamePlaceholder": "Ví dụ: Ubisoft, Capcom, Devolver Digital",
"sponsorPlatform": "Platform của key",
"sponsorPlatformPlaceholder": "Ví dụ: Steam, Epic Games, GOG",
"thumbnailText": "Text thumbnail",
"thumbnailTextPlaceholder": "vd: SECRET BOSS NO HIT",
"pinnedComment": "Bình luận ghim",
"pinnedCommentPlaceholder": "Nội dung bình luận ghim cho video...",
"playthrough": "Kiểu chơi",
"playthroughOptions": {
"none": "— Chưa chọn —",
"blind": "Blind (lần đầu)",
"replay": "Chơi lại",
"newgame_plus": "New Game+",
"postgame": "Post-game / endgame"
},
"difficulty": "Độ khó",
"difficultyOptions": {
"none": "— Chưa chọn —",
"easy": "Dễ",
"normal": "Thường",
"hard": "Khó",
"nightmare": "Ác mộng / Cực khó",
"custom": "Tuỳ chỉnh…"
},
"difficultyCustomLabel": "Nhãn độ khó tuỳ chỉnh",
"difficultyCustomPlaceholder": "vd: Lethal, NG+7, Fromsoft default",
"contentWarnings": "Cảnh báo nội dung",
"contentWarningOptions": {
"flashing_lights": "⚡ Ánh sáng chớp",
"loud_noises": "🔊 Âm thanh lớn",
"jump_scares": "😱 Jump scare"
},
"videoSettings": "Cài đặt Video",
"quickPreview": "Xem trước nhanh",
"version": "Phiên bản",
"clearDraft": "Xóa bản nháp",
"draftSaved": "Đã lưu nháp",
"clearDraftConfirm": "Bạn có chắc muốn xóa toàn bộ dữ liệu form?",
"contactEmailHelp": "Tối đa 3 email, cách nhau bằng dấu phẩy"
"genreSearchPlaceholder": "Tìm thể loại",
"genreSearchNoResults": "Không có thể loại phù hợp",
"genreGroups": {
"rpg": "Tất cả RPG",
"shooter": "Tất cả Shooter",
"horror": "Tất cả Horror"
},
"contactEmailHelp": "Tối đa 3 email, cách nhau bằng dấu phẩy",
"toast": {
"urlAutoFilled": "Đã tự động điền '{{name}}' từ URL"
},
"warning": {
"linkNameMismatch": "Kiểm tra link và thêm lại — '{{host}}' gợi ý '{{suggestedName}}', nhưng Tên Game đang là '{{gameName}}'."
}
},
"output": {
"title": "Tiêu đề",
@@ -62,7 +234,20 @@
"copyAll": "Sao chép tất cả",
"copied": "Đã sao chép!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "Chọn ngôn ngữ"
"selectLanguages": "Chọn ngôn ngữ",
"thumbnailText": "Text thumbnail",
"copyThumbnailText": "Sao chép text thumbnail",
"pinnedComment": "Bình luận ghim",
"copyPinnedComment": "Sao chép bình luận ghim",
"pinnedCommentTemplate": "Bình luận ghim (Mẫu)",
"copyPinnedCommentTemplate": "Sao chép mẫu bình luận ghim",
"generateAlternatives": "Tạo biến thể tiêu đề",
"saveAsTemplate": "Lưu thành template",
"variants": {
"default": "Mặc định",
"typeFirst": "Loại video trước",
"qualityFirst": "Chất lượng trước"
}
},
"common": {
"save": "Lưu",
@@ -73,11 +258,15 @@
"import": "Nhập",
"reset": "Đặt lại",
"search": "Tìm kiếm",
"generate": "Tạo"
"generate": "Tạo",
"undo": "Hoàn tác",
"dismiss": "Bỏ qua"
},
"videoTypes": {
"full": "Full Gameplay",
"part": "Gameplay Phần",
"full_demo": "Bản Demo đầy đủ",
"demo_part": "Demo Phần",
"boss": "Boss Fight",
"boss_nohit": "Boss No Hit",
"ending": "Kết thúc",
@@ -89,19 +278,37 @@
"side_quest": "Nhiệm vụ phụ",
"secret": "Bí mật / Ẩn",
"comparison": "So sánh đồ họa",
"guide": "Hướng dẫn"
"guide": "Hướng dẫn",
"mods": "Chơi với Mod",
"collectibles": "Full Sưu Tầm",
"livestream": "Livestream",
"gacha_quest": "Game Gacha"
},
"genres": {
"action": "Hành động / Phiêu lưu",
"hack_slash": "Chặt chém (Hack & Slash)",
"beatemup": "Đấm đá (Beat 'em Up)",
"platformer": "Platformer",
"horror": "Kinh dị / Sinh tồn",
"rpg": "RPG / JRPG",
"survival_horror": "Kinh dị sinh tồn",
"psychological_horror": "Kinh dị tâm lý",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "Action RPG",
"crpg": "CRPG / Isometric",
"fps": "FPS / Bắn súng",
"arena_shooter": "Bắn súng đấu trường",
"tactical_fps": "FPS chiến thuật",
"boomer_shooter": "Boomer Shooter",
"extraction_shooter": "Extraction Shooter",
"shmup": "Shoot 'em Up / Bullet Hell",
"openworld": "Thế giới mở / Sandbox",
"indie": "Indie / Platformer",
"indie": "Indie",
"soulslike": "Souls-like",
"racing": "Đua xe / Thể thao",
"story": "Cốt truyện / Visual Novel",
"story": "Cốt truyện",
"simulation": "Mô phỏng / Chiến thuật",
"city_builder": "Xây dựng thành phố",
"fighting": "Đối kháng",
"stealth": "Hành động lén",
"survival_craft": "Sinh tồn / Chế tạo",
@@ -112,12 +319,14 @@
"puzzle": "Giải đố",
"tower_defense": "Tower Defense",
"card_game": "Game thẻ bài",
"deck_builder": "Xây dựng bộ bài",
"auto_battler": "Auto Battler",
"battle_royale": "Battle Royale",
"crpg": "CRPG / Isometric",
"tactical": "Chiến thuật",
"space": "Vũ trụ / Sci-Fi",
"farming": "Nông trại / Life Sim",
"fmv": "FMV / Phim tương tác"
"fmv": "FMV / Phim tương tác",
"visual_novel": "Visual Novel"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "Màn hình",
"capture": "Phần mềm quay",
"motherboard": "Bo mạch chủ",
"controller": "Tay cầm"
"controller": "Tay cầm",
"video_editor": "Phần mềm dựng video"
},
"social": {
"kofi": "Ko-fi",
@@ -172,6 +382,21 @@
"exportProfiles": "Xuất hồ sơ",
"importProfiles": "Nhập hồ sơ"
},
"templates": {
"title": "Template",
"createNew": "Tạo template",
"saveAsTemplate": "Lưu thành template",
"templateName": "Tên template",
"templateNamePlaceholder": "vd: Elden Ring Boss Run",
"loadTemplate": "Áp dụng",
"deleteConfirm": "Bạn có chắc muốn xoá template này?",
"emptyState": "Chưa có template nào. Lưu form hiện tại để tái sử dụng.",
"saveHint": "Lưu toàn bộ field editor để sau này khôi phục đúng trạng thái.",
"savedAs": "Đã lưu '{{name}}'",
"appliedToast": "Đã áp dụng '{{name}}'",
"exportTemplates": "Xuất template",
"importTemplates": "Nhập template"
},
"presets": {
"title": "Cài đặt Game",
"createNew": "Tạo preset",
@@ -202,13 +427,36 @@
"appLanguage": "Ngôn ngữ ứng dụng",
"defaultOutputLanguage": "Ngôn ngữ đầu ra",
"defaultGenre": "Thể loại mặc định",
"autoSaveDraft": "Tự động lưu nháp",
"showCharCount": "Hiện số ký tự",
"compactTagDisplay": "Hiển thị tags gọn",
"historyLimit": "Giới hạn lịch sử",
"multilingualTags": "Tags đa ngôn ngữ",
"trendingTags": "Tags xu hướng",
"hashtagCount": "Số hashtag"
"hashtagCount": "Số hashtag",
"showQualityBadge": "Hiện badge chất lượng trong tiêu đề (vd: [2K 60FPS])",
"showCopyright": "Gắn dòng © copyright vào description",
"showUsagePolicy": "Gắn khối quy định sử dụng video vào description",
"showSponsorCredit": "Hiện dòng cảm ơn sponsor (tặng key) trong description",
"titleFormatTitle": "Định dạng tiêu đề",
"descriptionSettingsTitle": "Mô tả",
"badgePosition": "Vị trí badge chất lượng",
"badgePositionPrefix": "Đầu (trước tên game)",
"badgePositionMiddle": "Giữa (gắn với loại video)",
"badgePositionSuffix": "Cuối (trước đuôi)",
"titleSeparator": "Dấu phân tách",
"titleSeparatorEmDash": "Gạch dài ( — )",
"titleSeparatorHyphen": "Gạch ngang ( - )",
"titleSeparatorColon": "Hai chấm ( : )",
"titleSeparatorPipe": "Sổ đứng ( | )",
"badgeCase": "Kiểu chữ badge",
"badgeCaseUpper": "VIẾT HOA (2K)",
"badgeCaseLower": "viết thường (2k)",
"showPinnedCommentTemplate": "Tạo mẫu bình luận ghim cùng với output",
"pinnedCommentIncludeAskNextGame": "Kèm câu hỏi \"chơi game nào tiếp theo?\"",
"pinnedCommentIncludeGenrePlaylist": "Kèm gợi ý playlist theo thể loại trong pinned comment",
"genrePlaylistsTitle": "Playlist theo thể loại",
"genrePlaylistsHelp": "Cấu hình URL YouTube playlist cho từng thể loại. Pinned comment sẽ tự động gợi ý playlist phù hợp với thể loại chính của video.",
"genrePlaylistsEmptyHint": "Bỏ trống nếu chưa có playlist cho thể loại đó."
},
"batch": {
"title": "Chế độ hàng loạt",
@@ -224,13 +472,21 @@
"copyAll": "Sao chép tất cả",
"saveDraft": "Lưu nháp",
"help": "Hiện phím tắt",
"close": "Đóng"
"close": "Đóng",
"searchPlaceholder": "Tìm phím tắt",
"noResults": "Không có phím tắt phù hợp"
},
"validation": {
"emailInvalid": "Email không hợp lệ: {{email}}",
"emailMaxExceeded": "Tối đa {{max}} email (hiện tại {{count}})",
"urlInvalid": "URL không hợp lệ. Phải bắt đầu bằng https://",
"urlPrefixMismatch": "URL nên bắt đầu bằng {{expected}}"
"urlPrefixMismatch": "URL nên bắt đầu bằng {{expected}}",
"playlistUrlInvalid": "URL playlist YouTube không hợp lệ. Định dạng mong muốn: {{expected}}"
},
"storeLinkTypes": {
"paid": "Trả phí",
"free": "Miễn phí",
"demo": "Demo miễn phí"
},
"playlist": {
"title": "Tạo Playlist",
+181 -5
View File
@@ -1,10 +1,18 @@
{
"title": {
"separator": " — ",
"separators": {
"emDash": " — ",
"hyphen": " - ",
"colon": ": ",
"pipe": " | "
},
"suffix": "Gameplay No Commentary",
"videoType": {
"full": "",
"part": "第{{partNumber}}集",
"full_demo": "完整试玩",
"demo_part": "试玩第{{partNumber}}集",
"boss": "{{bossName}} Boss战",
"boss_nohit": "{{bossName}} Boss无伤",
"ending": "结局",
@@ -16,13 +24,43 @@
"side_quest": "支线任务",
"secret": "秘密",
"comparison": "画质对比",
"guide": "无声攻略"
"guide": "无声攻略",
"mods": "{{modName}} Mod",
"collectibles": "全收集要素",
"livestream": "🔴 直播",
"gacha_quest": ""
},
"gachaQuestType": {
"main_story": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"world_quest": "{{gameName}} — World Quest: {{questName}}",
"side_quest": "{{gameName}} — Side Quest: {{questName}}",
"spinoff_quest": "{{gameName}} — Spinoff: {{questName}}",
"companion_quest": "{{gameName}} — Companion Quest: {{questName}}",
"bond_quest": "{{gameName}} — Bond Quest: {{questName}}",
"event": "{{gameName}} — Event: {{questName}}",
"anniversary": "{{gameName}} — {{chapterName}} Anniversary{{partSuffix}}",
"crossover": "{{gameName}} — Crossover: {{questName}}",
"dating_event": "{{gameName}} — Dating Event: {{questName}}",
"tutorial_quest": "{{gameName}} — Tutorial: {{questName}}",
"guide_quest": "{{gameName}} — Guide: {{questName}}",
"trial_quest": "{{gameName}} — Trial: {{questName}}",
"endgame": "{{gameName}} — {{chapterName}}{{partSuffix}}",
"coop": "{{gameName}} — Co-op: {{questName}}",
"daily_commission": "{{gameName}} — Daily Commissions{{partSuffix}}",
"showcase": "{{gameName}} — Showcase: {{questName}}"
},
"gachaPartSuffix": {
"part": " - Part {{n}}",
"day": " - Day {{n}}",
"floor": " - Floor {{n}}"
}
},
"description": {
"intro": {
"full": "本视频展示了{{channelName}}的{{gameName}}完整游戏实况。",
"part": "本视频展示了{{channelName}}的{{gameName}}第{{partNumber}}集。",
"full_demo": "本视频展示了{{channelName}}的{{gameName}}完整试玩。",
"demo_part": "本视频展示了{{channelName}}的{{gameName}}试玩第{{partNumber}}集。",
"boss": "本视频展示了{{channelName}}的{{gameName}}中{{bossName}} Boss战。",
"boss_nohit": "本视频展示了{{channelName}}的{{gameName}}中{{bossName}} Boss战(无伤)。",
"ending": "本视频展示了{{channelName}}的{{gameName}}结局。",
@@ -34,21 +72,147 @@
"side_quest": "本视频展示了{{channelName}}的{{gameName}}支线任务与可选内容。",
"secret": "本视频展示了{{channelName}}的{{gameName}}秘密与隐藏内容。",
"comparison": "本视频展示了{{channelName}}的{{gameName}}画质对比。",
"guide": "本视频展示了{{channelName}}的{{gameName}}无声攻略。"
"guide": "本视频展示了{{channelName}}的{{gameName}}无声攻略。",
"mods": "本视频展示了{{channelName}}的{{gameName}}之{{modName}} Mod游玩。",
"collectibles": "本视频展示了{{channelName}}的{{gameName}}全收集要素与100%完成度。",
"livestream": "{{channelName}} 频道正在直播 {{gameName}}。来聊天室打个招呼吧!",
"gacha_quest_main_story": "Welcome to {{chapterName}} of {{gameName}} on {{channelName}}!",
"gacha_quest_world_quest": "Today's video covers the World Quest \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_side_quest": "Side Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_spinoff_quest": "Spinoff quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_companion_quest": "Companion Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_bond_quest": "Bond Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_event": "Limited-time Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_anniversary": "{{chapterName}} Anniversary celebration in {{gameName}} on {{channelName}}.",
"gacha_quest_crossover": "Crossover Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_dating_event": "Dating Event \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_tutorial_quest": "Tutorial \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_guide_quest": "Guide Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_trial_quest": "Trial Quest \"{{questName}}\" from {{gameName}} on {{channelName}}.",
"gacha_quest_endgame": "Endgame mode \"{{chapterName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_coop": "Co-op session \"{{questName}}\" in {{gameName}} on {{channelName}}.",
"gacha_quest_daily_commission": "Daily Commissions in {{gameName}} on {{channelName}}.",
"gacha_quest_showcase": "Showcase \"{{questName}}\" from {{gameName}} on {{channelName}}."
},
"noCommentaryLine": "无解说 — 纯粹的游戏体验,尽情享受。",
"storeLinkSuffix": {
"free": "免费",
"demo": "免费试玩"
},
"sections": {
"timestamps": "⏱ 时间戳",
"storeLinks": "🎮 获取游戏",
"storeLinksBuy": "🎮 获取游戏 (如果你想购买)",
"storeLinksDownload": "⬇️ 下载游戏 (如果你想游玩)",
"videoSettings": "🖥 视频设置",
"rig": "💻 我的配置",
"modList": "🧩 MOD 列表",
"vnDonate": "🏦 BANK TRANSFER / E-WALLET (Vietnam)",
"spoilerWarning": "⚠️ 剧透警告:本视频可能包含剧透内容,请自行斟酌观看!",
"matureWarning": "🔞 成人内容 (18+):包含暴力 / 强烈语言 / 血腥内容。",
"sponsorCredit": "🎁 感谢 {{sponsor}} 提供本游戏的 {{platform}} 激活码。",
"music": "🎵 音乐 / 音效",
"donate": "☕ 支持频道",
"social": "🔗 关注我",
"playlist": "▶️ 观看完整系列:{{link}}",
"contact": "📧 商务合作:{{email}}",
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享"
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享",
"copyright": "© {{year}} {{channelName}}. 版权所有。",
"usagePolicyHeader": "📋 视频使用规则",
"usagePolicy": "• 请务必附上原视频链接和频道的 credit(至少在描述中)。\n• 请勿将完整视频或大部分内容作为自己的内容重新上传。\n• 未经明确同意,请勿对素材进行商业化。\n• 请勿以歪曲原内容或创作者的方式剪辑素材。\n• 合集、评测、解说、反应视频均可 — 只要标明出处。\n如有疑问,请通过描述中的社交账号或邮箱联系我。",
"playthrough": "🎯 游玩方式: {{value}}",
"difficulty": "🎮 难度",
"contentWarnings": "⚠️ 内容警告"
},
"playthrough": {
"blind": "初见游玩 (blind)",
"replay": "重新游玩",
"newgame_plus": "New Game+",
"postgame": "通关后 / 后期内容"
},
"difficulty": {
"easy": "简单",
"normal": "普通",
"hard": "困难",
"nightmare": "噩梦 / 极难"
},
"contentWarnings": {
"flashing_lights": "⚡ 闪光 / 频闪效果",
"loud_noises": "🔊 大音量 / 突发音量",
"jump_scares": "😱 惊吓镜头"
},
"graphics": {
"with": "+",
"artStyle": "画风",
"presetOptions": {
"low": "低",
"medium": "中",
"high": "高",
"very_high": "极高",
"cinematic": "电影级",
"ultra": "超高",
"extreme": "极致"
},
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"upscaleQualityOptions": {
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyleOptions": {
"realistic": "写实",
"stylized": "风格化",
"anime": "动漫",
"cel_shaded": "卡通渲染",
"low_poly": "低多边形",
"voxel": "体素",
"pixel_art": "像素艺术",
"hand_drawn": "手绘",
"comic": "漫画",
"photorealistic": "超写实"
},
"videoLabel": "Video",
"inGameSettingLabel": "In-game Setting",
"versionLabel": "Version"
},
"livestream": {
"scheduledLine": "🔴 直播时间: {{time}}",
"watchLine": "观看 / 回放: {{link}}"
}
},
"pinnedComment": {
"thanksForWatching": "感谢观看!希望你喜欢这次的实况。",
"playlistPrompt": "📺 完整系列在这里: {{link}}",
"engagementPrompt": "如果喜欢记得点赞和订阅 — 对频道帮助很大 💚",
"askNextGame": "💬 下一期想看我玩什么游戏?评论区留言告诉我!",
"genrePlaylistSuggestion": "📺 频道更多 {{genreLabel}} 游戏视频: {{link}}",
"greetings": {
"full": "{{gameName}} 的完整流程 — 希望你从头到尾都喜欢。",
"part": "欢迎回到 {{channelName}} 的 {{gameName}} 实况!",
"full_demo": "{{gameName}} 的完整试玩 — 正式版发售时要继续玩吗?",
"demo_part": "试玩继续 — 非常期待正式版。你也一样吗?",
"boss": "这场 Boss 战挺激烈的。评论区聊聊你的战斗体验吧!",
"boss_nohit": "无伤挑战 — 尝试了好几次。如果喜欢记得点赞!",
"ending": "⚠️ 这就是结局 — 感谢一路陪伴 {{channelName}} 走完旅程。",
"speedrun": "速通尝试完成 — 欢迎评论区分享时间和路线!",
"100percent": "100% 全收集完成 🏆 感谢一路支持到最后。",
"dlc": "{{gameName}} DLC — 哪一段最打动你?",
"newgame_plus": "NG+ 意味着一切更难。敬重一起重玩的各位。",
"challenge": "挑战完成。敬重想尝试同样挑战的朋友。",
"side_quest": "支线任务小憩 — 感谢让我们从主线暂歇一下!",
"secret": "解锁隐藏内容 🔓 想看更多深挖内容的话评论告诉我。",
"comparison": "{{gameName}} 画面对比 — 你更喜欢哪一个?",
"guide": "希望这份无解说攻略对你有帮助。时间戳在描述中。",
"mods": "MOD 实况 — 完整加载顺序和致谢在描述中。",
"collectibles": "全收集一期完成。感谢大家支持!",
"livestream": "欢迎来到 {{gameName}} 直播!记得在聊天室打个招呼 👋",
"gacha_quest": "Welcome back to {{gameName}} on {{channelName}}!"
}
},
"hashtags": {
@@ -63,7 +227,7 @@
"incomplete": "🔄 未完成",
"in_progress": "▶️ 进行中"
},
"titleFormat": "{{status}} — {{gameName}} — Gameplay No Commentary",
"titleFormat": "{{status}} - {{gameName}}",
"videoCount": "📹 {{count}}个视频",
"storeSection": "🎮 获取游戏:",
"footer": "👍 点赞 | 🔔 订阅获取更多游戏实况!",
@@ -77,5 +241,17 @@
"guide": "本播放列表是{{channelName}}的{{gameName}}无声攻略。\n无解说。",
"highlights": "本播放列表包含{{channelName}}的{{gameName}}精彩集锦。\n无解说。"
}
},
"timeline": {
"keywords": {
"chapter": "第{{n}}章",
"part": "第{{n}}部分",
"boss": "Boss {{n}}",
"final_boss": "最终Boss",
"intro": "开场",
"ending": "结局",
"tutorial": "教程",
"credits": "片尾"
}
}
}
+270 -14
View File
@@ -14,6 +14,14 @@
"logs": "日志"
},
"editor": {
"sections": {
"gameInfo": "游戏信息",
"videoSettings": "视频设置",
"contentDetails": "内容详情",
"attribution": "署名",
"rig": "我的配置",
"storeAndSocial": "商店与社交"
},
"videoType": "视频类型",
"language": "输出语言",
"genre": "游戏类型",
@@ -30,12 +38,127 @@
"dlcNamePlaceholder": "例如:Shadow of the Erdtree",
"challengeName": "挑战名称",
"challengeNamePlaceholder": "例如:无伤通关",
"modName": "Mod 名称",
"modNamePlaceholder": "如:Requiem, NaturalVision Evolved",
"modList": "Mod List",
"modListPlaceholder": "List the mods you used, one per line. Paste from your mod manager works.",
"gachaQuestType": "Quest Type",
"gachaQuestTypeOptions": {
"main_story": "Main Story",
"world_quest": "World Quest",
"side_quest": "Side Quest",
"spinoff_quest": "Spinoff Quest",
"companion_quest": "Companion Quest",
"bond_quest": "Bond Quest",
"event": "Event",
"anniversary": "Anniversary",
"crossover": "Crossover",
"dating_event": "Dating Event",
"tutorial_quest": "Tutorial",
"guide_quest": "Guide Quest",
"trial_quest": "Trial Quest",
"endgame": "Endgame Mode",
"coop": "Co-op",
"daily_commission": "Daily Commissions",
"showcase": "Showcase"
},
"gachaQuestTypeGroups": {
"story": "Story",
"events": "Events",
"tutorial_trial": "Tutorial / Trial",
"endgame_multiplayer": "Endgame / Multiplayer",
"showcase": "Showcase"
},
"chapterName": "Chapter / Story Arc",
"chapterNamePlaceholder": "e.g. Chapter 5 Act 2: Where the Stars Fall",
"questName": "Quest Name",
"questNamePlaceholder": "e.g. A Solitary Constellation",
"vnDonate": "Donate (Vietnam)",
"vnDonateHelp": "Only rendered into the description when output language is Vietnamese.",
"vnBankName": "Bank name",
"vnBankNamePlaceholder": "e.g. Vietcombank, MB Bank, Techcombank",
"vnBankAccount": "Account number",
"vnBankAccountPlaceholder": "e.g. 0123456789",
"vnBankHolder": "Account holder",
"vnBankHolderPlaceholder": "e.g. NGUYEN VAN A",
"vnMomo": "MoMo",
"vnMomoPlaceholder": "MoMo phone number",
"vnZalopay": "ZaloPay",
"vnZalopayPlaceholder": "ZaloPay phone number",
"resolution": "分辨率",
"fps": "帧率",
"graphicsPreset": "画质预设",
"graphicsPresetOptions": {
"low": "Low",
"medium": "Medium",
"high": "High",
"very_high": "Very High",
"cinematic": "Cinematic",
"ultra": "Ultra",
"extreme": "Extreme",
"custom": "Custom…"
},
"graphicsPresetCustom": "Custom preset name",
"graphicsPresetCustomPlaceholder": "e.g. Epic, Maximum",
"skipGraphicsSettings": "This game has no in-game graphics settings",
"skipGraphicsSettingsHelp": "Hide the Video Settings section in the description for 2D / pixel-art / web games.",
"rayTracing": "Ray Tracing",
"rtOptions": {
"ray_tracing": "Ray Tracing",
"full_rt": "Full Ray Tracing",
"path_tracing": "Path Tracing",
"ray_reconstruction": "Ray Reconstruction"
},
"frameGenVendor": "Frame Gen Vendor",
"frameGenVendorOptions": {
"none": "None",
"nvidia": "NVIDIA",
"amd": "AMD",
"intel": "Intel"
},
"frameGenMultiplier": "Frame Gen Multiplier",
"frameGenMultiplierOptions": {
"none": "None",
"x2": "x2",
"x3": "x3",
"x4": "x4",
"x6": "x6"
},
"upscaleQuality": "Upscaling Quality",
"upscaleQualityOptions": {
"none": "None",
"native_aa": "Native AA",
"quality": "Quality",
"balanced": "Balanced",
"performance": "Performance",
"ultra_performance": "Ultra Performance"
},
"artStyle": "Art Style",
"artStyleOptions": {
"none": "— Not set —",
"realistic": "Realistic",
"stylized": "Stylized",
"anime": "Anime",
"cel_shaded": "Cel-shaded",
"low_poly": "Low-poly",
"voxel": "Voxel",
"pixel_art": "Pixel Art",
"hand_drawn": "Hand-drawn",
"comic": "Comic",
"photorealistic": "Photorealistic"
},
"versionInfo": "Driver / Game Version",
"versionInfoPlaceholder": "e.g. GeForce 565.90 | Game v1.4",
"liveUrl": "Live URL",
"liveUrlPlaceholder": "https://www.youtube.com/watch?v=...",
"scheduledTime": "Scheduled Time",
"skipGraphicsHintLabel": "This looks like a game without graphics settings — hide the section?",
"skipGraphicsHintHide": "Hide",
"skipGraphicsHintKeep": "Keep",
"timestamps": "时间戳",
"timestampsPlaceholder": "0:00 开场\n5:30 第一章\n15:00 Boss战",
"storeLinks": "商店链接",
"storeLinkType": "类型",
"rig": "我的配置",
"social": "社交与赞助链接",
"warnings": "警告",
@@ -45,12 +168,61 @@
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
"contactEmail": "联系邮箱",
"contactEmailPlaceholder": "business@example.com",
"musicAttribution": "音乐 / 音效署名",
"musicAttributionPlaceholder": "音乐:Karl Casey @ White Bat Audio\n音效:Freesound.org",
"sponsorName": "赞助商 (发行商 / 开发商)",
"sponsorNamePlaceholder": "例如:Ubisoft、卡普空、Devolver Digital",
"sponsorPlatform": "激活码平台",
"sponsorPlatformPlaceholder": "例如:Steam、Epic Games、GOG",
"thumbnailText": "缩略图文字",
"thumbnailTextPlaceholder": "如:隐藏Boss无伤",
"pinnedComment": "置顶评论模板",
"pinnedCommentPlaceholder": "置顶评论内容...",
"playthrough": "游玩方式",
"playthroughOptions": {
"none": "— 未选择 —",
"blind": "初见游玩",
"replay": "重玩",
"newgame_plus": "New Game+",
"postgame": "通关后 / 后期内容"
},
"difficulty": "难度",
"difficultyOptions": {
"none": "— 未选择 —",
"easy": "简单",
"normal": "普通",
"hard": "困难",
"nightmare": "噩梦 / 极难",
"custom": "自定义…"
},
"difficultyCustomLabel": "自定义难度标签",
"difficultyCustomPlaceholder": "如: Lethal, NG+7, Fromsoft default",
"contentWarnings": "内容警告",
"contentWarningOptions": {
"flashing_lights": "⚡ 闪光",
"loud_noises": "🔊 大音量",
"jump_scares": "😱 惊吓镜头"
},
"videoSettings": "视频设置",
"quickPreview": "快速预览",
"version": "版本",
"clearDraft": "清除草稿",
"draftSaved": "草稿已保存",
"clearDraftConfirm": "确定要清除所有表单数据吗?",
"contactEmailHelp": "最多3个邮箱,用逗号分隔"
"genreSearchPlaceholder": "搜索类型",
"genreSearchNoResults": "未找到类型",
"genreGroups": {
"rpg": "所有 RPG",
"shooter": "所有射击",
"horror": "所有恐怖"
},
"contactEmailHelp": "最多3个邮箱,用逗号分隔",
"toast": {
"urlAutoFilled": "已从URL自动填入「{{name}}」"
},
"warning": {
"linkNameMismatch": "请检查链接并重新添加 — 「{{host}}」 看起来是「{{suggestedName}}」,但游戏名称是「{{gameName}}」。"
}
},
"output": {
"title": "标题",
@@ -62,7 +234,20 @@
"copyAll": "复制全部",
"copied": "已复制!",
"charCount": "{{count}}/{{limit}}",
"selectLanguages": "选择语言"
"selectLanguages": "选择语言",
"thumbnailText": "缩略图文字",
"copyThumbnailText": "复制缩略图文字",
"pinnedComment": "置顶评论",
"copyPinnedComment": "复制置顶评论",
"pinnedCommentTemplate": "置顶评论 (模板)",
"copyPinnedCommentTemplate": "复制置顶评论模板",
"generateAlternatives": "生成标题备选",
"saveAsTemplate": "保存为模板",
"variants": {
"default": "默认",
"typeFirst": "类型优先",
"qualityFirst": "画质优先"
}
},
"common": {
"save": "保存",
@@ -73,11 +258,15 @@
"import": "导入",
"reset": "重置",
"search": "搜索",
"generate": "生成"
"generate": "生成",
"undo": "撤销",
"dismiss": "关闭"
},
"videoTypes": {
"full": "完整游戏实况",
"part": "游戏实况分集",
"full_demo": "完整试玩",
"demo_part": "试玩分集",
"boss": "Boss战",
"boss_nohit": "Boss无伤",
"ending": "结局 / 全结局",
@@ -89,19 +278,37 @@
"side_quest": "支线任务",
"secret": "秘密 / 隐藏内容",
"comparison": "画质对比",
"guide": "无声攻略"
"guide": "无声攻略",
"mods": "Mod 游玩",
"collectibles": "全收集要素",
"livestream": "直播",
"gacha_quest": "Gacha Quest"
},
"genres": {
"action": "动作 / 冒险",
"hack_slash": "砍杀 (Hack & Slash)",
"beatemup": "清版动作",
"platformer": "平台跳跃",
"horror": "恐怖 / 生存",
"rpg": "RPG / JRPG",
"survival_horror": "生存恐怖",
"psychological_horror": "心理恐怖",
"rpg": "RPG",
"jrpg": "JRPG",
"action_rpg": "动作RPG",
"crpg": "CRPG / 等距视角",
"fps": "FPS / 射击",
"arena_shooter": "竞技场射击",
"tactical_fps": "战术FPS",
"boomer_shooter": "怀旧射击",
"extraction_shooter": "撤离射击",
"shmup": "弹幕射击",
"openworld": "开放世界 / 沙盒",
"indie": "独立 / 平台跳跃",
"indie": "独立游戏",
"soulslike": "魂系",
"racing": "竞速 / 体育",
"story": "剧情 / 视觉小说",
"story": "剧情 / 叙事",
"simulation": "模拟 / 策略",
"city_builder": "城市建造",
"fighting": "格斗",
"stealth": "潜行 / 谍战",
"survival_craft": "生存 / 建造",
@@ -112,12 +319,14 @@
"puzzle": "解谜",
"tower_defense": "塔防",
"card_game": "卡牌游戏",
"deck_builder": "卡组构筑",
"auto_battler": "自走棋",
"battle_royale": "大逃杀",
"crpg": "CRPG / 等距视角",
"tactical": "战术 / 回合制",
"space": "太空 / 科幻",
"farming": "农场 / 生活模拟",
"fmv": "FMV / 互动电影"
"fmv": "FMV / 互动电影",
"visual_novel": "视觉小说"
},
"rig": {
"cpu": "CPU",
@@ -127,7 +336,8 @@
"monitor": "显示器",
"capture": "录制软件",
"motherboard": "主板",
"controller": "手柄"
"controller": "手柄",
"video_editor": "视频编辑软件"
},
"social": {
"kofi": "Ko-fi",
@@ -172,6 +382,21 @@
"exportProfiles": "导出配置",
"importProfiles": "导入配置"
},
"templates": {
"title": "模板",
"createNew": "创建模板",
"saveAsTemplate": "保存为模板",
"templateName": "模板名称",
"templateNamePlaceholder": "如:艾尔登法环 Boss 战",
"loadTemplate": "应用",
"deleteConfirm": "确定要删除此模板吗?",
"emptyState": "还没有模板。保存当前表单以便复用。",
"saveHint": "保存编辑器中的所有字段,以便之后恢复到完全相同的状态。",
"savedAs": "已保存为 '{{name}}'",
"appliedToast": "已应用 '{{name}}'",
"exportTemplates": "导出模板",
"importTemplates": "导入模板"
},
"presets": {
"title": "游戏预设",
"createNew": "创建预设",
@@ -202,13 +427,36 @@
"appLanguage": "应用语言",
"defaultOutputLanguage": "默认输出语言",
"defaultGenre": "默认类型",
"autoSaveDraft": "自动保存草稿",
"showCharCount": "显示字数统计",
"compactTagDisplay": "紧凑标签显示",
"historyLimit": "历史记录上限",
"multilingualTags": "多语言标签",
"trendingTags": "热门标签",
"hashtagCount": "话题标签数量"
"hashtagCount": "话题标签数量",
"showQualityBadge": "在标题中显示画质标签 (如:[2K 60FPS])",
"showCopyright": "在描述中添加 © 版权行",
"showUsagePolicy": "在描述中添加视频使用规则块",
"showSponsorCredit": "在描述中添加赞助商感谢行(提供激活码)",
"titleFormatTitle": "标题格式",
"descriptionSettingsTitle": "描述",
"badgePosition": "画质徽章位置",
"badgePositionPrefix": "前缀 (游戏名前)",
"badgePositionMiddle": "中间 (与视频类型相连)",
"badgePositionSuffix": "后缀 (尾部前)",
"titleSeparator": "分隔符",
"titleSeparatorEmDash": "长破折号 ( — )",
"titleSeparatorHyphen": "连字符 ( - )",
"titleSeparatorColon": "冒号 ( : )",
"titleSeparatorPipe": "竖线 ( | )",
"badgeCase": "徽章大小写",
"badgeCaseUpper": "大写 (2K)",
"badgeCaseLower": "小写 (2k)",
"showPinnedCommentTemplate": "生成置顶评论模板并与输出一起显示",
"pinnedCommentIncludeAskNextGame": "包含「下一期玩什么游戏?」提问",
"pinnedCommentIncludeGenrePlaylist": "Include genre-playlist suggestion in pinned comment",
"genrePlaylistsTitle": "Genre Playlists",
"genrePlaylistsHelp": "Configure a YouTube playlist URL per genre. The pinned-comment template will auto-suggest the matching playlist when the video's primary genre is selected.",
"genrePlaylistsEmptyHint": "Leave empty to skip a genre."
},
"batch": {
"title": "批量生成",
@@ -224,13 +472,21 @@
"copyAll": "复制全部",
"saveDraft": "保存草稿",
"help": "帮助",
"close": "关闭"
"close": "关闭",
"searchPlaceholder": "搜索快捷键",
"noResults": "未找到快捷键"
},
"validation": {
"emailInvalid": "无效邮箱: {{email}}",
"emailMaxExceeded": "最多允许{{max}}个邮箱 (当前{{count}}个)",
"urlInvalid": "无效URL。必须以https://开头",
"urlPrefixMismatch": "URL应以{{expected}}开头"
"urlPrefixMismatch": "URL应以{{expected}}开头",
"playlistUrlInvalid": "无效的YouTube播放列表URL。期望格式: {{expected}}"
},
"storeLinkTypes": {
"paid": "付费",
"free": "免费",
"demo": "免费试玩"
},
"playlist": {
"title": "播放列表生成器",
+61 -26
View File
@@ -9,19 +9,40 @@ import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import { renderAll } from "@engine/template-renderer";
import { buildPinnedComment } from "@engine/pinned-comment-builder";
import { YT_LIMITS } from "@engine/types";
import type { GeneratorInput, GeneratorOutput, SupportedLanguage } from "@engine/types";
import type { GeneratorOutput, SupportedLanguage } from "@engine/types";
import { useCurrentGeneratorInput } from "@hooks/use-current-generator-input";
import clsx from "clsx";
interface BatchLanguageRow {
language: SupportedLanguage;
output: GeneratorOutput;
/** Empty string when the pinned-comment template setting is off. */
pinnedComment: string;
}
interface BatchResult {
partNumber: string;
languages: { language: SupportedLanguage; output: GeneratorOutput }[];
languages: BatchLanguageRow[];
}
export function BatchPage() {
const { t } = useTranslation("ui");
const state = useEditorStore();
const { includeMultilingualTags, includeTrendingTags, hashtagCount } = useSettingsStore();
const baseInput = useCurrentGeneratorInput();
const {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
showPinnedCommentTemplate,
pinnedCommentIncludeAskNextGame,
titleFormat,
} = useSettingsStore();
const [startPart, setStartPart] = useState("1");
const [endPart, setEndPart] = useState("5");
const [selectedLangs, setSelectedLangs] = useState<SupportedLanguage[]>([state.language]);
@@ -42,33 +63,36 @@ export function BatchPage() {
const outputs: BatchResult[] = [];
for (let i = start; i <= Math.min(end, start + 99); i++) {
const languages = selectedLangs.map((lang) => {
const languages: BatchLanguageRow[] = selectedLangs.map((lang) => {
const tFn = i18n.getFixedT(lang, "templates");
const input: GeneratorInput = {
videoType: "part",
// Batch generates "part" entries regardless of the editor's
// currently-selected video type — the page exists to spin out a
// series, not to batch-duplicate whatever the user last picked.
const input = {
...baseInput,
videoType: "part" as const,
language: lang,
genre: state.genre,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
platform: state.platform,
partNumber: String(i),
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
// Batch intentionally leaves the per-part timeline empty; the
// editor's timestamps field is a single-video artifact.
timestamps: "",
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
storeLinks: state.storeLinks,
social: state.social,
rig: state.rig,
};
return { language: lang, output: renderAll(input, tFn, { includeMultilingualTags, includeTrendingTags, hashtagCount }) };
const output = renderAll(input, tFn, {
includeMultilingualTags,
includeTrendingTags,
hashtagCount,
showQualityBadge,
showCopyright,
showUsagePolicy,
showSponsorCredit,
titleFormat,
});
const pinnedComment = showPinnedCommentTemplate
? buildPinnedComment(input, tFn, {
includeAskNextGame: pinnedCommentIncludeAskNextGame,
})
: "";
return { language: lang, output, pinnedComment };
});
outputs.push({ partNumber: String(i), languages });
}
@@ -80,7 +104,12 @@ export function BatchPage() {
results
.map((r) =>
r.languages
.map((l) => `[${l.language.toUpperCase()}]\n${l.output.title}\n\n${l.output.description}`)
.map((l) => {
const pinnedBlock = l.pinnedComment
? `\n\n📌 PINNED COMMENT\n${l.pinnedComment}`
: "";
return `[${l.language.toUpperCase()}]\n${l.output.title}\n\n${l.output.description}${pinnedBlock}`;
})
.join("\n\n---\n\n"),
)
.join("\n\n===\n\n"),
@@ -171,6 +200,12 @@ export function BatchPage() {
<div className="flex gap-2">
<CopyButton text={lang.output.description} label={t("output.copyDescription")} />
<CopyButton text={lang.output.tagString} label={t("output.copyTags")} />
{lang.pinnedComment && (
<CopyButton
text={lang.pinnedComment}
label={t("output.copyPinnedCommentTemplate")}
/>
)}
</div>
</div>
))}
+99 -30
View File
@@ -2,33 +2,46 @@ import { VideoTypeSelector } from "@components/editor/VideoTypeSelector";
import { LanguageSelector } from "@components/editor/LanguageSelector";
import { GenreSelector } from "@components/editor/GenreSelector";
import { GameInfoForm } from "@components/editor/GameInfoForm";
import { ExtraFieldsInput } from "@components/editor/ExtraFieldsInput";
import { VideoSettingsForm } from "@components/editor/VideoSettingsForm";
import { TimestampEditor } from "@components/editor/TimestampEditor";
import { StoreLinkEditor } from "@components/editor/StoreLinkEditor";
import { RigEditor } from "@components/editor/RigEditor";
import { SocialEditor } from "@components/editor/SocialEditor";
import { VietnameseDonateEditor } from "@components/editor/VietnameseDonateEditor";
import { WarningToggles } from "@components/editor/WarningToggles";
import { ContentDetailsForm } from "@components/editor/ContentDetailsForm";
import { ThumbnailHelper } from "@components/editor/ThumbnailHelper";
import { PinnedCommentEditor } from "@components/editor/PinnedCommentEditor";
import { MusicAttributionEditor } from "@components/editor/MusicAttributionEditor";
import { SponsorCreditEditor } from "@components/editor/SponsorCreditEditor";
import { QuickPreview } from "@components/editor/QuickPreview";
import { DraftIndicator } from "@components/editor/DraftIndicator";
import { PresetSelector } from "@components/presets/PresetSelector";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { Button } from "@components/ui/Button";
import { ConfirmDialog } from "@components/ui/ConfirmDialog";
import { Accordion } from "@components/ui/Accordion";
import { useEditorStore } from "@store/editor-store";
import { useSettingsStore } from "@store/settings-store";
import { useTranslation } from "react-i18next";
import { validateEmails, validateUrl } from "@utils/validation";
import { validateEmails, validatePlaylistUrl } from "@utils/validation";
import { RotateCcw } from "lucide-react";
import { useState } from "react";
export function EditorPage() {
const { t } = useTranslation("ui");
const store = useEditorStore();
const accordion = useSettingsStore((s) => s.editorAccordionState);
const toggleAccordion = useSettingsStore((s) => s.toggleEditorAccordion);
const [showClearDraft, setShowClearDraft] = useState(false);
const isOpen = (id: string): boolean => accordion[id] ?? false;
return (
<div className="mx-auto flex max-w-6xl flex-col gap-6 p-6 lg:flex-row">
{/* Form */}
<div className="flex flex-1 flex-col gap-6">
<div className="flex flex-1 flex-col gap-4">
<div className="flex items-center justify-between">
<DraftIndicator />
<Button variant="ghost" size="sm" onClick={() => setShowClearDraft(true)}>
@@ -47,37 +60,93 @@ export function EditorPage() {
message={t("editor.clearDraftConfirm")}
variant="danger"
/>
<VideoTypeSelector />
<div className="grid grid-cols-2 gap-4">
<Accordion
id="gameInfo"
title={t("editor.sections.gameInfo")}
icon="🎮"
open={isOpen("gameInfo")}
onToggle={() => toggleAccordion("gameInfo")}
>
<LanguageSelector />
<div />
</div>
<GenreSelector />
<PresetSelector />
<GameInfoForm />
<VideoSettingsForm />
<TimestampEditor />
<GenreSelector />
<PresetSelector />
<GameInfoForm />
</Accordion>
<ValidatedInput
label={t("editor.playlistLink")}
placeholder={t("editor.playlistLinkPlaceholder")}
value={store.playlistLink ?? ""}
onChange={(v) => store.set("playlistLink", v)}
validate={validateUrl}
/>
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={store.contactEmail ?? ""}
onChange={(v) => store.set("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
/>
<Accordion
id="videoSettings"
title={t("editor.sections.videoSettings")}
icon="🎬"
open={isOpen("videoSettings")}
onToggle={() => toggleAccordion("videoSettings")}
>
<VideoTypeSelector />
<ExtraFieldsInput />
<VideoSettingsForm />
</Accordion>
<WarningToggles />
<StoreLinkEditor />
<RigEditor />
<SocialEditor />
<Accordion
id="contentDetails"
title={t("editor.sections.contentDetails")}
icon="⏱"
open={isOpen("contentDetails")}
onToggle={() => toggleAccordion("contentDetails")}
>
<TimestampEditor />
<ContentDetailsForm />
<WarningToggles />
<ValidatedInput
label={t("editor.playlistLink")}
placeholder={t("editor.playlistLinkPlaceholder")}
value={store.playlistLink ?? ""}
onChange={(v) => store.set("playlistLink", v)}
validate={validatePlaylistUrl}
/>
<ValidatedInput
label={t("editor.contactEmail")}
placeholder={t("editor.contactEmailPlaceholder")}
value={store.contactEmail ?? ""}
onChange={(v) => store.set("contactEmail", v)}
validate={validateEmails}
helpText={t("editor.contactEmailHelp")}
/>
</Accordion>
<Accordion
id="attribution"
title={t("editor.sections.attribution")}
icon="🎵"
open={isOpen("attribution")}
onToggle={() => toggleAccordion("attribution")}
>
<MusicAttributionEditor />
<SponsorCreditEditor />
<ThumbnailHelper />
<PinnedCommentEditor />
</Accordion>
<Accordion
id="rig"
title={t("editor.sections.rig")}
icon="💻"
open={isOpen("rig")}
onToggle={() => toggleAccordion("rig")}
>
<RigEditor />
</Accordion>
<Accordion
id="storeAndSocial"
title={t("editor.sections.storeAndSocial")}
icon="🔗"
open={isOpen("storeAndSocial")}
onToggle={() => toggleAccordion("storeAndSocial")}
>
<StoreLinkEditor />
<SocialEditor />
<VietnameseDonateEditor />
</Accordion>
</div>
{/* Sidebar: Quick Preview */}
+46 -21
View File
@@ -1,7 +1,12 @@
import { useEffect, useRef, useState, useMemo } from "react";
import { useTranslation } from "react-i18next";
import { Shuffle, Bookmark } from "lucide-react";
import { Button } from "@components/ui/Button";
import { OutputPreview } from "@components/output/OutputPreview";
import { OutputExtras } from "@components/output/OutputExtras";
import { CopyAllBar } from "@components/output/CopyAllBar";
import { VariantPicker } from "@components/output/VariantPicker";
import { TemplateSaveForm } from "@components/templates/TemplateSaveForm";
import { useGeneratedOutput } from "@hooks/use-generated-output";
import { useMultilangOutput } from "@hooks/use-multilang-output";
import { useEditorStore } from "@store/editor-store";
@@ -14,13 +19,15 @@ import clsx from "clsx";
export function OutputPage() {
const { t } = useTranslation("ui");
const defaultOutput = useGeneratedOutput();
const { gameName, videoType, language, genre } = useEditorStore();
const { gameName, videoType, language, genres } = useEditorStore();
const addEntry = useHistoryStore((s) => s.addEntry);
const historyLimit = useSettingsStore((s) => s.historyLimit);
const savedRef = useRef<string>("");
const [selectedLangs, setSelectedLangs] = useState<SupportedLanguage[]>([language]);
const [activeTab, setActiveTab] = useState<SupportedLanguage>(language);
const [showVariants, setShowVariants] = useState(false);
const [showSaveTemplate, setShowSaveTemplate] = useState(false);
const isMultiLang = selectedLangs.length > 1;
const multilangOutputs = useMultilangOutput(isMultiLang ? selectedLangs : []);
@@ -49,14 +56,14 @@ export function OutputPage() {
gameName,
videoType,
language,
genre,
genres,
title: defaultOutput.title,
description: defaultOutput.description,
tags: defaultOutput.tagString,
},
historyLimit,
);
}, [gameName, videoType, language, genre, defaultOutput.title, defaultOutput.description, defaultOutput.tagString, addEntry, historyLimit]);
}, [gameName, videoType, language, genres, defaultOutput.title, defaultOutput.description, defaultOutput.tagString, addEntry, historyLimit]);
const allLangsCombined = useMemo(() => {
if (!isMultiLang) return "";
@@ -72,25 +79,37 @@ export function OutputPage() {
return (
<div className="flex flex-1 flex-col">
<div className="mx-auto w-full max-w-4xl flex-1 p-6">
<div className="mb-4">
<span className="mb-2 block text-sm font-medium text-text-secondary">
{t("output.selectLanguages")}
</span>
<div className="mb-4 flex flex-wrap items-start justify-between gap-3">
<div className="flex-1">
<span className="mb-2 block text-sm font-medium text-text-secondary">
{t("output.selectLanguages")}
</span>
<div className="flex flex-wrap gap-2">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => toggleLang(lang.id as SupportedLanguage)}
className={clsx(
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selectedLangs.includes(lang.id as SupportedLanguage)
? "bg-accent text-white"
: "bg-surface-2 text-text-muted hover:text-text-primary",
)}
>
{lang.flag} {lang.nativeName}
</button>
))}
</div>
</div>
<div className="flex flex-wrap gap-2">
{SUPPORTED_LANGUAGES.map((lang) => (
<button
key={lang.id}
onClick={() => toggleLang(lang.id as SupportedLanguage)}
className={clsx(
"rounded-lg px-3 py-1.5 text-sm font-medium transition-colors",
selectedLangs.includes(lang.id as SupportedLanguage)
? "bg-accent text-white"
: "bg-surface-2 text-text-muted hover:text-text-primary",
)}
>
{lang.flag} {lang.nativeName}
</button>
))}
<Button variant="ghost" size="sm" onClick={() => setShowVariants(true)} disabled={!gameName}>
<Shuffle className="h-3.5 w-3.5" />
{t("output.generateAlternatives")}
</Button>
<Button variant="ghost" size="sm" onClick={() => setShowSaveTemplate(true)} disabled={!gameName}>
<Bookmark className="h-3.5 w-3.5" />
{t("output.saveAsTemplate")}
</Button>
</div>
</div>
@@ -114,8 +133,14 @@ export function OutputPage() {
)}
{currentOutput && <OutputPreview output={isMultiLang ? currentOutput : undefined} />}
<div className="mt-6">
<OutputExtras />
</div>
</div>
<CopyAllBar extraText={isMultiLang ? allLangsCombined : undefined} />
<VariantPicker open={showVariants} onClose={() => setShowVariants(false)} />
<TemplateSaveForm open={showSaveTemplate} onClose={() => setShowSaveTemplate(false)} />
</div>
);
}
+39 -5
View File
@@ -4,19 +4,22 @@ import { Download, Upload } from "lucide-react";
import { Button } from "@components/ui/Button";
import { ProfileList } from "@components/profiles/ProfileList";
import { PresetList } from "@components/presets/PresetList";
import { TemplateList } from "@components/templates/TemplateList";
import { useProfileStore, type Profile } from "@store/profile-store";
import { usePresetStore, type GamePreset } from "@store/preset-store";
import { useTemplateStore, type EditorTemplate } from "@store/template-store";
import { exportToJsonFile, importFromJsonFile } from "@utils/import-export";
import toast from "react-hot-toast";
import clsx from "clsx";
type Tab = "profiles" | "presets";
type Tab = "profiles" | "presets" | "templates";
export function ProfilesPage() {
const { t } = useTranslation("ui");
const [tab, setTab] = useState<Tab>("profiles");
const { profiles, importProfiles } = useProfileStore();
const { presets, importPresets } = usePresetStore();
const { templates, importTemplates } = useTemplateStore();
const handleExportProfiles = () => {
exportToJsonFile(profiles, "ytdescgen-profiles.json");
@@ -50,11 +53,27 @@ export function ProfilesPage() {
}
};
const handleExportTemplates = () => {
exportToJsonFile(templates, "ytdescgen-templates.json");
toast.success("Exported!");
};
const handleImportTemplates = async () => {
try {
const data = await importFromJsonFile<EditorTemplate[]>();
if (!Array.isArray(data)) throw new Error("Invalid format");
importTemplates(data);
toast.success("Imported!");
} catch {
toast.error("Import failed");
}
};
return (
<div className="mx-auto max-w-3xl p-6">
<div className="mb-6 flex items-center justify-between">
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
{(["profiles", "presets"] as const).map((t2) => (
{(["profiles", "presets", "templates"] as const).map((t2) => (
<button
key={t2}
onClick={() => setTab(t2)}
@@ -70,7 +89,7 @@ export function ProfilesPage() {
))}
</div>
<div className="flex gap-2">
{tab === "profiles" ? (
{tab === "profiles" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportProfiles}>
<Download className="h-3.5 w-3.5" />
@@ -81,7 +100,8 @@ export function ProfilesPage() {
{t("profiles.importProfiles")}
</Button>
</>
) : (
)}
{tab === "presets" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportPresets}>
<Download className="h-3.5 w-3.5" />
@@ -93,10 +113,24 @@ export function ProfilesPage() {
</Button>
</>
)}
{tab === "templates" && (
<>
<Button variant="ghost" size="sm" onClick={handleExportTemplates}>
<Download className="h-3.5 w-3.5" />
{t("templates.exportTemplates")}
</Button>
<Button variant="ghost" size="sm" onClick={handleImportTemplates}>
<Upload className="h-3.5 w-3.5" />
{t("templates.importTemplates")}
</Button>
</>
)}
</div>
</div>
{tab === "profiles" ? <ProfileList /> : <PresetList />}
{tab === "profiles" && <ProfileList />}
{tab === "presets" && <PresetList />}
{tab === "templates" && <TemplateList />}
</div>
);
}
+172 -20
View File
@@ -4,20 +4,29 @@ import { Toggle } from "@components/ui/Toggle";
import { Select } from "@components/ui/Select";
import { Input } from "@components/ui/Input";
import { Button } from "@components/ui/Button";
import { ChipGroup } from "@components/ui/ChipGroup";
import { ValidatedInput } from "@components/ui/ValidatedInput";
import { SUPPORTED_LANGUAGES } from "@i18n/index";
import { GENRES } from "@config/genres";
import { GENRES, type GenreId } from "@config/genres";
import { useSettingsStore } from "@store/settings-store";
import { validatePlaylistUrl } from "@utils/validation";
import { IS_TAURI } from "@utils/platform";
import type { SupportedLanguage } from "@engine/types";
import {
MAX_GENRES,
type SupportedLanguage,
type TitleBadgePosition,
type TitleSeparatorId,
type TitleBadgeCase,
} from "@engine/types";
import toast from "react-hot-toast";
import { logger } from "@utils/logger";
async function openSettingsFolder() {
try {
const { appDataDir } = await import("@tauri-apps/api/path");
const { open } = await import("@tauri-apps/plugin-shell");
const { openPath } = await import("@tauri-apps/plugin-opener");
const dir = await appDataDir();
await open(dir);
await openPath(dir);
} catch (e) {
toast.error("Could not open settings folder");
logger.error("settings", "Failed to open settings folder", String(e));
@@ -53,8 +62,9 @@ export function SettingsPage() {
}));
const genreOptions = GENRES.map((g) => ({
value: g.id,
label: `${g.icon} ${t(g.labelKey)}`,
id: g.id,
label: t(g.labelKey),
icon: g.icon,
}));
const hashtagOptions = [
@@ -63,6 +73,24 @@ export function SettingsPage() {
{ value: "3", label: "3" },
];
const badgePositionOptions = [
{ value: "prefix", label: t("settings.badgePositionPrefix") },
{ value: "middle", label: t("settings.badgePositionMiddle") },
{ value: "suffix", label: t("settings.badgePositionSuffix") },
];
const titleSeparatorOptions = [
{ value: "emDash", label: t("settings.titleSeparatorEmDash") },
{ value: "hyphen", label: t("settings.titleSeparatorHyphen") },
{ value: "colon", label: t("settings.titleSeparatorColon") },
{ value: "pipe", label: t("settings.titleSeparatorPipe") },
];
const badgeCaseOptions = [
{ value: "upper", label: t("settings.badgeCaseUpper") },
{ value: "lower", label: t("settings.badgeCaseLower") },
];
return (
<div className="mx-auto max-w-2xl p-6">
<div className="mb-6 flex items-center justify-between">
@@ -82,6 +110,7 @@ export function SettingsPage() {
</div>
<div className="flex flex-col gap-8">
{/* 1. Appearance — theme toggle only. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.appearance")}</h2>
<Toggle
@@ -91,6 +120,7 @@ export function SettingsPage() {
/>
</section>
{/* 2. Language & Defaults — app + output language, default genres. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.defaults")}</h2>
<Select
@@ -108,21 +138,19 @@ export function SettingsPage() {
value={settings.defaultOutputLanguage}
onChange={(v) => settings.setDefaultOutputLanguage(v as SupportedLanguage)}
/>
<Select
<ChipGroup
label={t("settings.defaultGenre")}
multiple
max={MAX_GENRES}
options={genreOptions}
value={settings.defaultGenre}
onChange={(v) => settings.setDefaultGenre(v as typeof settings.defaultGenre)}
value={settings.defaultGenres}
onChange={(next) => settings.setDefaultGenres(next as GenreId[])}
/>
</section>
{/* 3. Editor — UI knobs that affect the editor page itself. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.editorSettings")}</h2>
<Toggle
label={t("settings.autoSaveDraft")}
checked={settings.autoSaveDraft}
onChange={(v) => settings.setSetting("autoSaveDraft", v)}
/>
<Toggle
label={t("settings.showCharCount")}
checked={settings.showCharCount}
@@ -135,6 +163,94 @@ export function SettingsPage() {
/>
</section>
{/* 4. Title format — NEW in v0.7. Quality badge + format knobs. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">
{t("settings.titleFormatTitle")}
</h2>
<Toggle
label={t("settings.showQualityBadge")}
checked={settings.showQualityBadge}
onChange={(v) => settings.setSetting("showQualityBadge", v)}
/>
<Select
label={t("settings.badgePosition")}
options={badgePositionOptions}
value={settings.titleFormat.badgePosition}
onChange={(v) =>
settings.setTitleFormat({ badgePosition: v as TitleBadgePosition })
}
/>
<Select
label={t("settings.titleSeparator")}
options={titleSeparatorOptions}
value={settings.titleFormat.separator}
onChange={(v) =>
settings.setTitleFormat({ separator: v as TitleSeparatorId })
}
/>
<Select
label={t("settings.badgeCase")}
options={badgeCaseOptions}
value={settings.titleFormat.badgeCase}
onChange={(v) =>
settings.setTitleFormat({ badgeCase: v as TitleBadgeCase })
}
/>
</section>
{/* 5. Description — controls for auto-generated description blocks. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">
{t("settings.descriptionSettingsTitle")}
</h2>
<Toggle
label={t("settings.showCopyright")}
checked={settings.showCopyright}
onChange={(v) => settings.setSetting("showCopyright", v)}
/>
<Toggle
label={t("settings.showUsagePolicy")}
checked={settings.showUsagePolicy}
onChange={(v) => settings.setSetting("showUsagePolicy", v)}
/>
<Toggle
label={t("settings.showSponsorCredit")}
checked={settings.showSponsorCredit}
onChange={(v) => settings.setSetting("showSponsorCredit", v)}
/>
<Toggle
label={t("settings.showPinnedCommentTemplate")}
checked={settings.showPinnedCommentTemplate}
onChange={(v) => settings.setSetting("showPinnedCommentTemplate", v)}
/>
{settings.showPinnedCommentTemplate && (
<div className="ml-4 flex flex-col gap-2 border-l-2 border-border pl-4">
<Toggle
label={t("settings.pinnedCommentIncludeAskNextGame")}
checked={settings.pinnedCommentIncludeAskNextGame}
onChange={(v) =>
settings.setSetting("pinnedCommentIncludeAskNextGame", v)
}
/>
<Toggle
label={t("settings.pinnedCommentIncludeGenrePlaylist")}
checked={settings.pinnedCommentIncludeGenrePlaylist}
onChange={(v) =>
settings.setSetting("pinnedCommentIncludeGenrePlaylist", v)
}
/>
</div>
)}
<Select
label={t("settings.hashtagCount")}
options={hashtagOptions}
value={String(settings.hashtagCount)}
onChange={(v) => settings.setSetting("hashtagCount", Number(v))}
/>
</section>
{/* 6. Tags — tag-pool controls (narrowed from the old mixed section). */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.tagSettings")}</h2>
<Toggle
@@ -147,14 +263,50 @@ export function SettingsPage() {
checked={settings.includeTrendingTags}
onChange={(v) => settings.setSetting("includeTrendingTags", v)}
/>
<Select
label={t("settings.hashtagCount")}
options={hashtagOptions}
value={String(settings.hashtagCount)}
onChange={(v) => settings.setSetting("hashtagCount", Number(v))}
/>
</section>
{/* 6.5 Genre Playlists — per-genre YouTube playlist URLs that the
pinned-comment template can auto-suggest based on the video's
primary genre. v0.8 phase 2. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">
{t("settings.genrePlaylistsTitle")}
</h2>
<p className="text-xs text-text-muted">{t("settings.genrePlaylistsHelp")}</p>
<p className="text-xs text-text-muted">{t("settings.genrePlaylistsEmptyHint")}</p>
<div className="flex flex-col gap-2">
{GENRES.map((g) => (
<ValidatedInput
key={g.id}
label={`${g.icon} ${t(g.labelKey)}`}
placeholder="https://www.youtube.com/playlist?list=..."
value={settings.genrePlaylists[g.id] ?? ""}
onChange={(v) => {
const trimmed = v.trim();
if (trimmed) {
settings.setSetting("genrePlaylists", {
...settings.genrePlaylists,
[g.id]: trimmed,
});
} else {
// Empty input → drop this genre's entry entirely so the
// map stays sparse. Filter pattern instead of `delete`
// satisfies @typescript-eslint/no-dynamic-delete.
const next = Object.fromEntries(
Object.entries(settings.genrePlaylists).filter(
([k]) => k !== g.id,
),
);
settings.setSetting("genrePlaylists", next);
}
}}
validate={validatePlaylistUrl}
/>
))}
</div>
</section>
{/* 7. History. */}
<section className="flex flex-col gap-3">
<h2 className="text-sm font-semibold text-text-secondary">{t("settings.historySettings")}</h2>
<Input
+267 -7
View File
@@ -1,12 +1,34 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import type { VideoType, Genre, SupportedLanguage } from "@engine/types";
import type {
VideoType,
Genre,
SupportedLanguage,
StoreLinkType,
PlaythroughStatus,
DifficultyLevel,
ContentWarning,
} from "@engine/types";
import {
GRAPHICS_PRESETS,
type GraphicsPreset,
type RTMode,
type FrameGenVendor,
type FrameGenMultiplier,
type UpscaleQuality,
type ArtStyle,
} from "@config/graphics-settings";
import {
GACHA_QUEST_TYPES,
DEFAULT_GACHA_QUEST_TYPE,
type GachaQuestType,
} from "@config/gacha-quest-types";
import { DEFAULTS } from "@config/defaults";
interface EditorData {
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
genres: Genre[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
@@ -15,17 +37,89 @@ interface EditorData {
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
modList: string;
liveUrl: string;
scheduledTime: string;
gachaQuestType: GachaQuestType;
chapterName: string;
questName: string;
resolution: string;
fps: string;
graphicsPreset: string;
graphicsPreset: GraphicsPreset;
graphicsPresetCustom: string;
skipGraphicsSettings: boolean;
rayTracingModes: RTMode[];
frameGenVendor: FrameGenVendor;
frameGenMultiplier: FrameGenMultiplier;
upscaleQuality: UpscaleQuality;
artStyle: ArtStyle;
versionInfo: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
sponsorName: string;
sponsorPlatform: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
playthroughStatus: PlaythroughStatus;
difficulty: DifficultyLevel;
difficultyCustomLabel: string;
contentWarnings: ContentWarning[];
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
vnBankName: string;
vnBankAccount: string;
vnBankHolder: string;
vnMomo: string;
vnZalopay: string;
}
/**
* Map a free-form pre-v0.8 `graphicsPreset` string ("Ultra", "Very High",
* "Epic"…) to the v0.8 enum. Anything unrecognised is captured into the
* Custom slot rather than dropped, so an existing draft round-trips
* lossless through the migration. Exported for unit tests.
*/
export function legacyGraphicsPresetToEnum(legacy: string): {
preset: GraphicsPreset;
custom: string;
} {
const trimmed = legacy.trim();
if (!trimmed) return { preset: "medium", custom: "" };
const normalised = trimmed.toLowerCase();
const known = GRAPHICS_PRESETS.find(
(p) => p !== "custom" && p.replace(/_/g, " ") === normalised,
);
if (known) return { preset: known, custom: "" };
return { preset: "custom", custom: trimmed };
}
/**
* Normalise a partial editor patch coming from a profile / preset /
* template snapshot. Reused by `loadProfile` and `loadPreset` so legacy
* string `graphicsPreset` values from before v0.8 are mapped through the
* same logic as the persist-store v4→v5 migration. Pre-v0.8 snapshots
* declare `graphicsPreset: string` rather than the v0.8 enum, which TS
* accepts via structural compatibility — we sniff the runtime value here
* via an `unknown` cast.
*/
function normalizeEditorPatch(patch: Partial<EditorData>): Partial<EditorData> {
const out: Partial<EditorData> = { ...patch };
const raw: unknown = (patch as { graphicsPreset?: unknown }).graphicsPreset;
if (typeof raw === "string" && !(GRAPHICS_PRESETS as readonly string[]).includes(raw)) {
const { preset, custom } = legacyGraphicsPresetToEnum(raw);
out.graphicsPreset = preset;
if (typeof patch.graphicsPresetCustom !== "string") {
out.graphicsPresetCustom = custom;
}
}
return out;
}
interface EditorActions {
@@ -35,6 +129,7 @@ interface EditorActions {
key: string,
value: string,
) => void;
setStoreLinkType: (platformId: string, type: StoreLinkType) => void;
loadProfile: (profile: Partial<EditorData>) => void;
loadPreset: (preset: Partial<EditorData>) => void;
reset: () => void;
@@ -45,7 +140,7 @@ type EditorState = EditorData & EditorActions;
const initialState: EditorData = {
videoType: DEFAULTS.editor.videoType as VideoType,
language: DEFAULTS.editor.language as SupportedLanguage,
genre: DEFAULTS.editor.genre as Genre,
genres: [...DEFAULTS.editor.genres] as Genre[],
gameName: DEFAULTS.editor.gameName,
gameNameLocalized: { ...DEFAULTS.editor.gameNameLocalized },
channelName: DEFAULTS.editor.channelName,
@@ -54,17 +149,47 @@ const initialState: EditorData = {
bossName: DEFAULTS.editor.bossName,
dlcName: DEFAULTS.editor.dlcName,
challengeName: DEFAULTS.editor.challengeName,
modName: DEFAULTS.editor.modName,
modList: DEFAULTS.editor.modList,
liveUrl: DEFAULTS.editor.liveUrl,
scheduledTime: DEFAULTS.editor.scheduledTime,
gachaQuestType: DEFAULTS.editor.gachaQuestType,
chapterName: DEFAULTS.editor.chapterName,
questName: DEFAULTS.editor.questName,
resolution: DEFAULTS.editor.resolution,
fps: DEFAULTS.editor.fps,
graphicsPreset: DEFAULTS.editor.graphicsPreset,
graphicsPresetCustom: DEFAULTS.editor.graphicsPresetCustom,
skipGraphicsSettings: DEFAULTS.editor.skipGraphicsSettings,
rayTracingModes: [...DEFAULTS.editor.rayTracingModes],
frameGenVendor: DEFAULTS.editor.frameGenVendor,
frameGenMultiplier: DEFAULTS.editor.frameGenMultiplier,
upscaleQuality: DEFAULTS.editor.upscaleQuality,
artStyle: DEFAULTS.editor.artStyle,
versionInfo: DEFAULTS.editor.versionInfo,
timestamps: DEFAULTS.editor.timestamps,
playlistLink: DEFAULTS.editor.playlistLink,
contactEmail: DEFAULTS.editor.contactEmail,
musicAttribution: DEFAULTS.editor.musicAttribution,
sponsorName: DEFAULTS.editor.sponsorName,
sponsorPlatform: DEFAULTS.editor.sponsorPlatform,
thumbnailText: DEFAULTS.editor.thumbnailText,
pinnedComment: DEFAULTS.editor.pinnedComment,
spoilerWarning: DEFAULTS.editor.spoilerWarning,
matureWarning: DEFAULTS.editor.matureWarning,
playthroughStatus: DEFAULTS.editor.playthroughStatus as PlaythroughStatus,
difficulty: DEFAULTS.editor.difficulty as DifficultyLevel,
difficultyCustomLabel: DEFAULTS.editor.difficultyCustomLabel,
contentWarnings: [...DEFAULTS.editor.contentWarnings] as ContentWarning[],
storeLinks: { ...DEFAULTS.editor.storeLinks },
storeLinkTypes: { ...DEFAULTS.editor.storeLinkTypes },
social: { ...DEFAULTS.editor.social },
rig: { ...DEFAULTS.editor.rig },
vnBankName: DEFAULTS.editor.vnBankName,
vnBankAccount: DEFAULTS.editor.vnBankAccount,
vnBankHolder: DEFAULTS.editor.vnBankHolder,
vnMomo: DEFAULTS.editor.vnMomo,
vnZalopay: DEFAULTS.editor.vnZalopay,
};
export const useEditorStore = create<EditorState>()(
@@ -79,19 +204,124 @@ export const useEditorStore = create<EditorState>()(
[group]: { ...state[group], [key]: value },
})),
loadProfile: (profile) => set((state) => ({ ...state, ...profile })),
setStoreLinkType: (platformId, type) =>
set((state) => ({
storeLinkTypes: { ...state.storeLinkTypes, [platformId]: type },
})),
loadPreset: (preset) => set((state) => ({ ...state, ...preset })),
loadProfile: (profile) =>
set((state) => ({ ...state, ...normalizeEditorPatch(profile) })),
loadPreset: (preset) =>
set((state) => ({ ...state, ...normalizeEditorPatch(preset) })),
reset: () => set(initialState),
}),
{
name: "ytdescgen-editor-draft",
storage: createJSONStorage(() => localStorage),
// v1 → v2: `genre: Genre` became `genres: Genre[]` in v0.5.
// v2 → v3: sponsor credit fields added in v0.6.
// v3 → v4: playthroughStatus / difficulty / difficultyCustomLabel /
// contentWarnings added in v0.7 phase 2. Missing entries
// fall back to the spread of `initialState`, but we still
// normalise the blob here so legacy drafts round-trip
// cleanly through the engine.
// v4 → v5: graphics-settings v2 (v0.8 phase 2). Free-form
// `graphicsPreset` text became an enum + `Custom` field;
// RT modes, frame-gen vendor + multiplier, upscaling
// quality, art style, version info, and the livestream
// extras (liveUrl, scheduledTime) joined the schema.
// Missing fields fall through to `initialState`, but
// legacy `graphicsPreset` text needs explicit mapping so
// "Ultra"-era drafts don't end up with an enum value
// outside the GraphicsPreset literal union.
// v5 → v6: v0.8 polish. Vietnam-specific donate fields
// (vnBankName / vnBankAccount / vnBankHolder / vnMomo /
// vnZalopay) and a long-form modList textarea joined the
// schema. All additive — empty-string defaults round-trip
// cleanly without any value mapping.
// v6 → v7: v0.9 phase 1. Gacha-quest extras
// (gachaQuestType / chapterName / questName) joined the
// schema. Additive — pre-v0.9 drafts get the
// `"main_story"` default for the enum + empty strings for
// the free-form labels.
version: 7,
migrate: (persistedState: unknown, version: number): EditorData => {
if (!persistedState || typeof persistedState !== "object") {
return { ...initialState };
}
const state = persistedState as Record<string, unknown> & {
genre?: unknown;
sponsorName?: unknown;
sponsorPlatform?: unknown;
};
if (version < 2 && typeof state.genre === "string" && !Array.isArray(state.genres)) {
state.genres = [state.genre];
delete state.genre;
}
if (version < 3) {
if (typeof state.sponsorName !== "string") state.sponsorName = "";
if (typeof state.sponsorPlatform !== "string") state.sponsorPlatform = "";
}
if (version < 4) {
if (typeof state.playthroughStatus !== "string") state.playthroughStatus = "none";
if (typeof state.difficulty !== "string") state.difficulty = "none";
if (typeof state.difficultyCustomLabel !== "string") {
state.difficultyCustomLabel = "";
}
if (!Array.isArray(state.contentWarnings)) state.contentWarnings = [];
}
if (version < 5) {
// Map legacy free-form preset text to the new enum + Custom slot.
const legacy = typeof state.graphicsPreset === "string" ? state.graphicsPreset : "";
const isAlreadyEnum = (GRAPHICS_PRESETS as readonly string[]).includes(legacy);
if (!isAlreadyEnum) {
const { preset, custom } = legacyGraphicsPresetToEnum(legacy);
state.graphicsPreset = preset;
if (typeof state.graphicsPresetCustom !== "string") {
state.graphicsPresetCustom = custom;
}
} else if (typeof state.graphicsPresetCustom !== "string") {
state.graphicsPresetCustom = "";
}
if (typeof state.skipGraphicsSettings !== "boolean") {
state.skipGraphicsSettings = false;
}
if (!Array.isArray(state.rayTracingModes)) state.rayTracingModes = [];
if (typeof state.frameGenVendor !== "string") state.frameGenVendor = "none";
if (typeof state.frameGenMultiplier !== "string") state.frameGenMultiplier = "none";
if (typeof state.upscaleQuality !== "string") state.upscaleQuality = "none";
if (typeof state.artStyle !== "string") state.artStyle = "none";
if (typeof state.versionInfo !== "string") state.versionInfo = "";
if (typeof state.liveUrl !== "string") state.liveUrl = "";
if (typeof state.scheduledTime !== "string") state.scheduledTime = "";
}
if (version < 6) {
if (typeof state.modList !== "string") state.modList = "";
if (typeof state.vnBankName !== "string") state.vnBankName = "";
if (typeof state.vnBankAccount !== "string") state.vnBankAccount = "";
if (typeof state.vnBankHolder !== "string") state.vnBankHolder = "";
if (typeof state.vnMomo !== "string") state.vnMomo = "";
if (typeof state.vnZalopay !== "string") state.vnZalopay = "";
}
if (version < 7) {
const gqt = state.gachaQuestType;
if (
typeof gqt !== "string" ||
!(GACHA_QUEST_TYPES as readonly string[]).includes(gqt)
) {
state.gachaQuestType = DEFAULT_GACHA_QUEST_TYPE;
}
if (typeof state.chapterName !== "string") state.chapterName = "";
if (typeof state.questName !== "string") state.questName = "";
}
return { ...initialState, ...state } as EditorData;
},
partialize: (state) => ({
videoType: state.videoType,
language: state.language,
genre: state.genre,
genres: state.genres,
gameName: state.gameName,
gameNameLocalized: state.gameNameLocalized,
channelName: state.channelName,
@@ -100,17 +330,47 @@ export const useEditorStore = create<EditorState>()(
bossName: state.bossName,
dlcName: state.dlcName,
challengeName: state.challengeName,
modName: state.modName,
modList: state.modList,
liveUrl: state.liveUrl,
scheduledTime: state.scheduledTime,
gachaQuestType: state.gachaQuestType,
chapterName: state.chapterName,
questName: state.questName,
resolution: state.resolution,
fps: state.fps,
graphicsPreset: state.graphicsPreset,
graphicsPresetCustom: state.graphicsPresetCustom,
skipGraphicsSettings: state.skipGraphicsSettings,
rayTracingModes: state.rayTracingModes,
frameGenVendor: state.frameGenVendor,
frameGenMultiplier: state.frameGenMultiplier,
upscaleQuality: state.upscaleQuality,
artStyle: state.artStyle,
versionInfo: state.versionInfo,
timestamps: state.timestamps,
playlistLink: state.playlistLink,
contactEmail: state.contactEmail,
musicAttribution: state.musicAttribution,
sponsorName: state.sponsorName,
sponsorPlatform: state.sponsorPlatform,
thumbnailText: state.thumbnailText,
pinnedComment: state.pinnedComment,
spoilerWarning: state.spoilerWarning,
matureWarning: state.matureWarning,
playthroughStatus: state.playthroughStatus,
difficulty: state.difficulty,
difficultyCustomLabel: state.difficultyCustomLabel,
contentWarnings: state.contentWarnings,
storeLinks: state.storeLinks,
storeLinkTypes: state.storeLinkTypes,
social: state.social,
rig: state.rig,
vnBankName: state.vnBankName,
vnBankAccount: state.vnBankAccount,
vnBankHolder: state.vnBankHolder,
vnMomo: state.vnMomo,
vnZalopay: state.vnZalopay,
}),
},
),
+23 -1
View File
@@ -9,7 +9,7 @@ export interface HistoryEntry {
gameName: string;
videoType: VideoType;
language: SupportedLanguage;
genre: Genre;
genres: Genre[];
title: string;
description: string;
tags: string;
@@ -23,6 +23,17 @@ interface HistoryState {
clearAll: () => void;
}
type LegacyEntry = Omit<HistoryEntry, "genres"> & { genre?: Genre; genres?: Genre[] };
function normaliseEntry(e: LegacyEntry): HistoryEntry {
const { genre, ...rest } = e;
if (Array.isArray(rest.genres) && rest.genres.length > 0) {
return rest as HistoryEntry;
}
const fallback = genre ?? "action";
return { ...rest, genres: [fallback] } as HistoryEntry;
}
export const useHistoryStore = create<HistoryState>()(
persist(
(set) => ({
@@ -49,6 +60,17 @@ export const useHistoryStore = create<HistoryState>()(
{
name: "ytdescgen-history",
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: HistoryEntry.genre (single) became genres[] in v0.5.
version: 2,
migrate: (persistedState: unknown, version: number) => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as { entries?: LegacyEntry[] };
if (Array.isArray(state.entries)) {
state.entries = state.entries.map(normaliseEntry);
}
}
return persistedState as { entries: HistoryEntry[] };
},
partialize: (state) => ({ entries: state.entries }),
},
),
+25 -2
View File
@@ -8,7 +8,7 @@ export interface GamePreset {
id: string;
gameName: string;
gameNameLocalized?: Record<string, string>;
genre: Genre;
genres: Genre[];
platform: string;
storeLinks: Record<string, string>;
spoilerWarning: boolean;
@@ -25,6 +25,17 @@ interface PresetState {
importPresets: (presets: GamePreset[]) => void;
}
type LegacyPreset = Omit<GamePreset, "genres"> & { genre?: Genre; genres?: Genre[] };
function normalisePreset(p: LegacyPreset): GamePreset {
const { genre, ...rest } = p;
if (Array.isArray(rest.genres) && rest.genres.length > 0) {
return rest as GamePreset;
}
const fallback = genre ?? "action";
return { ...rest, genres: [fallback] } as GamePreset;
}
export const usePresetStore = create<PresetState>()(
persist(
(set, get) => ({
@@ -54,7 +65,8 @@ export const usePresetStore = create<PresetState>()(
importPresets: (presets) => {
set((state) => {
const existingIds = new Set(state.presets.map((p) => p.id));
const newPresets = presets.filter((p) => !existingIds.has(p.id));
const normalised = presets.map((p) => normalisePreset(p as LegacyPreset));
const newPresets = normalised.filter((p) => !existingIds.has(p.id));
return { presets: [...state.presets, ...newPresets] };
});
},
@@ -62,6 +74,17 @@ export const usePresetStore = create<PresetState>()(
{
name: "ytdescgen-presets",
storage: createJSONStorage(() => localStorage),
// v1 → v2 upgrade: GamePreset.genre (single) became genres[] in v0.5.
version: 2,
migrate: (persistedState: unknown, version: number) => {
if (version < 2 && persistedState && typeof persistedState === "object") {
const state = persistedState as { presets?: LegacyPreset[] };
if (Array.isArray(state.presets)) {
state.presets = state.presets.map(normalisePreset);
}
}
return persistedState as { presets: GamePreset[] };
},
partialize: (state) => ({ presets: state.presets }),
},
),
+9 -1
View File
@@ -2,7 +2,15 @@ import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
import type { GraphicsPreset } from "@config/graphics-settings";
/**
* `graphicsPreset` was free-form text pre-v0.8. The type uses the v0.8
* enum so call sites pass the value cleanly into `loadProfile` — TS
* believes legacy strings like "Ultra" are valid enum values, but
* `editor-store.normalizeEditorPatch` runs on load and maps them
* through the same v4→v5 logic as the persist migration.
*/
export interface Profile {
id: string;
name: string;
@@ -12,7 +20,7 @@ export interface Profile {
rig: Record<string, string>;
resolution: string;
fps: string;
graphicsPreset: string;
graphicsPreset: GraphicsPreset;
createdAt: string;
updatedAt: string;
}
+157
View File
@@ -0,0 +1,157 @@
import type { GenreId } from "@config/genres";
import type { SupportedLanguage, TitleFormatConfig } from "@engine/types";
// Re-exported so UI + persist layers can import everything from one module.
export type {
TitleBadgeCase,
TitleBadgePosition,
TitleFormatConfig,
TitleSeparatorId,
} from "@engine/types";
/**
* Shape of the settings payload that is persisted to disk + localStorage.
* Kept separate from the zustand store type so pure helpers (like
* {@link healSettings}) can run in any environment — the store itself
* pulls in browser-only modules (`window`, Tauri bridges) that break
* when imported from a Node-based test runner.
*/
export interface SettingsData {
appLanguage: SupportedLanguage;
defaultOutputLanguage: SupportedLanguage;
defaultGenres: GenreId[];
theme: "dark" | "light";
showCharCount: boolean;
compactTagDisplay: boolean;
historyLimit: number;
includeMultilingualTags: boolean;
includeTrendingTags: boolean;
hashtagCount: number;
showQualityBadge: boolean;
showCopyright: boolean;
showUsagePolicy: boolean;
showSponsorCredit: boolean;
/**
* When true, Output + Batch render a generated pinned-comment
* template alongside the user's freeform pinnedComment field. Default
* off — the template is opt-in, so v0.6 users don't see a new block
* appear after upgrade without asking for it.
*/
showPinnedCommentTemplate: boolean;
/**
* Child toggle for {@link showPinnedCommentTemplate}. When true (the
* default), the generated template includes the "what game should I
* play next?" prompt. Creators running a fixed series can turn this
* off without disabling the whole template.
*/
pinnedCommentIncludeAskNextGame: boolean;
/**
* Child toggle for {@link showPinnedCommentTemplate}. When true and the
* primary genre has a configured playlist URL in {@link genrePlaylists},
* the generated pinned comment includes a "More <genre> gameplay on the
* channel" line pointing at that playlist. v0.8 phase 2.
*/
pinnedCommentIncludeGenrePlaylist: boolean;
/**
* Per-genre YouTube playlist URLs. Configure once in Settings → Genre
* Playlists, then the pinned-comment template auto-suggests the
* matching playlist based on the video's primary genre. Validated
* against {@link validatePlaylistUrl}; empty rows are not persisted.
* v0.8 phase 2.
*/
genrePlaylists: Partial<Record<GenreId, string>>;
titleFormat: TitleFormatConfig;
editorAccordionState: Record<string, boolean>;
}
export function detectBrowserLanguage(): SupportedLanguage {
if (typeof navigator === "undefined") return "en";
const lang = navigator.language.split("-")[0];
const supported: SupportedLanguage[] = ["en", "vi", "ja", "es", "ko", "zh"];
return (supported.find((s) => s === lang) ?? "en") as SupportedLanguage;
}
/**
* Single source of truth for settings defaults. Evaluated once at module
* load so detection (e.g. browser language) happens before any rehydrate.
*/
export const initialSettings: SettingsData = {
appLanguage: detectBrowserLanguage(),
defaultOutputLanguage: detectBrowserLanguage(),
defaultGenres: ["action"],
theme: "dark",
showCharCount: true,
compactTagDisplay: false,
historyLimit: 100,
includeMultilingualTags: true,
includeTrendingTags: true,
hashtagCount: 3,
showQualityBadge: true,
showCopyright: true,
showUsagePolicy: false,
showSponsorCredit: false,
showPinnedCommentTemplate: false,
pinnedCommentIncludeAskNextGame: true,
pinnedCommentIncludeGenrePlaylist: false,
genrePlaylists: {},
titleFormat: {
// Defaults reproduce v0.6 output byte-for-byte: badge glued to the
// video-type segment, em-dash separator, upper-case badge label.
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
},
editorAccordionState: {
gameInfo: true,
videoSettings: true,
contentDetails: false,
attribution: false,
rig: false,
storeAndSocial: false,
},
};
/**
* Normalise persisted settings so missing keys are back-filled with the
* current defaults, legacy shapes are upgraded, and removed keys are
* stripped. Runs on every rehydrate so a hand-edited or partially-written
* `settings.json` can never leave the store in an incomplete state.
*
* Pure — safe to call from unit tests.
*/
export function healSettings(raw: unknown): SettingsData {
if (!raw || typeof raw !== "object") return { ...initialSettings };
const incoming = { ...(raw as Record<string, unknown>) };
// v1 → v2 shape upgrade: `defaultGenre: GenreId` became
// `defaultGenres: GenreId[]`.
if (typeof incoming.defaultGenre === "string" && !Array.isArray(incoming.defaultGenres)) {
incoming.defaultGenres = [incoming.defaultGenre];
}
delete incoming.defaultGenre;
// v2 → v3: `autoSaveDraft` removed (the draft autosaves unconditionally
// via the editor store's persist middleware, so the toggle was dead).
delete incoming.autoSaveDraft;
// v4 → v5: `titleFormat` nested config added. Merge sub-keys defensively
// so a hand-edited / partial object doesn't drop defaults and leave
// downstream consumers with `undefined` badgePosition etc.
const incomingTf =
typeof incoming.titleFormat === "object" && incoming.titleFormat !== null
? (incoming.titleFormat as Partial<TitleFormatConfig>)
: {};
incoming.titleFormat = { ...initialSettings.titleFormat, ...incomingTf };
// v6 → v7: `genrePlaylists` map and `pinnedCommentIncludeGenrePlaylist`
// toggle added (v0.8 phase 2). Defensive merge for the nested map so
// existing entries survive while missing genres fall through to {}.
const incomingGp =
typeof incoming.genrePlaylists === "object" && incoming.genrePlaylists !== null
? (incoming.genrePlaylists as Partial<Record<GenreId, string>>)
: {};
incoming.genrePlaylists = { ...initialSettings.genrePlaylists, ...incomingGp };
return { ...initialSettings, ...incoming } as SettingsData;
}
+61 -71
View File
@@ -3,62 +3,32 @@ import { persist, createJSONStorage } from "zustand/middleware";
import type { GenreId } from "@config/genres";
import type { SupportedLanguage } from "@engine/types";
import { saveSettings, loadSettings } from "@utils/storage-adapter";
import {
healSettings,
initialSettings,
type SettingsData,
type TitleFormatConfig,
} from "./settings-heal";
interface SettingsState {
appLanguage: SupportedLanguage;
defaultOutputLanguage: SupportedLanguage;
defaultGenre: GenreId;
theme: "dark" | "light";
autoSaveDraft: boolean;
showCharCount: boolean;
compactTagDisplay: boolean;
historyLimit: number;
includeMultilingualTags: boolean;
includeTrendingTags: boolean;
hashtagCount: number;
export type {
SettingsData,
TitleFormatConfig,
TitleBadgePosition,
TitleSeparatorId,
TitleBadgeCase,
} from "./settings-heal";
export { healSettings, initialSettings } from "./settings-heal";
interface SettingsState extends SettingsData {
setTheme: (theme: "dark" | "light") => void;
setAppLanguage: (lang: SupportedLanguage) => void;
setDefaultOutputLanguage: (lang: SupportedLanguage) => void;
setDefaultGenre: (genre: GenreId) => void;
setDefaultGenres: (genres: GenreId[]) => void;
setSetting: <K extends keyof SettingsData>(key: K, value: SettingsData[K]) => void;
setTitleFormat: (patch: Partial<TitleFormatConfig>) => void;
toggleEditorAccordion: (id: string) => void;
}
interface SettingsData {
appLanguage: SupportedLanguage;
defaultOutputLanguage: SupportedLanguage;
defaultGenre: GenreId;
theme: "dark" | "light";
autoSaveDraft: boolean;
showCharCount: boolean;
compactTagDisplay: boolean;
historyLimit: number;
includeMultilingualTags: boolean;
includeTrendingTags: boolean;
hashtagCount: number;
}
const detectBrowserLanguage = (): SupportedLanguage => {
const lang = navigator.language.split("-")[0];
const supported: SupportedLanguage[] = ["en", "vi", "ja", "es", "ko", "zh"];
return (supported.find((s) => s === lang) ?? "en") as SupportedLanguage;
};
const detectedLang = detectBrowserLanguage();
const initialSettings: SettingsData = {
appLanguage: detectedLang,
defaultOutputLanguage: detectedLang,
defaultGenre: "action",
theme: "dark",
autoSaveDraft: true,
showCharCount: true,
compactTagDisplay: false,
historyLimit: 100,
includeMultilingualTags: true,
includeTrendingTags: true,
hashtagCount: 3,
};
const STORE_KEY = "ytdescgen-settings";
export const useSettingsStore = create<SettingsState>()(
@@ -76,30 +46,36 @@ export const useSettingsStore = create<SettingsState>()(
setDefaultOutputLanguage: (lang) => set({ defaultOutputLanguage: lang }),
setDefaultGenre: (genre) => set({ defaultGenre: genre }),
setDefaultGenres: (genres) => set({ defaultGenres: genres }),
setSetting: (key, value) => set({ [key]: value }),
setTitleFormat: (patch) =>
set((state) => ({ titleFormat: { ...state.titleFormat, ...patch } })),
toggleEditorAccordion: (id) =>
set((state) => ({
editorAccordionState: {
...state.editorAccordionState,
[id]: !state.editorAccordionState[id],
},
})),
}),
{
name: STORE_KEY,
storage: createJSONStorage(() => localStorage),
partialize: (state) => ({
appLanguage: state.appLanguage,
defaultOutputLanguage: state.defaultOutputLanguage,
defaultGenre: state.defaultGenre,
theme: state.theme,
autoSaveDraft: state.autoSaveDraft,
showCharCount: state.showCharCount,
compactTagDisplay: state.compactTagDisplay,
historyLimit: state.historyLimit,
includeMultilingualTags: state.includeMultilingualTags,
includeTrendingTags: state.includeTrendingTags,
hashtagCount: state.hashtagCount,
}),
version: 7,
migrate: (persistedState: unknown): SettingsData => healSettings(persistedState),
partialize: (state) => extractData(state),
onRehydrateStorage: () => {
return () => {
loadSettings<SettingsData>(STORE_KEY, initialSettings).then((data) => {
if (data) useSettingsStore.setState(data);
// Fall back to the (already-healed) zustand state so the file read
// never downgrades the store if the on-disk copy is missing keys.
const fallback = extractData(useSettingsStore.getState());
loadSettings<Partial<SettingsData>>(STORE_KEY, fallback).then((data) => {
if (data) {
useSettingsStore.setState(healSettings(data));
}
});
};
},
@@ -107,20 +83,34 @@ export const useSettingsStore = create<SettingsState>()(
),
);
// Dual-write: also save to file on every change
useSettingsStore.subscribe((state) => {
const data: SettingsData = {
function extractData(state: SettingsData): SettingsData {
return {
appLanguage: state.appLanguage,
defaultOutputLanguage: state.defaultOutputLanguage,
defaultGenre: state.defaultGenre,
defaultGenres: state.defaultGenres,
theme: state.theme,
autoSaveDraft: state.autoSaveDraft,
showCharCount: state.showCharCount,
compactTagDisplay: state.compactTagDisplay,
historyLimit: state.historyLimit,
includeMultilingualTags: state.includeMultilingualTags,
includeTrendingTags: state.includeTrendingTags,
hashtagCount: state.hashtagCount,
showQualityBadge: state.showQualityBadge,
showCopyright: state.showCopyright,
showUsagePolicy: state.showUsagePolicy,
showSponsorCredit: state.showSponsorCredit,
showPinnedCommentTemplate: state.showPinnedCommentTemplate,
pinnedCommentIncludeAskNextGame: state.pinnedCommentIncludeAskNextGame,
pinnedCommentIncludeGenrePlaylist: state.pinnedCommentIncludeGenrePlaylist,
genrePlaylists: { ...state.genrePlaylists },
titleFormat: { ...state.titleFormat },
editorAccordionState: state.editorAccordionState,
};
saveSettings(STORE_KEY, data);
}
// Dual-write: also save to file on every change. Guarantees the
// `settings.json` on disk always contains the full schema after the first
// rehydrate, even on a fresh install with no prior localStorage.
useSettingsStore.subscribe((state) => {
saveSettings(STORE_KEY, extractData(state));
});
+166
View File
@@ -0,0 +1,166 @@
import { create } from "zustand";
import { persist, createJSONStorage } from "zustand/middleware";
import { generateId } from "@utils/uuid";
import { saveSettings } from "@utils/storage-adapter";
import type {
VideoType,
Genre,
SupportedLanguage,
StoreLinkType,
PlaythroughStatus,
DifficultyLevel,
ContentWarning,
} from "@engine/types";
import type {
GraphicsPreset,
RTMode,
FrameGenVendor,
FrameGenMultiplier,
UpscaleQuality,
ArtStyle,
} from "@config/graphics-settings";
import type { GachaQuestType } from "@config/gacha-quest-types";
/**
* Full snapshot of the editor form. Matches the `partialize` output of
* editor-store so a template can be applied back via `loadProfile` /
* `loadPreset` (both accept `Partial<EditorData>`) and restore every
* field the creator had set.
*
* Pre-v0.8 snapshots persisted `graphicsPreset` as free-form text. The
* type here uses the v0.8 enum — TS believes legacy strings like "Ultra"
* are `GraphicsPreset`, but `editor-store.normalizeEditorPatch` runs on
* `loadProfile` / `loadPreset` and maps them through the same logic as
* the persist v4→v5 migration, so behaviour is correct at runtime.
*/
export interface TemplateSnapshot {
videoType: VideoType;
language: SupportedLanguage;
genres: Genre[];
gameName: string;
gameNameLocalized: Record<string, string>;
channelName: string;
platform: string;
partNumber: string;
bossName: string;
dlcName: string;
challengeName: string;
modName: string;
/** Long-form mod credit list (v0.8 polish). Optional for back-compat. */
modList?: string;
/** Livestream-only (v0.8 phase 2). Optional for back-compat. */
liveUrl?: string;
scheduledTime?: string;
/** Gacha-quest extras (v0.9 phase 1). Optional for back-compat. */
gachaQuestType?: GachaQuestType;
chapterName?: string;
questName?: string;
resolution: string;
fps: string;
graphicsPreset: GraphicsPreset;
/** v0.8 phase 2 fields — optional for back-compat with pre-v0.8 templates. */
graphicsPresetCustom?: string;
skipGraphicsSettings?: boolean;
rayTracingModes?: RTMode[];
frameGenVendor?: FrameGenVendor;
frameGenMultiplier?: FrameGenMultiplier;
upscaleQuality?: UpscaleQuality;
artStyle?: ArtStyle;
versionInfo?: string;
timestamps: string;
playlistLink: string;
contactEmail: string;
musicAttribution: string;
thumbnailText: string;
pinnedComment: string;
spoilerWarning: boolean;
matureWarning: boolean;
/**
* v0.7 phase 2 fields. Marked optional because templates saved before
* v0.8 polish don't carry them; `loadProfile` spreads `...patch` onto
* the editor state, so missing keys keep the editor's existing values.
*/
playthroughStatus?: PlaythroughStatus;
difficulty?: DifficultyLevel;
difficultyCustomLabel?: string;
contentWarnings?: ContentWarning[];
storeLinks: Record<string, string>;
storeLinkTypes: Record<string, StoreLinkType>;
social: Record<string, string>;
rig: Record<string, string>;
/** Vietnam donate (v0.8 polish). Optional for back-compat. */
vnBankName?: string;
vnBankAccount?: string;
vnBankHolder?: string;
vnMomo?: string;
vnZalopay?: string;
}
export interface EditorTemplate {
id: string;
name: string;
createdAt: string;
snapshot: TemplateSnapshot;
}
interface TemplateState {
templates: EditorTemplate[];
addTemplate: (name: string, snapshot: TemplateSnapshot) => string;
deleteTemplate: (id: string) => void;
renameTemplate: (id: string, name: string) => void;
getTemplate: (id: string) => EditorTemplate | undefined;
importTemplates: (templates: EditorTemplate[]) => void;
}
const STORE_KEY = "ytdescgen-templates";
export const useTemplateStore = create<TemplateState>()(
persist(
(set, get) => ({
templates: [],
addTemplate: (name, snapshot) => {
const id = generateId();
const template: EditorTemplate = {
id,
name: name.trim() || "Untitled",
createdAt: new Date().toISOString(),
snapshot,
};
set((state) => ({ templates: [...state.templates, template] }));
return id;
},
deleteTemplate: (id) => {
set((state) => ({ templates: state.templates.filter((tpl) => tpl.id !== id) }));
},
renameTemplate: (id, name) => {
set((state) => ({
templates: state.templates.map((tpl) =>
tpl.id === id ? { ...tpl, name: name.trim() || tpl.name } : tpl,
),
}));
},
getTemplate: (id) => get().templates.find((tpl) => tpl.id === id),
importTemplates: (templates) => {
set((state) => {
const existing = new Set(state.templates.map((tpl) => tpl.id));
const incoming = templates.filter((tpl) => !existing.has(tpl.id));
return { templates: [...state.templates, ...incoming] };
});
},
}),
{
name: STORE_KEY,
storage: createJSONStorage(() => localStorage),
partialize: (state) => ({ templates: state.templates }),
},
),
);
useTemplateStore.subscribe((state) => {
saveSettings(STORE_KEY, { templates: state.templates });
});
+26
View File
@@ -0,0 +1,26 @@
/**
* Strip every character that is not a Unicode letter or digit.
*
* Used to turn a free-form game name or genre id into a valid hashtag body.
* Spaces, punctuation, separators, and emoji are all removed; accented
* letters and non-Latin scripts are preserved via `\p{L}` / `\p{N}`.
*
* "S.T.A.L.K.E.R. 2" -> "STALKER2"
* "Yakuza: Like a Dragon"-> "YakuzaLikeaDragon"
* "visual_novel" -> "visualnovel"
* "仁王 2" -> "仁王2"
*/
export function sanitizeHashtag(name: string): string {
return name.normalize("NFC").replace(/[^\p{L}\p{N}]/gu, "");
}
/**
* Turn a snake_case identifier into a space-separated, human-readable form.
* Used for free-text tag strings where the id would otherwise leak as-is.
*
* "visual_novel" -> "visual novel"
* "survival_craft" -> "survival craft"
*/
export function humanizeId(id: string): string {
return id.replace(/_/g, " ");
}
+152
View File
@@ -0,0 +1,152 @@
/**
* Extract a humanized game name from a recognised storefront URL.
*
* Supported storefronts (those whose URL paths carry stable, parseable
* name slugs):
* • Steam — `https://store.steampowered.com/app/<id>/<Slug>/`
* • itch.io — `https://<dev>.itch.io/<slug>`
* • GOG — `https://www.gog.com/[<lang>/]game/<slug>`
* • Epic — `https://store.epicgames.com/<locale>/p/<slug>[-<hash>]`
* • Nintendo US — `https://www.nintendo.com/us/store/products/<slug>[-switch[-2]]/`
* • Nintendo EU — `https://www.nintendo.com/<locale>/Games/<segment>/<slug>[-<id>].html`
* • Humble — `https://www.humblebundle.com/store/<slug>`
*
* Returns `null` for every other URL shape — including PlayStation /
* Xbox / Amazon Luna URLs, which rely on opaque product IDs rather than
* stable name slugs and would emit garbled names.
*/
interface NameExtractor {
pattern: RegExp;
humanize: (slug: string) => string;
}
/**
* Title-case a string in a way that's friendly for game names extracted
* from URL slugs:
* • lowercases first to normalise ALL_CAPS slugs (`ELDEN_RING`)
* • capitalises the first letter of each whitespace- or hyphen-
* separated piece, so "counter-strike 2" → "Counter-Strike 2"
* • leaves leading-numeric tokens alone ("100 Orange Juice")
*/
function titleCase(s: string): string {
return s
.toLowerCase()
.split(/(\s+)/)
.map((chunk) => {
if (/^\s+$/.test(chunk) || chunk === "") return chunk;
return chunk
.split("-")
.map((piece) =>
piece.length === 0 ? piece : piece.charAt(0).toUpperCase() + piece.slice(1),
)
.join("-");
})
.join("");
}
const PLATFORM_NAME_EXTRACTORS: readonly NameExtractor[] = [
{
// Steam slug sits after `/app/<digits>/`. The slug uses underscores
// and is often ALL_CAPS — we lowercase + title-case for display.
pattern: /^https:\/\/store\.steampowered\.com\/app\/\d+\/([^/?#\s]+)/i,
humanize: (s) => titleCase(s.replace(/_+/g, " ")),
},
{
// itch.io: <dev>.itch.io/<slug> — dev subdomain, hyphen-cased game slug.
pattern: /^https:\/\/[^/]+\.itch\.io\/([^/?#\s]+)/i,
humanize: (s) => titleCase(s.replace(/-+/g, " ")),
},
{
// GOG canonical game URL, optionally locale-prefixed (e.g. `/en/`).
pattern: /^https:\/\/www\.gog\.com\/(?:[a-z]{2}\/)?game\/([^/?#\s]+)/i,
humanize: (s) => titleCase(s.replace(/_+/g, " ")),
},
{
// Epic Games Store. Path is locale-prefixed (`en-US`, `de`, `fr`,
// …) and ends with `/p/<slug>` where the slug carries a 6+-char
// hex product hash like `-aa04de` we strip before display.
pattern:
/^https:\/\/store\.epicgames\.com\/[a-z]{2}(?:-[a-z]{2})?\/p\/([a-z0-9-]+)/i,
humanize: (s) =>
titleCase(s.replace(/-[a-f0-9]{6,}$/i, "").replace(/-+/g, " ")),
},
{
// Nintendo US store (`/us/store/products/<slug>`). Slugs frequently
// carry a `-switch` or `-switch-2` platform suffix that we strip
// for a cleaner display name.
pattern:
/^https:\/\/www\.nintendo\.com\/us\/store\/products\/([^/?#\s]+)/i,
humanize: (s) =>
titleCase(s.replace(/-switch(?:-2)?$/i, "").replace(/-+/g, " ")),
},
{
// Nintendo EU store (`/<locale>/Games/<segment>/<slug>-<id>.html`).
// The slug ends with a numeric product id we strip before display.
pattern:
/^https:\/\/www\.nintendo\.com\/[a-z]{2}-[a-z]{2}\/Games\/[^/]+\/([^/?#]+?)(?:-\d+)?\.html/i,
humanize: (s) => titleCase(s.replace(/-+/g, " ")),
},
{
// Humble Bundle store. Slugs are simple hyphen-cased names.
pattern: /^https:\/\/www\.humblebundle\.com\/store\/([^/?#\s]+)/i,
humanize: (s) => titleCase(s.replace(/-+/g, " ")),
},
] as const;
export function extractGameNameFromUrl(url: string): string | null {
const trimmed = url.trim();
if (!trimmed) return null;
for (const ex of PLATFORM_NAME_EXTRACTORS) {
const m = trimmed.match(ex.pattern);
if (m?.[1]) {
const name = ex.humanize(m[1]).trim();
if (name) return name;
}
}
return null;
}
/**
* Lowercase + alphanumeric token set. Apostrophes are removed (not
* spaced) so `Marvel's` tokenises to `marvels`, matching Steam slugs
* like `Marvels_Spider-Man_Remastered` exactly.
*/
function tokenize(s: string): Set<string> {
return new Set(
s
.toLowerCase()
.replace(/['’]/g, "")
.replace(/[^a-z0-9 ]+/g, " ")
.split(/\s+/)
.filter(Boolean),
);
}
/**
* Subset-tolerant comparison: returns true when the URL extracts to a
* name whose tokens are NOT all present in the typed Game Name.
*
* Examples:
* • Game `Marvel's Spider-Man Remastered` + Steam link `Spider-Man`
* → no mismatch (link tokens ⊆ game tokens).
* • Game `Pragmata Pro` + Humble link `Pragmata`
* → no mismatch (link tokens ⊆ game tokens).
* • Game `Pragmata` + Humble link `Lucky Tower Ultimate`
* → mismatch (link has tokens absent from game name).
*
* Returns false when either side is empty or the URL is not a
* recognised storefront.
*/
export function isLinkNameMismatch(gameName: string, url: string): boolean {
if (!gameName.trim()) return false;
const extracted = extractGameNameFromUrl(url);
if (!extracted) return false;
const gameTokens = tokenize(gameName);
const linkTokens = tokenize(extracted);
if (gameTokens.size === 0 || linkTokens.size === 0) return false;
for (const t of linkTokens) {
if (!gameTokens.has(t)) return true;
}
return false;
}
+60
View File
@@ -76,3 +76,63 @@ export function validateUrlWithPrefix(
return { valid: true };
}
/**
* Validate a URL against a platform-specific RegExp. Unlike
* validateUrlWithPrefix, prefix-style mismatches are treated as hard
* errors so invalid links can be kept out of the output.
*/
export function validateUrlWithPattern(
input: string,
pattern: RegExp,
): ValidationResult {
const trimmed = input.trim();
if (!trimmed) return { valid: true };
const baseResult = validateUrl(trimmed);
if (!baseResult.valid) return baseResult;
if (!pattern.test(trimmed)) {
return { valid: false, error: "validation.urlInvalid" };
}
return { valid: true };
}
/**
* Strict validator for YouTube playlist URLs. The output description and
* the genre-playlist suggestion in the pinned-comment template both rely
* on the link being a real `?list=…` playlist URL — accepting a video URL
* (`watch?v=…`) here would produce broken output.
*
* v0.8.1: relaxed from the v0.8 shape so real share URLs go through:
* - `www.` is optional (YouTube emits both `www.youtube.com` and
* `youtube.com` depending on context).
* - `list=` may sit anywhere in the query string and be flanked by
* other params (`si=…`, `pp=…`, `index=…`, etc.).
* - A trailing fragment (`#…`) is tolerated.
*
* `watch?v=…` URLs and `youtu.be/…` short links remain rejected because
* the path must be exactly `/playlist`.
*/
const YT_PLAYLIST_REGEX =
/^https:\/\/(?:www\.)?youtube\.com\/playlist\?(?:[^#]*&)?list=[A-Za-z0-9_-]+(?:&[^#]*)?(?:#.*)?$/;
const PLAYLIST_URL_EXPECTED = "https://www.youtube.com/playlist?list=[id]";
export function validatePlaylistUrl(input: string): ValidationResult {
const trimmed = input.trim();
if (!trimmed) return { valid: true };
const baseResult = validateUrl(trimmed);
if (!baseResult.valid) return baseResult;
if (!YT_PLAYLIST_REGEX.test(trimmed)) {
return {
valid: false,
error: "validation.playlistUrlInvalid",
errorParams: { expected: PLAYLIST_URL_EXPECTED },
};
}
return { valid: true };
}
+735 -6
View File
@@ -7,7 +7,7 @@ function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -31,6 +31,34 @@ describe("buildDescription", () => {
expect(result).toContain("#EldenRing");
});
it("sanitises hashtags for game names with special characters", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ gameName: "S.T.A.L.K.E.R. 2" }),
t,
);
expect(result).toContain("#STALKER2");
expect(result).not.toMatch(/#\s?S\./);
});
it("sanitises hashtags for snake_case genre ids (fixes #visual_novel bug)", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ genres: ["visual_novel"] }), t);
expect(result).toContain("#visualnovel");
expect(result).not.toContain("#visual_novel");
});
it("uses the first genre for the hashtag when multiple are selected", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ genres: ["hack_slash", "action", "soulslike"] }),
t,
);
expect(result).toContain("#hackslash");
expect(result).not.toContain("#action");
expect(result).not.toContain("#soulslike");
});
it("includes timestamps when provided", () => {
const t = createMockT("en");
const result = buildDescription(
@@ -42,24 +70,390 @@ describe("buildDescription", () => {
expect(result).toContain("5:30 Boss");
});
it("includes store links when provided", () => {
it("includes store links when provided (paid default → Buy heading)", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ storeLinks: { Steam: "https://store.steampowered.com/app/123" } }),
t,
);
expect(result).toContain("GET THE GAME");
expect(result).toContain("GET THE GAME (if you want to buy)");
expect(result).toContain("Steam: https://store.steampowered.com/app/123");
expect(result).not.toContain("DOWNLOAD THE GAME");
});
it("includes video settings", () => {
it("switches to Download heading when majority of links are free/demo", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ resolution: "4K", fps: "60", graphicsPreset: "Ultra" }),
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/demo",
epic: "https://store.epicgames.com/freegame",
},
storeLinkTypes: {
steam: "paid",
itchio: "demo",
epic: "free",
},
}),
t,
);
expect(result).toContain("DOWNLOAD THE GAME (if you want to play)");
expect(result).not.toContain("GET THE GAME");
});
it("ties favour the Buy heading", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/game",
},
storeLinkTypes: { steam: "paid", itchio: "free" },
}),
t,
);
// 1 paid, 1 free → nonPaid (1) is NOT > entries.length/2 (1) → Buy
expect(result).toContain("GET THE GAME (if you want to buy)");
});
it("adds (free demo) suffix to demo links", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: { itchio: "https://dev.itch.io/demo" },
storeLinkTypes: { itchio: "demo" },
}),
t,
);
expect(result).toContain("(free demo)");
});
it("adds (free) suffix to free links but not paid ones", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: {
steam: "https://store.steampowered.com/app/1",
itchio: "https://dev.itch.io/game",
},
storeLinkTypes: { steam: "paid", itchio: "free" },
}),
t,
);
// Find the itchio line and make sure it has (free), Steam line does not
const lines = result.split("\n");
const itchLine = lines.find((l) => l.includes("itch.io"));
const steamLine = lines.find((l) => l.includes("steampowered"));
expect(itchLine).toContain("(free)");
expect(steamLine).not.toContain("(free)");
});
it("defaults unspecified link types to paid", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
storeLinks: { steam: "https://store.steampowered.com/app/1" },
// storeLinkTypes omitted entirely
}),
t,
);
expect(result).toContain("GET THE GAME (if you want to buy)");
expect(result).not.toContain("(free)");
});
it("includes video settings with the v0.8-polish multi-line block", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ resolution: "4K", fps: "60", graphicsPreset: "ultra" }),
t,
);
expect(result).toContain("VIDEO SETTINGS");
expect(result).toContain("4K | 60 FPS | Ultra");
expect(result).toContain("Video: 4K - 60 FPS");
expect(result).toContain("In-game Setting: Ultra");
});
it("composes Cinematic + NVIDIA Frame Gen x2 + Ray Tracing line", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1440p",
fps: "120",
graphicsPreset: "cinematic",
frameGenVendor: "nvidia",
frameGenMultiplier: "x2",
rayTracingModes: ["ray_tracing"],
}),
t,
);
expect(result).toContain("Video: 1440p - 120 FPS");
expect(result).toContain(
"In-game Setting: Cinematic - NVIDIA Frame Generation x2 with Ray Tracing",
);
});
it("combines upscaling quality and frame generation under one vendor", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "4K",
fps: "60",
graphicsPreset: "ultra",
frameGenVendor: "amd",
upscaleQuality: "quality",
frameGenMultiplier: "x3",
rayTracingModes: ["full_rt"],
}),
t,
);
expect(result).toContain(
"In-game Setting: Ultra - AMD FSR Quality + Frame Generation x3 with Full Ray Tracing",
);
});
it("emits multiple RT modes joined with commas", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1080p",
fps: "60",
graphicsPreset: "high",
rayTracingModes: ["path_tracing", "ray_reconstruction"],
}),
t,
);
expect(result).toContain(
"In-game Setting: High with Path Tracing, Ray Reconstruction",
);
});
it("uses the user's free-form label when graphicsPreset is custom", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1080p",
fps: "60",
graphicsPreset: "custom",
graphicsPresetCustom: "Epic",
}),
t,
);
expect(result).toContain("Video: 1080p - 60 FPS");
expect(result).toContain("In-game Setting: Epic");
});
it("emits Art Style on its own line", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
graphicsPreset: "medium",
artStyle: "pixel_art",
}),
t,
);
expect(result).toContain("In-game Setting: Medium");
expect(result).toContain("Art Style: Pixel Art");
});
it("emits Version on its own line", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1080p",
fps: "60",
graphicsPreset: "ultra",
versionInfo: "GeForce 565.90 | Game v1.4",
}),
t,
);
expect(result).toContain("Video: 1080p - 60 FPS");
expect(result).toContain("In-game Setting: Ultra");
expect(result).toContain("Version: GeForce 565.90 | Game v1.4");
});
it("renders the four video-settings tokens as separate labelled lines", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1440p",
fps: "60",
graphicsPreset: "cinematic",
frameGenVendor: "nvidia",
frameGenMultiplier: "x2",
rayTracingModes: ["ray_tracing"],
artStyle: "realistic",
versionInfo: "GeForce 566.36",
}),
t,
);
// Each line carries its own label — find the section and verify the
// four expected lines are present in order.
const section = result.split("🖥 VIDEO SETTINGS\n")[1]?.split("\n\n")[0];
expect(section).toBeTruthy();
const lines = section!.split("\n");
expect(lines[0]).toBe("Video: 1440p - 60 FPS");
expect(lines[1]).toBe(
"In-game Setting: Cinematic - NVIDIA Frame Generation x2 with Ray Tracing",
);
expect(lines[2]).toBe("Art Style: Realistic");
expect(lines[3]).toBe("Version: GeForce 566.36");
});
it("omits the entire VIDEO SETTINGS section when skipGraphicsSettings is true", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
resolution: "1080p",
fps: "60",
graphicsPreset: "ultra",
skipGraphicsSettings: true,
}),
t,
);
expect(result).not.toContain("VIDEO SETTINGS");
expect(result).not.toContain("Ultra Setting");
});
it("renders livestream intro + watch link + scheduled time", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "livestream",
gameName: "Elden Ring",
channelName: "TestChannel",
liveUrl: "https://www.youtube.com/watch?v=live123",
scheduledTime: "2026-05-04T20:00:00",
}),
t,
);
expect(result).toContain(
"Live stream of Elden Ring on TestChannel",
);
expect(result).toContain("🔴 LIVE on");
expect(result).toContain("Watch / replay: https://www.youtube.com/watch?v=live123");
});
it("falls back to the raw scheduledTime string when it can't be parsed", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "livestream",
liveUrl: "https://www.youtube.com/watch?v=abc",
scheduledTime: "tomorrow at 8pm", // not ISO
}),
t,
);
expect(result).toContain("🔴 LIVE on tomorrow at 8pm");
});
it("renders the Vietnam donate block when language is 'vi' and bank fields set", () => {
const t = createMockT("en"); // mock-t falls back to en for keys not in vi mock; section header is what matters
const result = buildDescription(
makeInput({
language: "vi",
vnBankName: "Vietcombank",
vnBankAccount: "0123456789",
vnBankHolder: "NGUYEN VAN A",
vnMomo: "0901234567",
vnZalopay: "0907654321",
}),
t,
);
expect(result).toContain("BANK TRANSFER / E-WALLET (Vietnam)");
expect(result).toContain("🏦 Vietcombank: 0123456789 (NGUYEN VAN A)");
expect(result).toContain("💸 MoMo: 0901234567");
expect(result).toContain("💸 ZaloPay: 0907654321");
});
it("omits the holder parens when the holder field is empty", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
language: "vi",
vnBankName: "MB Bank",
vnBankAccount: "9876543210",
}),
t,
);
expect(result).toContain("🏦 MB Bank: 9876543210");
expect(result).not.toContain("()");
});
it("skips the bank line when only one of bankName/bankAccount is set", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
language: "vi",
vnBankName: "Vietcombank",
// vnBankAccount missing
vnMomo: "0901234567",
}),
t,
);
expect(result).not.toContain("🏦 Vietcombank");
// MoMo line still emits
expect(result).toContain("💸 MoMo: 0901234567");
});
it("never renders the Vietnam donate block when language is not 'vi'", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
language: "en",
vnBankName: "Vietcombank",
vnBankAccount: "0123456789",
vnMomo: "0901234567",
}),
t,
);
expect(result).not.toContain("BANK TRANSFER");
expect(result).not.toContain("🏦 Vietcombank");
expect(result).not.toContain("💸 MoMo");
});
it("renders the Mod List block when videoType is 'mods' and modList is non-empty", () => {
const t = createMockT("en");
const modList = "• Requiem\n• NaturalVision Evolved\n• Custom Skinpack v2.1";
const result = buildDescription(
makeInput({
videoType: "mods",
modName: "Requiem",
modList,
}),
t,
);
expect(result).toContain("🧩 MOD LIST");
expect(result).toContain(modList);
});
it("never renders the Mod List block for non-mods video types", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "full",
modList: "• Requiem",
}),
t,
);
expect(result).not.toContain("MOD LIST");
expect(result).not.toContain("Requiem");
});
it("skips the livestream block when no live metadata is set", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "livestream",
gameName: "Elden Ring",
channelName: "TestChannel",
}),
t,
);
// Intro still emits, but no metadata block
expect(result).toContain("Live stream of Elden Ring on TestChannel");
expect(result).not.toContain("🔴 LIVE on");
expect(result).not.toContain("Watch / replay:");
});
it("includes rig info when provided", () => {
@@ -73,12 +467,194 @@ describe("buildDescription", () => {
expect(result).toContain("GPU: RTX 4090");
});
it("humanises snake_case rig keys (e.g. video_editor → VIDEO EDITOR)", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ rig: { video_editor: "davinci_resolve_studio|19.1" } }),
t,
);
expect(result).toContain("VIDEO EDITOR: DaVinci Resolve Studio 19.1");
expect(result).not.toContain("VIDEO_EDITOR");
});
it("includes spoiler warning when enabled", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ spoilerWarning: true }), t);
expect(result).toContain("SPOILER WARNING");
});
it("includes music attribution section when provided", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ musicAttribution: "Music by Karl Casey @ White Bat Audio" }),
t,
);
expect(result).toContain("🎵 MUSIC / SOUND");
expect(result).toContain("Music by Karl Casey @ White Bat Audio");
});
it("places music section before donate/social sections", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
musicAttribution: "Music credit here",
social: { twitter: "https://x.com/me", kofi: "https://ko-fi.com/me" },
}),
t,
);
const musicIdx = result.indexOf("🎵 MUSIC / SOUND");
const donateIdx = result.indexOf("SUPPORT THE CHANNEL");
expect(musicIdx).toBeGreaterThan(-1);
expect(donateIdx).toBeGreaterThan(-1);
expect(musicIdx).toBeLessThan(donateIdx);
});
it("renders the sponsor credit line when toggle is on and both sponsor fields are filled", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ sponsorName: "Ubisoft", sponsorPlatform: "Steam" }),
t,
{ showSponsorCredit: true },
);
expect(result).toContain("🎁 Thanks to Ubisoft for providing the Steam key of this game.");
});
it("skips the sponsor credit when the toggle is off", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ sponsorName: "Ubisoft", sponsorPlatform: "Steam" }),
t,
{ showSponsorCredit: false },
);
expect(result).not.toContain("🎁 Thanks to Ubisoft");
});
it("skips the sponsor credit when sponsorName is blank even if toggle is on", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ sponsorName: "", sponsorPlatform: "Steam" }),
t,
{ showSponsorCredit: true },
);
expect(result).not.toContain("🎁");
expect(result).not.toContain("Steam key of this game");
});
it("skips the sponsor credit when sponsorPlatform is blank even if toggle is on", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ sponsorName: "Ubisoft", sponsorPlatform: "" }),
t,
{ showSponsorCredit: true },
);
expect(result).not.toContain("🎁");
expect(result).not.toContain("Thanks to Ubisoft");
});
it("trims whitespace around sponsor fields before rendering", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ sponsorName: " Ubisoft ", sponsorPlatform: " Steam " }),
t,
{ showSponsorCredit: true },
);
expect(result).toContain("Thanks to Ubisoft for providing the Steam key");
expect(result).not.toContain(" Ubisoft ");
});
it("places the sponsor credit above the music section and donate block", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
sponsorName: "Ubisoft",
sponsorPlatform: "Steam",
musicAttribution: "Music credit",
social: { kofi: "https://ko-fi.com/me" },
}),
t,
{ showSponsorCredit: true },
);
const sponsorIdx = result.indexOf("🎁");
const musicIdx = result.indexOf("🎵 MUSIC / SOUND");
const donateIdx = result.indexOf("SUPPORT THE CHANNEL");
expect(sponsorIdx).toBeGreaterThan(-1);
expect(musicIdx).toBeGreaterThan(sponsorIdx);
expect(donateIdx).toBeGreaterThan(musicIdx);
});
it("renders sponsor credit in Vietnamese with the localized template", () => {
const t = createMockT("vi");
const result = buildDescription(
makeInput({
language: "vi",
sponsorName: "Ubisoft",
sponsorPlatform: "Steam",
}),
t,
{ showSponsorCredit: true },
);
expect(result).toContain("🎁 Cảm ơn Ubisoft đã tặng key Steam của game này.");
});
it("omits the music section when attribution is blank or whitespace", () => {
const t = createMockT("en");
const blank = buildDescription(makeInput({ musicAttribution: "" }), t);
const whitespace = buildDescription(makeInput({ musicAttribution: " \n " }), t);
expect(blank).not.toContain("🎵 MUSIC / SOUND");
expect(whitespace).not.toContain("🎵 MUSIC / SOUND");
});
it("renders copyright line when showCopyright is true and channelName is set", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showCopyright: true });
const year = new Date().getFullYear();
expect(result).toContain(`© ${year} TestChannel. All rights reserved.`);
});
it("skips copyright when channelName is blank even if toggle is on", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ channelName: "" }), t, {
showCopyright: true,
});
expect(result).not.toContain("All rights reserved");
});
it("skips copyright when the toggle is off", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showCopyright: false });
expect(result).not.toContain("All rights reserved");
});
it("renders the usage policy block when showUsagePolicy is true", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showUsagePolicy: true });
expect(result).toContain("📋 USAGE POLICY");
expect(result).toContain("Always credit");
expect(result).toContain("Compilation, review, commentary");
});
it("skips the usage policy when the toggle is off", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, { showUsagePolicy: false });
expect(result).not.toContain("📋 USAGE POLICY");
});
it("places copyright and usage policy between CTA and hashtags", () => {
const t = createMockT("en");
const result = buildDescription(makeInput(), t, {
showCopyright: true,
showUsagePolicy: true,
});
const ctaIdx = result.indexOf("Like | 🔔 Subscribe");
const copyrightIdx = result.indexOf("All rights reserved");
const policyIdx = result.indexOf("📋 USAGE POLICY");
const hashtagsIdx = result.indexOf("#EldenRing");
expect(ctaIdx).toBeGreaterThan(-1);
expect(copyrightIdx).toBeGreaterThan(ctaIdx);
expect(policyIdx).toBeGreaterThan(copyrightIdx);
expect(hashtagsIdx).toBeGreaterThan(policyIdx);
});
it("includes mature warning when enabled", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ matureWarning: true }), t);
@@ -139,6 +715,159 @@ describe("buildDescription", () => {
});
});
describe("buildDescription — v0.7 content fields", () => {
it("renders the playthrough block after the intro when set", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ playthroughStatus: "blind" }),
t,
);
expect(result).toContain("🎯 Playthrough:");
expect(result).toContain("Blind run (first time playing)");
// Lands between the intro line and the No-Commentary tagline:
const introIdx = result.indexOf("full gameplay of Elden Ring");
const playthroughIdx = result.indexOf("🎯 Playthrough");
const noCommentaryIdx = result.indexOf("No Commentary");
expect(playthroughIdx).toBeGreaterThan(introIdx);
expect(noCommentaryIdx).toBeGreaterThan(playthroughIdx);
});
it("omits the playthrough block when value is 'none'", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ playthroughStatus: "none" }),
t,
);
expect(result).not.toContain("🎯 Playthrough");
});
it("renders the difficulty block with a preset label", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ difficulty: "hard" }), t);
expect(result).toContain("🎮 DIFFICULTY");
expect(result).toContain("Hard");
});
it("renders a custom difficulty label when difficulty is 'custom'", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ difficulty: "custom", difficultyCustomLabel: "Lethal" }),
t,
);
expect(result).toContain("🎮 DIFFICULTY\nLethal");
});
it("skips the difficulty block when difficulty is 'custom' but label is blank", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ difficulty: "custom", difficultyCustomLabel: " " }),
t,
);
expect(result).not.toContain("🎮 DIFFICULTY");
});
it("renders content warnings as a bulleted block", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({ contentWarnings: ["flashing_lights", "loud_noises"] }),
t,
);
expect(result).toContain("⚠️ CONTENT WARNINGS");
expect(result).toContain("• ⚡ Flashing lights");
expect(result).toContain("• 🔊 Loud noises");
expect(result).not.toContain("• 😱 Jump scares");
});
it("omits the content-warnings block when the list is empty", () => {
const t = createMockT("en");
const result = buildDescription(makeInput({ contentWarnings: [] }), t);
expect(result).not.toContain("⚠️ CONTENT WARNINGS");
});
it("places content warnings between the spoiler and mature warnings", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
spoilerWarning: true,
matureWarning: true,
contentWarnings: ["jump_scares"],
}),
t,
);
const spoilerIdx = result.indexOf("SPOILER WARNING");
const contentIdx = result.indexOf("⚠️ CONTENT WARNINGS");
const matureIdx = result.indexOf("MATURE CONTENT");
expect(spoilerIdx).toBeGreaterThan(-1);
expect(contentIdx).toBeGreaterThan(spoilerIdx);
expect(matureIdx).toBeGreaterThan(contentIdx);
});
});
describe("buildDescription — gacha_quest video type (v0.9)", () => {
it("dispatches to the per-quest-type intro for main_story", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "main_story",
gameName: "Genshin Impact",
chapterName: "Chapter 5 Act 2: Where the Stars Fall",
}),
t,
);
expect(result).toContain(
"Welcome to Chapter 5 Act 2: Where the Stars Fall of Genshin Impact on TestChannel!",
);
});
it("dispatches to the per-quest-type intro for world_quest", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "world_quest",
gameName: "Genshin Impact",
questName: "A Solitary Constellation",
}),
t,
);
expect(result).toContain(
'Today\'s video covers the World Quest "A Solitary Constellation" in Genshin Impact on TestChannel.',
);
});
it("dispatches to the per-quest-type intro for endgame", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "endgame",
gameName: "Honkai: Star Rail",
chapterName: "Memory of Chaos",
}),
t,
);
expect(result).toContain(
'Endgame mode "Memory of Chaos" in Honkai: Star Rail on TestChannel.',
);
});
it("falls back to main_story intro when gachaQuestType is missing", () => {
const t = createMockT("en");
const result = buildDescription(
makeInput({
videoType: "gacha_quest",
gameName: "Wuthering Waves",
chapterName: "Chapter 1",
}),
t,
);
expect(result).toContain(
"Welcome to Chapter 1 of Wuthering Waves on TestChannel!",
);
});
});
describe("checkDescriptionWarning", () => {
it("returns null for description under limit", () => {
expect(checkDescriptionWarning("Short description")).toBeNull();
+227
View File
@@ -0,0 +1,227 @@
import { describe, it, expect } from "vitest";
import { buildPinnedComment } from "@engine/pinned-comment-builder";
import { createMockT } from "../helpers/mock-t";
import type { GeneratorInput, TranslationFn } from "@engine/types";
function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "part",
language: "en",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
spoilerWarning: false,
matureWarning: false,
storeLinks: {},
social: {},
rig: {},
...overrides,
};
}
describe("buildPinnedComment", () => {
it("generates a non-empty string for the default `part` video type", () => {
const t = createMockT("en");
const result = buildPinnedComment(makeInput(), t);
expect(result).not.toBe("");
expect(result).toContain("Welcome back to Elden Ring on TestChannel");
expect(result).toContain("Thanks for watching");
expect(result).toContain("like & subscribe");
expect(result).toContain("What game should I play next?");
});
it("uses the livestream-specific greeting when videoType is livestream", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ videoType: "livestream", gameName: "Elden Ring" }),
t,
);
expect(result).toContain("Welcome to the stream of Elden Ring");
expect(result).toContain("Drop a hello in the chat");
});
it("includes the genre-playlist suggestion when option + URL + label all present", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ genres: ["horror"] }),
t,
{
includeGenrePlaylist: true,
genrePlaylists: {
horror: "https://www.youtube.com/playlist?list=PLhorror",
},
genreLabels: { horror: "Horror" },
},
);
expect(result).toContain(
"📺 More Horror gameplay on the channel: https://www.youtube.com/playlist?list=PLhorror",
);
});
it("omits the genre-playlist line when the option is off", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ genres: ["horror"] }),
t,
{
includeGenrePlaylist: false,
genrePlaylists: {
horror: "https://www.youtube.com/playlist?list=PLhorror",
},
genreLabels: { horror: "Horror" },
},
);
expect(result).not.toContain("More Horror gameplay");
});
it("omits the genre-playlist line when no URL is configured for the primary genre", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ genres: ["rpg"] }),
t,
{
includeGenrePlaylist: true,
genrePlaylists: {
horror: "https://www.youtube.com/playlist?list=PLhorror",
},
genreLabels: { horror: "Horror", rpg: "RPG" },
},
);
expect(result).not.toContain("More");
expect(result).not.toContain("playlist?list=PLhorror");
});
it("uses the primary (first) genre, ignoring secondary genres", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ genres: ["action", "horror"] }),
t,
{
includeGenrePlaylist: true,
genrePlaylists: {
action: "https://www.youtube.com/playlist?list=PLaction",
horror: "https://www.youtube.com/playlist?list=PLhorror",
},
genreLabels: { action: "Action", horror: "Horror" },
},
);
expect(result).toContain("More Action gameplay");
expect(result).not.toContain("More Horror gameplay");
});
it("interpolates localized game name when present", () => {
const t = createMockT("ja");
const result = buildPinnedComment(
makeInput({
language: "ja",
gameName: "Elden Ring",
gameNameLocalized: { ja: "エルデンリング" },
}),
t,
);
expect(result).toContain("エルデンリング");
expect(result).not.toContain("Elden Ring の");
});
it("includes the playlistPrompt line when playlistLink is set", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ playlistLink: "https://youtube.com/playlist?list=abc" }),
t,
);
expect(result).toContain("Watch the full series here");
expect(result).toContain("https://youtube.com/playlist?list=abc");
});
it("omits the playlistPrompt line when playlistLink is empty", () => {
const t = createMockT("en");
const result = buildPinnedComment(makeInput(), t);
expect(result).not.toContain("Watch the full series");
});
it("omits the playlistPrompt line when includePlaylistLink is false", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ playlistLink: "https://youtube.com/playlist?list=abc" }),
t,
{ includePlaylistLink: false },
);
expect(result).not.toContain("Watch the full series");
});
it("omits the askNextGame line when includeAskNextGame is false", () => {
const t = createMockT("en");
const result = buildPinnedComment(makeInput(), t, {
includeAskNextGame: false,
});
expect(result).not.toContain("What game should I play next?");
// Other lines still present:
expect(result).toContain("Thanks for watching");
});
it("picks the per-video-type greeting when available", () => {
const t = createMockT("en");
const bossResult = buildPinnedComment(makeInput({ videoType: "boss" }), t);
const speedrunResult = buildPinnedComment(
makeInput({ videoType: "speedrun" }),
t,
);
expect(bossResult).toContain("boss was a ride");
expect(speedrunResult).toContain("Speedrun attempt complete");
});
it("falls back to the `part` greeting when the per-type key is missing", () => {
// Custom mock that only defines the `part` greeting, mimicking a
// future video type the locale hasn't added yet.
const sparseT: TranslationFn = (key, vars) => {
if (key === "pinnedComment.greetings.part") {
return `Welcome back to ${vars?.gameName ?? ""}.`;
}
if (key === "pinnedComment.thanksForWatching") return "Thanks!";
if (key === "pinnedComment.engagementPrompt") return "Like & subscribe.";
if (key === "pinnedComment.askNextGame") return "Next game?";
return key;
};
const result = buildPinnedComment(
makeInput({ videoType: "boss_nohit", gameName: "Sekiro" }),
sparseT,
);
expect(result).toContain("Welcome back to Sekiro.");
expect(result).toContain("Thanks!");
});
it("drops the greeting line entirely when neither the per-type key nor the fallback exists", () => {
// Mock that returns the key (mock-t's signal for missing) for every
// greeting key but still provides the non-greeting lines.
const noGreetingT: TranslationFn = (key) => {
if (key === "pinnedComment.thanksForWatching") return "Thanks!";
if (key === "pinnedComment.engagementPrompt") return "Like & subscribe.";
if (key === "pinnedComment.askNextGame") return "Next game?";
return key;
};
const result = buildPinnedComment(
makeInput({ videoType: "part" }),
noGreetingT,
);
// Ensure no raw "pinnedComment.greetings.…" key leaks into the
// output — we drop the line rather than render the key.
expect(result).not.toContain("pinnedComment.greetings");
expect(result).toContain("Thanks!");
});
it("interpolates channelName into the part greeting", () => {
const t = createMockT("en");
const result = buildPinnedComment(
makeInput({ channelName: "NoCommentarySan" }),
t,
);
expect(result).toContain("NoCommentarySan");
});
it("returns empty string when every sub-key is missing", () => {
const emptyT: TranslationFn = (key) => key; // every lookup "fails"
const result = buildPinnedComment(makeInput(), emptyT);
expect(result).toBe("");
});
});
+41
View File
@@ -0,0 +1,41 @@
import { describe, it, expect } from "vitest";
import { formatRigValue, RIG_FIELDS } from "@config/rig-fields";
describe("formatRigValue", () => {
it("passes text fields through unchanged", () => {
expect(formatRigValue("cpu", "Ryzen 9 7950X")).toBe("Ryzen 9 7950X");
});
it("formats dropdown_with_version with both parts", () => {
expect(formatRigValue("video_editor", "davinci_resolve_studio|19.1")).toBe(
"DaVinci Resolve Studio 19.1",
);
});
it("formats dropdown_with_version with no version", () => {
expect(formatRigValue("video_editor", "capcut|")).toBe("CapCut");
});
it("formats dropdown_with_version with only version", () => {
// Only a version with an empty option renders just the version —
// this is technically malformed input but we shouldn't crash.
expect(formatRigValue("video_editor", "|1.0")).toBe("1.0");
});
it("returns empty string when the whole value is blank", () => {
expect(formatRigValue("video_editor", "")).toBe("");
expect(formatRigValue("video_editor", "|")).toBe("");
});
it("falls back to the raw option id when unknown", () => {
expect(formatRigValue("video_editor", "unknown_tool|1.0")).toBe(
"unknown_tool 1.0",
);
});
it("includes a video_editor entry in RIG_FIELDS", () => {
const field = RIG_FIELDS.find((f) => f.id === "video_editor");
expect(field?.type).toBe("dropdown_with_version");
expect(field?.options?.length).toBeGreaterThan(3);
});
});
+135 -9
View File
@@ -1,12 +1,16 @@
import { describe, it, expect } from "vitest";
import { generateTags, formatTagString } from "@engine/tag-generator";
import {
generateTags,
formatTagString,
tagFriendlyGameName,
} from "@engine/tag-generator";
import type { GeneratorInput } from "@engine/types";
function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -28,17 +32,17 @@ describe("generateTags", () => {
});
it("includes genre-specific tags for action", () => {
const tags = generateTags(makeInput({ genre: "action" }));
const tags = generateTags(makeInput({ genres: ["action"] }));
expect(tags.some((t) => t.toLowerCase().includes("action"))).toBe(true);
});
it("includes genre-specific tags for horror", () => {
const tags = generateTags(makeInput({ genre: "horror" }));
const tags = generateTags(makeInput({ genres: ["horror"] }));
expect(tags.some((t) => t.toLowerCase().includes("horror"))).toBe(true);
});
it("includes genre-specific tags for rpg", () => {
const tags = generateTags(makeInput({ genre: "rpg" }));
const tags = generateTags(makeInput({ genres: ["rpg"] }));
expect(tags.some((t) => t.toLowerCase().includes("rpg"))).toBe(true);
});
@@ -47,19 +51,66 @@ describe("generateTags", () => {
expect(tags.some((t) => t.toLowerCase().includes("boss"))).toBe(true);
});
it("includes video type tags for mods", () => {
const tags = generateTags(makeInput({ videoType: "mods" }));
expect(tags.some((t) => t.toLowerCase().includes("mod"))).toBe(true);
expect(tags).toContain("modded gameplay no commentary");
});
it("includes video type tags for collectibles", () => {
const tags = generateTags(makeInput({ videoType: "collectibles" }));
expect(tags.some((t) => t.toLowerCase().includes("collectibles"))).toBe(true);
expect(tags).toContain("Elden Ring all collectibles");
});
it("includes video type tags for livestream", () => {
const tags = generateTags(makeInput({ videoType: "livestream" }));
expect(tags).toContain("livestream");
expect(tags).toContain("live gameplay");
expect(tags.some((t) => /elden ring (live|stream)/i.test(t))).toBe(true);
});
it("humanises snake_case genres in trending tags (fixes visual_novel leak)", () => {
const tags = generateTags(
makeInput({ genres: ["visual_novel"] }),
{ includeTrendingTags: true },
);
// No tag should contain the raw underscore form
expect(tags.every((t) => !t.includes("visual_novel"))).toBe(true);
// The humanised form should be present in the trending tags
const year = new Date().getFullYear().toString();
expect(tags.some((t) => t === `best visual novel games ${year}`)).toBe(true);
expect(tags.some((t) => t === `visual novel gameplay ${year}`)).toBe(true);
});
it("includes video type tags for speedrun", () => {
const tags = generateTags(makeInput({ videoType: "speedrun" }));
expect(tags.some((t) => t.toLowerCase().includes("speedrun"))).toBe(true);
});
it("includes multilingual tags (Japanese)", () => {
const tags = generateTags(makeInput());
it("includes multilingual tags only for the selected language (Japanese)", () => {
const tags = generateTags(makeInput({ language: "ja" }));
expect(tags.some((t) => t.includes("ゲームプレイ"))).toBe(true);
// Should NOT leak other languages
expect(tags.some((t) => t.includes("không bình luận"))).toBe(false);
expect(tags.some((t) => t.includes("게임플레이"))).toBe(false);
});
it("includes multilingual tags (Vietnamese)", () => {
const tags = generateTags(makeInput());
it("includes multilingual tags only for the selected language (Vietnamese)", () => {
const tags = generateTags(makeInput({ language: "vi" }));
expect(tags.some((t) => t.includes("không bình luận"))).toBe(true);
expect(tags.some((t) => t.includes("ゲームプレイ"))).toBe(false);
expect(tags.some((t) => t.includes("游戏实况"))).toBe(false);
});
it("includes visual novel tags for visual_novel genre", () => {
const tags = generateTags(makeInput({ genres: ["visual_novel"] }));
expect(tags.some((t) => t.toLowerCase().includes("visual novel"))).toBe(true);
});
it("includes full_demo tags for full_demo video type", () => {
const tags = generateTags(makeInput({ videoType: "full_demo" }));
expect(tags.some((t) => t.toLowerCase().includes("demo"))).toBe(true);
});
it("has no duplicate tags (case-insensitive)", () => {
@@ -103,3 +154,78 @@ describe("formatTagString", () => {
expect(formatTagString([])).toBe("");
});
});
describe("tagFriendlyGameName", () => {
it("returns the input unchanged when it already fits", () => {
expect(tagFriendlyGameName("Elden Ring", 30)).toBe("Elden Ring");
});
it("strips a trailing 'Definitive Edition' qualifier", () => {
expect(tagFriendlyGameName("Some Game: Definitive Edition", 30)).toBe(
"Some Game",
);
});
it("iteratively strips multiple trailing qualifiers", () => {
expect(
tagFriendlyGameName(
"Tony Hawk's Pro Skater 1+2 Remastered: Definitive Edition",
30,
),
).toBe("Tony Hawk's Pro Skater 1+2");
});
it("strips trademark marks", () => {
expect(tagFriendlyGameName("Halo™ Infinite", 30)).toBe("Halo Infinite");
});
it("falls back to the head before a colon when stripping qualifiers isn't enough", () => {
expect(
tagFriendlyGameName(
"A Very Long Subtitle: That Keeps Going Forever Indeed",
25,
),
).toBe("A Very Long Subtitle");
});
it("falls back to leading-words truncation for unstoppably long names", () => {
expect(
tagFriendlyGameName(
"An Extremely Verbose Name Without Any Qualifiers Whatsoever",
20,
),
).toBe("An Extremely Verbose");
});
});
describe("generateTags — long game names (regression for v0.7 silent drop)", () => {
it("includes a friendly form of long game names in the tag list", () => {
const longName =
"Tony Hawk's Pro Skater 1+2 Remastered: Definitive Edition";
const tags = generateTags(makeInput({ gameName: longName }));
const lowered = tags.map((t) => t.toLowerCase());
// Some form of the game name appears
expect(lowered.some((t) => t.includes("tony hawk"))).toBe(true);
// At least one composite mentions the friendly name
expect(lowered.some((t) => /tony hawk.*gameplay/.test(t))).toBe(true);
// Per-tag char limit is still respected
expect(tags.every((t) => t.length <= 30)).toBe(true);
});
it("preserves the original full game name when it fits ≤ 30 chars", () => {
const tags = generateTags(makeInput({ gameName: "Elden Ring" }));
expect(tags).toContain("Elden Ring");
});
it("emits both the long-form bare tag and the short composite form", () => {
// Bare-name budget = 30, compose budget = 21. A 25-char name falls
// between these so the two friendly forms differ.
const longName = "Some Lengthy Game Title XX"; // 26 chars, no qualifier match
const tags = generateTags(makeInput({ gameName: longName }));
expect(tags).toContain(longName);
// Composite must be present and ≤ 30 chars
expect(tags.some((t) => /gameplay/i.test(t))).toBe(true);
expect(tags.every((t) => t.length <= 30)).toBe(true);
});
});
+132
View File
@@ -0,0 +1,132 @@
import { describe, it, expect } from "vitest";
import { parseTimeline, renderTimeline } from "@engine/timeline-parser";
import type { TranslationFn } from "@engine/types";
// Minimal translation lookup keyed by (language, keyword id).
// Mirrors the shape of the real templates.json entries.
const DICT: Record<string, Record<string, string>> = {
en: {
chapter: "Chapter {{n}}",
part: "Part {{n}}",
boss: "Boss {{n}}",
final_boss: "Final Boss",
intro: "Intro",
ending: "Ending",
tutorial: "Tutorial",
credits: "Credits",
},
vi: {
chapter: "Chương {{n}}",
part: "Phần {{n}}",
boss: "Boss {{n}}",
final_boss: "Boss cuối",
intro: "Mở đầu",
ending: "Kết thúc",
tutorial: "Hướng dẫn",
credits: "Credits",
},
ja: {
chapter: "第{{n}}章",
part: "パート{{n}}",
boss: "ボス{{n}}",
final_boss: "ラスボス",
intro: "オープニング",
ending: "エンディング",
tutorial: "チュートリアル",
credits: "クレジット",
},
};
function makeT(lang: "en" | "vi" | "ja"): TranslationFn {
return (key, opts) => {
const id = key.replace("timeline.keywords.", "");
const template = DICT[lang][id] ?? id;
if (!opts) return template;
return template.replace(/\{\{(\w+)\}\}/g, (_, k) => opts[k] ?? "");
};
}
describe("parseTimeline", () => {
it("parses time + label into entries", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n15:00 Boss 2");
expect(entries).toHaveLength(3);
expect(entries[0].time).toBe("0:00");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("chapter");
expect(entries[1].number).toBe(1);
expect(entries[2].keyword).toBe("boss");
expect(entries[2].number).toBe(2);
});
it("supports HH:MM:SS timecodes", () => {
const entries = parseTimeline("1:23:45 Chapter 7");
expect(entries[0].time).toBe("1:23:45");
expect(entries[0].keyword).toBe("chapter");
expect(entries[0].number).toBe(7);
});
it("recognizes final boss before boss", () => {
const entries = parseTimeline("10:00 Final Boss");
expect(entries[0].keyword).toBe("final_boss");
});
it("recognizes Vietnamese keywords", () => {
const entries = parseTimeline("0:00 Mở đầu\n5:00 Chương 3\n20:00 Boss cuối");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("chapter");
expect(entries[1].number).toBe(3);
expect(entries[2].keyword).toBe("final_boss");
});
it("recognizes Japanese keywords", () => {
const entries = parseTimeline("0:00 オープニング\n5:00 パート 2\n20:00 ラスボス");
expect(entries[0].keyword).toBe("intro");
expect(entries[1].keyword).toBe("part");
expect(entries[1].number).toBe(2);
expect(entries[2].keyword).toBe("final_boss");
});
it("preserves lines that don't match a known keyword", () => {
const entries = parseTimeline("0:00 Random Stuff");
expect(entries[0].time).toBe("0:00");
expect(entries[0].keyword).toBeUndefined();
expect(entries[0].rawLabel).toBe("Random Stuff");
});
it("preserves lines without a time prefix", () => {
const entries = parseTimeline("Just a note");
expect(entries[0].time).toBe("");
expect(entries[0].rawLabel).toBe("Just a note");
});
it("skips blank lines", () => {
const entries = parseTimeline("\n0:00 Intro\n\n5:00 Chapter 1\n");
expect(entries).toHaveLength(2);
});
});
describe("renderTimeline", () => {
it("translates English input to Vietnamese", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2\n20:00 Final Boss");
const out = renderTimeline(entries, "vi", makeT("vi"));
expect(out).toBe("0:00 Mở đầu\n5:30 Chương 1\n10:00 Boss 2\n20:00 Boss cuối");
});
it("translates English input to Japanese", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1");
const out = renderTimeline(entries, "ja", makeT("ja"));
expect(out).toBe("0:00 オープニング\n5:30 第1章");
});
it("keeps unrecognized labels verbatim", () => {
const entries = parseTimeline("0:00 Intro\n7:00 Random Stuff");
const out = renderTimeline(entries, "vi", makeT("vi"));
expect(out).toBe("0:00 Mở đầu\n7:00 Random Stuff");
});
it("renders English (identity) correctly", () => {
const entries = parseTimeline("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2");
const out = renderTimeline(entries, "en", makeT("en"));
expect(out).toBe("0:00 Intro\n5:30 Chapter 1\n10:00 Boss 2");
});
});
+364 -3
View File
@@ -1,13 +1,18 @@
import { describe, it, expect } from "vitest";
import { buildTitle, checkTitleWarning } from "@engine/title-builder";
import {
buildTitle,
buildQualityBadge,
buildGachaPartSuffix,
checkTitleWarning,
} from "@engine/title-builder";
import { createMockT } from "../helpers/mock-t";
import type { GeneratorInput } from "@engine/types";
import type { GeneratorInput, TranslationFn } from "@engine/types";
function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "full",
language: "en",
genre: "action",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
@@ -33,6 +38,12 @@ describe("buildTitle", () => {
expect(result).toBe("Elden Ring — Part 5 — Gameplay No Commentary");
});
it("renders livestream type with the 🔴 LIVE label", () => {
const t = createMockT("en");
const result = buildTitle(makeInput({ videoType: "livestream" }), t);
expect(result).toBe("Elden Ring — 🔴 LIVE — Gameplay No Commentary");
});
it("generates boss title with boss name", () => {
const t = createMockT("en");
const result = buildTitle(
@@ -100,6 +111,356 @@ describe("buildTitle", () => {
const result = buildTitle(input, t);
expect(result).toBe("エルデンリング — Gameplay No Commentary");
});
it("appends quality badge after the video-type segment", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "5", resolution: "1440p", fps: "60" }),
t,
);
expect(result).toBe("Elden Ring — Part 5 [2K] — Gameplay No Commentary");
});
it("includes resolution alongside non-default FPS for clarity", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "1", resolution: "1080p", fps: "120" }),
t,
);
expect(result).toBe("Elden Ring — Part 1 [1080p 120FPS] — Gameplay No Commentary");
});
it("combines resolution and FPS when both are non-default", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ resolution: "4K", fps: "120" }),
t,
);
// videoType "full" renders empty, so the badge becomes its own segment
expect(result).toBe("Elden Ring — [4K 120FPS] — Gameplay No Commentary");
});
it("omits the quality badge at defaults", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "part", partNumber: "2", resolution: "1080p", fps: "60" }),
t,
);
expect(result).toBe("Elden Ring — Part 2 — Gameplay No Commentary");
});
it("respects the showQualityBadge flag", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "boss", bossName: "Margit", resolution: "4K", fps: "60" }),
t,
false,
);
expect(result).toBe("Elden Ring — Margit Boss Fight — Gameplay No Commentary");
});
it("renders mods video type with mod name", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({ videoType: "mods", modName: "Requiem" }),
t,
);
expect(result).toBe("Elden Ring — Requiem Mods — Gameplay No Commentary");
});
it("renders collectibles video type", () => {
const t = createMockT("en");
const result = buildTitle(makeInput({ videoType: "collectibles" }), t);
expect(result).toBe("Elden Ring — All Collectibles — Gameplay No Commentary");
});
});
describe("buildTitle — gacha_quest video type (v0.9)", () => {
it("composes a Main Story title with chapter + part suffix", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "main_story",
gameName: "Genshin Impact",
chapterName: "Chapter 5 Act 2: Where the Stars Fall",
partNumber: "5",
}),
t,
);
expect(result).toBe(
"Genshin Impact — Chapter 5 Act 2: Where the Stars Fall - Part 5 — Gameplay No Commentary",
);
});
it("drops the part suffix when partNumber is empty for main_story", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "main_story",
gameName: "Honkai: Star Rail",
chapterName: "Penacony 2.0",
}),
t,
);
expect(result).toBe(
"Honkai: Star Rail — Penacony 2.0 — Gameplay No Commentary",
);
});
it("composes a World Quest title using questName", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "world_quest",
gameName: "Genshin Impact",
questName: "A Solitary Constellation",
}),
t,
);
expect(result).toBe(
"Genshin Impact — World Quest: A Solitary Constellation — Gameplay No Commentary",
);
});
it("uses the day suffix style for anniversary", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "anniversary",
gameName: "Honkai Impact 3rd",
chapterName: "7th",
partNumber: "3",
}),
t,
);
expect(result).toBe(
"Honkai Impact 3rd — 7th Anniversary - Day 3 — Gameplay No Commentary",
);
});
it("uses the floor suffix style for endgame", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "endgame",
gameName: "Genshin Impact",
chapterName: "Spiral Abyss",
partNumber: "12",
}),
t,
);
expect(result).toBe(
"Genshin Impact — Spiral Abyss - Floor 12 — Gameplay No Commentary",
);
});
it("falls back to main_story when gachaQuestType is missing", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gameName: "Wuthering Waves",
chapterName: "Chapter 1",
}),
t,
);
expect(result).toBe(
"Wuthering Waves — Chapter 1 — Gameplay No Commentary",
);
});
it("renders the badge as its own middle segment (videoTypeLabel is empty)", () => {
const t = createMockT("en");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "world_quest",
gameName: "Genshin Impact",
questName: "A Solitary Constellation",
resolution: "1440p",
}),
t,
);
// Gacha titles bypass `videoTypeLabel`, so a non-default badge in
// the default "middle" position lands between the gacha head and
// the standard suffix as its own segment — same shape that "full"
// 4K runs use today.
expect(result).toBe(
"Genshin Impact — World Quest: A Solitary Constellation — [2K] — Gameplay No Commentary",
);
});
it("Vietnamese title uses translated quest type prefix and partSuffix", () => {
const t = createMockT("vi");
const result = buildTitle(
makeInput({
videoType: "gacha_quest",
gachaQuestType: "main_story",
gameName: "Genshin Impact",
chapterName: "Chương 5 Hồi 2",
partNumber: "5",
language: "vi",
}),
t,
);
expect(result).toBe(
"Genshin Impact — Chương 5 Hồi 2 - Phần 5 — Gameplay No Commentary",
);
});
});
describe("buildGachaPartSuffix", () => {
it("renders Part N for the part style", () => {
const t = createMockT("en");
expect(buildGachaPartSuffix("main_story", "7", t)).toBe(" - Part 7");
});
it("renders Day N for the day style (daily_commission)", () => {
const t = createMockT("en");
expect(buildGachaPartSuffix("daily_commission", "3", t)).toBe(" - Day 3");
});
it("renders Floor N for the floor style (endgame)", () => {
const t = createMockT("en");
expect(buildGachaPartSuffix("endgame", "12", t)).toBe(" - Floor 12");
});
it("returns empty for the none style (world_quest)", () => {
const t = createMockT("en");
expect(buildGachaPartSuffix("world_quest", "5", t)).toBe("");
});
it("returns empty when partNumber is blank", () => {
const t = createMockT("en");
expect(buildGachaPartSuffix("main_story", "", t)).toBe("");
expect(buildGachaPartSuffix("main_story", " ", t)).toBe("");
expect(buildGachaPartSuffix("main_story", undefined, t)).toBe("");
});
});
describe("buildTitle with options bag (v0.7 title-format)", () => {
const baseInput = (): Parameters<typeof makeInput>[0] => ({
videoType: "part",
partNumber: "5",
resolution: "1440p",
fps: "60",
});
it("defaults (no opts) match v0.6 behaviour byte-for-byte", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, {});
expect(result).toBe("Elden Ring — Part 5 [2K] — Gameplay No Commentary");
});
it("prefix position puts the badge before the game name", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, { badgePosition: "prefix" });
expect(result).toBe("[2K] Elden Ring — Part 5 — Gameplay No Commentary");
});
it("suffix position puts the badge before the tail", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, { badgePosition: "suffix" });
expect(result).toBe("Elden Ring — Part 5 — [2K] Gameplay No Commentary");
});
it("lower-case badge writes [2k] instead of [2K]", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, {
badgePosition: "prefix",
badgeCase: "lower",
});
expect(result).toBe("[2k] Elden Ring — Part 5 — Gameplay No Commentary");
});
it("hyphen separator renders ` - ` between segments", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, {
badgePosition: "prefix",
separator: "hyphen",
badgeCase: "lower",
});
expect(result).toBe("[2k] Elden Ring - Part 5 - Gameplay No Commentary");
});
it("colon separator survives multi-char joins", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, { separator: "colon" });
expect(result).toBe("Elden Ring: Part 5 [2K]: Gameplay No Commentary");
});
it("pipe separator renders ` | `", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, { separator: "pipe" });
expect(result).toBe("Elden Ring | Part 5 [2K] | Gameplay No Commentary");
});
it("empty badge collapses all three positions to identical output", () => {
const t = createMockT("en");
const input = makeInput({ videoType: "part", partNumber: "5", resolution: "1080p", fps: "60" });
const prefix = buildTitle(input, t, { badgePosition: "prefix" });
const middle = buildTitle(input, t, { badgePosition: "middle" });
const suffix = buildTitle(input, t, { badgePosition: "suffix" });
const expected = "Elden Ring — Part 5 — Gameplay No Commentary";
expect(prefix).toBe(expected);
expect(middle).toBe(expected);
expect(suffix).toBe(expected);
});
it("falls back to legacy title.separator when the id-keyed form is missing", () => {
// Mimic a locale that hasn't migrated to the new separators block:
// only expose `title.separator` and `title.suffix`, plus the minimum
// video-type keys needed for the assertion.
const legacyT: TranslationFn = (key, vars) => {
if (key === "title.separator") return " >>> ";
if (key === "title.suffix") return "Gameplay No Commentary";
if (key === "title.videoType.part") return `Part ${vars?.partNumber ?? ""}`;
// Everything else (including `title.separators.*`) returns the key
// itself, which the builder must detect and fall back on.
return key;
};
const result = buildTitle(makeInput(baseInput()), legacyT, { separator: "hyphen" });
expect(result).toBe("Elden Ring >>> Part 5 [2K] >>> Gameplay No Commentary");
});
it("legacy boolean third arg still suppresses the badge", () => {
const t = createMockT("en");
const result = buildTitle(makeInput(baseInput()), t, false);
expect(result).toBe("Elden Ring — Part 5 — Gameplay No Commentary");
});
});
describe("buildQualityBadge", () => {
it("returns empty at defaults (1080p 60fps)", () => {
expect(buildQualityBadge("1080p", "60")).toBe("");
});
it("maps 1440p to 2K", () => {
expect(buildQualityBadge("1440p", "60")).toBe("2K");
});
it("keeps 720p and 4K as-is", () => {
expect(buildQualityBadge("720p", "60")).toBe("720p");
expect(buildQualityBadge("4K", "60")).toBe("4K");
});
it("joins resolution and non-default FPS", () => {
expect(buildQualityBadge("4K", "120")).toBe("4K 120FPS");
expect(buildQualityBadge("1440p", "144")).toBe("2K 144FPS");
});
it("includes default resolution when only FPS is non-default", () => {
expect(buildQualityBadge("1080p", "120")).toBe("1080p 120FPS");
});
it("falls back to defaults when inputs are undefined", () => {
expect(buildQualityBadge(undefined, undefined)).toBe("");
});
});
describe("checkTitleWarning", () => {
+79
View File
@@ -0,0 +1,79 @@
import { describe, it, expect } from "vitest";
import { buildTitleVariants } from "@engine/title-variants";
import { createMockT } from "../helpers/mock-t";
import type { GeneratorInput } from "@engine/types";
function makeInput(overrides: Partial<GeneratorInput> = {}): GeneratorInput {
return {
videoType: "part",
language: "en",
genres: ["action"],
gameName: "Elden Ring",
channelName: "TestChannel",
platform: "steam",
partNumber: "1",
resolution: "1440p",
fps: "60",
spoilerWarning: false,
matureWarning: false,
storeLinks: {},
social: {},
rig: {},
...overrides,
};
}
describe("buildTitleVariants", () => {
it("returns exactly 3 variants with the expected ids", () => {
const t = createMockT("en");
const variants = buildTitleVariants(makeInput(), t);
expect(variants).toHaveLength(3);
expect(variants.map((v) => v.id)).toEqual(["default", "typeFirst", "qualityFirst"]);
});
it("default variant matches the primary buildTitle output", () => {
const t = createMockT("en");
const [defaultVariant] = buildTitleVariants(makeInput(), t);
expect(defaultVariant!.title).toBe("Elden Ring — Part 1 [2K] — Gameplay No Commentary");
});
it("typeFirst swaps game name and video type, keeps badge on game", () => {
const t = createMockT("en");
const [, typeFirst] = buildTitleVariants(makeInput(), t);
expect(typeFirst!.title).toBe("Part 1 — Elden Ring [2K] — Gameplay No Commentary");
});
it("qualityFirst puts the badge at the start", () => {
const t = createMockT("en");
const [, , qualityFirst] = buildTitleVariants(makeInput(), t);
expect(qualityFirst!.title).toBe("[2K] Elden Ring — Part 1 — Gameplay No Commentary");
});
it("drops the badge entirely when showQualityBadge is false", () => {
const t = createMockT("en");
const variants = buildTitleVariants(makeInput(), t, false);
for (const v of variants) {
expect(v.title).not.toContain("[");
}
});
it("qualityFirst falls back to default when the badge is empty (1080p 60fps)", () => {
const t = createMockT("en");
const variants = buildTitleVariants(
makeInput({ resolution: "1080p", fps: "60" }),
t,
);
const defaultTitle = variants.find((v) => v.id === "default")!.title;
const qualityFirstTitle = variants.find((v) => v.id === "qualityFirst")!.title;
expect(qualityFirstTitle).toBe(defaultTitle);
});
it("renders the mod name in the type-first variant", () => {
const t = createMockT("en");
const [, typeFirst] = buildTitleVariants(
makeInput({ videoType: "mods", modName: "Requiem", resolution: "1080p", fps: "60" }),
t,
);
expect(typeFirst!.title).toContain("Requiem Mods");
});
});
+77
View File
@@ -0,0 +1,77 @@
import { describe, it, expect } from "vitest";
import { legacyGraphicsPresetToEnum } from "@store/editor-store";
describe("legacyGraphicsPresetToEnum (v4 → v5 graphicsPreset migration)", () => {
it("maps the canonical defaults that were the seeded v0.7 placeholder", () => {
expect(legacyGraphicsPresetToEnum("Ultra")).toEqual({
preset: "ultra",
custom: "",
});
});
it("is case-insensitive", () => {
expect(legacyGraphicsPresetToEnum("MEDIUM")).toEqual({
preset: "medium",
custom: "",
});
expect(legacyGraphicsPresetToEnum("high")).toEqual({
preset: "high",
custom: "",
});
});
it("maps multi-word labels like 'Very High' to their snake_case enum", () => {
expect(legacyGraphicsPresetToEnum("Very High")).toEqual({
preset: "very_high",
custom: "",
});
expect(legacyGraphicsPresetToEnum("very high")).toEqual({
preset: "very_high",
custom: "",
});
});
it("maps 'Cinematic' / 'Extreme' / 'Low'", () => {
expect(legacyGraphicsPresetToEnum("Cinematic")).toEqual({
preset: "cinematic",
custom: "",
});
expect(legacyGraphicsPresetToEnum("Extreme")).toEqual({
preset: "extreme",
custom: "",
});
expect(legacyGraphicsPresetToEnum("Low")).toEqual({
preset: "low",
custom: "",
});
});
it("routes unrecognised labels into the Custom slot", () => {
expect(legacyGraphicsPresetToEnum("Epic")).toEqual({
preset: "custom",
custom: "Epic",
});
expect(legacyGraphicsPresetToEnum("Maximum")).toEqual({
preset: "custom",
custom: "Maximum",
});
});
it("trims whitespace before lookup", () => {
expect(legacyGraphicsPresetToEnum(" Ultra ")).toEqual({
preset: "ultra",
custom: "",
});
});
it("falls back to the Medium default when the legacy value is empty", () => {
expect(legacyGraphicsPresetToEnum("")).toEqual({
preset: "medium",
custom: "",
});
expect(legacyGraphicsPresetToEnum(" ")).toEqual({
preset: "medium",
custom: "",
});
});
});
+208
View File
@@ -0,0 +1,208 @@
import { describe, it, expect } from "vitest";
import { healSettings } from "@store/settings-heal";
describe("healSettings", () => {
it("returns a full defaults object when given null / undefined / non-object input", () => {
const fromNull = healSettings(null);
const fromUndefined = healSettings(undefined);
const fromString = healSettings("not an object");
// All three should have the full required shape with default-ish values.
for (const healed of [fromNull, fromUndefined, fromString]) {
expect(healed.theme).toBe("dark");
expect(healed.showCharCount).toBe(true);
expect(healed.compactTagDisplay).toBe(false);
expect(healed.hashtagCount).toBe(3);
expect(healed.showQualityBadge).toBe(true);
expect(healed.showCopyright).toBe(true);
expect(healed.showUsagePolicy).toBe(false);
expect(healed.defaultGenres).toEqual(["action"]);
expect(healed.titleFormat).toEqual({
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
});
expect(healed.showPinnedCommentTemplate).toBe(false);
expect(healed.pinnedCommentIncludeAskNextGame).toBe(true);
expect(healed.editorAccordionState).toEqual(
expect.objectContaining({ gameInfo: true }),
);
}
});
it("back-fills missing keys with defaults but keeps user-set values", () => {
const healed = healSettings({
theme: "light",
hashtagCount: 1,
// showCharCount, compactTagDisplay, etc. all missing
});
expect(healed.theme).toBe("light");
expect(healed.hashtagCount).toBe(1);
// Back-filled:
expect(healed.showCharCount).toBe(true);
expect(healed.compactTagDisplay).toBe(false);
expect(healed.showQualityBadge).toBe(true);
expect(healed.editorAccordionState).toBeDefined();
});
it("strips the removed `autoSaveDraft` key even if persisted", () => {
const healed = healSettings({ autoSaveDraft: true, theme: "dark" }) as Record<
string,
unknown
>;
expect(healed.autoSaveDraft).toBeUndefined();
});
it("upgrades the legacy `defaultGenre: string` shape to `defaultGenres: string[]`", () => {
const healed = healSettings({ defaultGenre: "rpg" }) as Record<string, unknown>;
expect(healed.defaultGenre).toBeUndefined();
expect(healed.defaultGenres).toEqual(["rpg"]);
});
it("keeps explicit `defaultGenres` when both legacy and new keys are present", () => {
const healed = healSettings({
defaultGenre: "rpg",
defaultGenres: ["horror", "action"],
}) as Record<string, unknown>;
expect(healed.defaultGenre).toBeUndefined();
expect(healed.defaultGenres).toEqual(["horror", "action"]);
});
it("preserves all keys when given a complete payload", () => {
const complete = {
appLanguage: "vi" as const,
defaultOutputLanguage: "en" as const,
defaultGenres: ["rpg" as const],
theme: "light" as const,
showCharCount: false,
compactTagDisplay: true,
historyLimit: 50,
includeMultilingualTags: false,
includeTrendingTags: false,
hashtagCount: 2,
showQualityBadge: false,
showCopyright: false,
showUsagePolicy: true,
showSponsorCredit: true,
titleFormat: {
badgePosition: "prefix" as const,
separator: "hyphen" as const,
badgeCase: "lower" as const,
},
showPinnedCommentTemplate: true,
pinnedCommentIncludeAskNextGame: false,
pinnedCommentIncludeGenrePlaylist: true,
genrePlaylists: { horror: "https://www.youtube.com/playlist?list=abc" },
editorAccordionState: { gameInfo: false, videoSettings: true },
};
const healed = healSettings(complete);
expect(healed).toEqual(complete);
});
it("back-fills showSponsorCredit default when the key is absent (v3 → v4 payload)", () => {
// Simulates a settings file written in v0.6 phase 1 where the new
// sponsor toggle hadn't been introduced yet.
const healed = healSettings({
theme: "dark" as const,
showCopyright: true,
});
expect(healed.showSponsorCredit).toBe(false);
});
it("back-fills titleFormat default when the key is absent (v4 → v5 payload)", () => {
// Simulates a settings file written in v0.6 where titleFormat did
// not exist yet.
const healed = healSettings({
theme: "dark" as const,
showCopyright: true,
});
expect(healed.titleFormat).toEqual({
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
});
});
it("merges partial titleFormat, filling missing sub-keys with defaults", () => {
const healed = healSettings({
titleFormat: { badgePosition: "prefix" },
});
// User-set value preserved:
expect(healed.titleFormat.badgePosition).toBe("prefix");
// Missing sub-keys back-filled from defaults:
expect(healed.titleFormat.separator).toBe("emDash");
expect(healed.titleFormat.badgeCase).toBe("upper");
});
it("replaces a non-object titleFormat value with defaults", () => {
// A corrupt on-disk file might have `titleFormat: null` or a string.
const healedFromNull = healSettings({ titleFormat: null });
const healedFromString = healSettings({ titleFormat: "bogus" });
for (const healed of [healedFromNull, healedFromString]) {
expect(healed.titleFormat).toEqual({
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
});
}
});
it("back-fills pinned-comment toggles when the keys are absent (v5 → v6 payload)", () => {
// Simulates a settings file written in v0.7 phase 1, before the
// pinned-comment template feature existed.
const healed = healSettings({
theme: "dark" as const,
titleFormat: {
badgePosition: "middle",
separator: "emDash",
badgeCase: "upper",
},
});
expect(healed.showPinnedCommentTemplate).toBe(false);
expect(healed.pinnedCommentIncludeAskNextGame).toBe(true);
});
it("preserves user-set pinned-comment toggles when they differ from defaults", () => {
const healed = healSettings({
showPinnedCommentTemplate: true,
pinnedCommentIncludeAskNextGame: false,
});
expect(healed.showPinnedCommentTemplate).toBe(true);
expect(healed.pinnedCommentIncludeAskNextGame).toBe(false);
});
it("back-fills genre-playlist defaults when the keys are absent (v6 → v7 payload)", () => {
// Simulates a settings file written in v0.7 phase 2, before the
// pinned-comment genre-playlist feature existed.
const healed = healSettings({
theme: "dark" as const,
showPinnedCommentTemplate: true,
});
expect(healed.pinnedCommentIncludeGenrePlaylist).toBe(false);
expect(healed.genrePlaylists).toEqual({});
});
it("preserves user-set genrePlaylists map", () => {
const healed = healSettings({
genrePlaylists: {
horror: "https://www.youtube.com/playlist?list=horror",
rpg: "https://www.youtube.com/playlist?list=rpg",
},
pinnedCommentIncludeGenrePlaylist: true,
});
expect(healed.genrePlaylists).toEqual({
horror: "https://www.youtube.com/playlist?list=horror",
rpg: "https://www.youtube.com/playlist?list=rpg",
});
expect(healed.pinnedCommentIncludeGenrePlaylist).toBe(true);
});
it("replaces a non-object genrePlaylists value with the empty default", () => {
const healedFromNull = healSettings({ genrePlaylists: null });
const healedFromString = healSettings({ genrePlaylists: "bogus" });
for (const healed of [healedFromNull, healedFromString]) {
expect(healed.genrePlaylists).toEqual({});
}
});
});
+69
View File
@@ -0,0 +1,69 @@
import { describe, it, expect } from "vitest";
import { sanitizeHashtag, humanizeId } from "@utils/sanitize";
describe("sanitizeHashtag", () => {
it("drops spaces", () => {
expect(sanitizeHashtag("Elden Ring")).toBe("EldenRing");
});
it("drops periods and colons", () => {
expect(sanitizeHashtag("S.T.A.L.K.E.R. 2")).toBe("STALKER2");
expect(sanitizeHashtag("Yakuza: Like a Dragon")).toBe("YakuzaLikeaDragon");
});
it("drops apostrophes, hyphens, ampersands, parentheses", () => {
expect(sanitizeHashtag("Assassin's Creed")).toBe("AssassinsCreed");
expect(sanitizeHashtag("Spider-Man")).toBe("SpiderMan");
expect(sanitizeHashtag("Sonic & Knuckles")).toBe("SonicKnuckles");
expect(sanitizeHashtag("Prey (2017)")).toBe("Prey2017");
});
it("drops underscores (fixes #visual_novel bug)", () => {
expect(sanitizeHashtag("visual_novel")).toBe("visualnovel");
expect(sanitizeHashtag("survival_craft")).toBe("survivalcraft");
expect(sanitizeHashtag("tower_defense")).toBe("towerdefense");
});
it("keeps digits and letters intact", () => {
expect(sanitizeHashtag("Cyberpunk 2077")).toBe("Cyberpunk2077");
expect(sanitizeHashtag("100% Orange Juice")).toBe("100OrangeJuice");
});
it("preserves non-Latin scripts", () => {
expect(sanitizeHashtag("仁王 2")).toBe("仁王2");
expect(sanitizeHashtag("プレイ動画")).toBe("プレイ動画");
expect(sanitizeHashtag("게임 플레이")).toBe("게임플레이");
});
it("preserves accented characters", () => {
expect(sanitizeHashtag("Pokémon Violet")).toBe("PokémonViolet");
expect(sanitizeHashtag("Café World")).toBe("CaféWorld");
});
it("handles empty input", () => {
expect(sanitizeHashtag("")).toBe("");
expect(sanitizeHashtag(" ")).toBe("");
expect(sanitizeHashtag("!!!")).toBe("");
});
it("drops emojis", () => {
expect(sanitizeHashtag("🎮 Elden Ring 🔥")).toBe("EldenRing");
});
});
describe("humanizeId", () => {
it("replaces underscores with spaces", () => {
expect(humanizeId("visual_novel")).toBe("visual novel");
expect(humanizeId("survival_craft")).toBe("survival craft");
expect(humanizeId("tower_defense")).toBe("tower defense");
});
it("leaves single-word ids untouched", () => {
expect(humanizeId("action")).toBe("action");
expect(humanizeId("rpg")).toBe("rpg");
});
it("handles multiple underscores", () => {
expect(humanizeId("a_b_c_d")).toBe("a b c d");
});
});
+324
View File
@@ -0,0 +1,324 @@
import { describe, it, expect } from "vitest";
import { extractGameNameFromUrl, isLinkNameMismatch } from "@utils/url-extractors";
describe("extractGameNameFromUrl — Steam", () => {
it("extracts and humanises an ALL_CAPS slug", () => {
expect(
extractGameNameFromUrl(
"https://store.steampowered.com/app/1245620/ELDEN_RING/",
),
).toBe("Elden Ring");
});
it("works without a trailing slash", () => {
expect(
extractGameNameFromUrl(
"https://store.steampowered.com/app/1091500/Cyberpunk_2077",
),
).toBe("Cyberpunk 2077");
});
it("preserves hyphens within slug words", () => {
expect(
extractGameNameFromUrl(
"https://store.steampowered.com/app/2358720/Marvels_Spider-Man_Remastered/",
),
).toBe("Marvels Spider-Man Remastered");
});
it("ignores trailing query strings", () => {
expect(
extractGameNameFromUrl(
"https://store.steampowered.com/app/1245620/ELDEN_RING/?utm_source=test",
),
).toBe("Elden Ring");
});
it("returns null when the slug is missing (canonical bare URL)", () => {
expect(
extractGameNameFromUrl("https://store.steampowered.com/app/1245620"),
).toBeNull();
});
});
describe("extractGameNameFromUrl — itch.io", () => {
it("extracts a hyphenated slug from a dev subdomain", () => {
expect(
extractGameNameFromUrl("https://team-cherry.itch.io/hollow-knight"),
).toBe("Hollow Knight");
});
it("works with single-word slugs", () => {
expect(extractGameNameFromUrl("https://maddymakesgames.itch.io/celeste")).toBe(
"Celeste",
);
});
it("returns null for the bare itch.io host", () => {
expect(extractGameNameFromUrl("https://itch.io/games")).toBeNull();
});
it("returns null when no game slug follows the dev subdomain", () => {
expect(extractGameNameFromUrl("https://team-cherry.itch.io/")).toBeNull();
});
});
describe("extractGameNameFromUrl — GOG", () => {
it("extracts a slug from the canonical /game/ path", () => {
expect(
extractGameNameFromUrl("https://www.gog.com/game/cyberpunk_2077"),
).toBe("Cyberpunk 2077");
});
it("supports a locale prefix", () => {
expect(
extractGameNameFromUrl("https://www.gog.com/en/game/baldurs_gate_3"),
).toBe("Baldurs Gate 3");
});
it("returns null for non-game GOG paths", () => {
expect(extractGameNameFromUrl("https://www.gog.com/news/123")).toBeNull();
});
});
describe("extractGameNameFromUrl — Epic Games Store", () => {
it("extracts a slug from a 5-char locale prefix and strips the product hash", () => {
expect(
extractGameNameFromUrl(
"https://store.epicgames.com/en-US/p/lucky-tower-ultimate-aa04de",
),
).toBe("Lucky Tower Ultimate");
});
it("supports a 2-char locale prefix", () => {
expect(
extractGameNameFromUrl(
"https://store.epicgames.com/de/p/alan-wake-2-49e0d3",
),
).toBe("Alan Wake 2");
});
it("works without a trailing product hash", () => {
expect(
extractGameNameFromUrl("https://store.epicgames.com/en-US/p/fortnite"),
).toBe("Fortnite");
});
it("ignores trailing path segments and query strings", () => {
expect(
extractGameNameFromUrl(
"https://store.epicgames.com/en-US/p/control-c14ed6/home?lang=en",
),
).toBe("Control");
});
it("returns null when the locale prefix is missing (bare /p/)", () => {
expect(
extractGameNameFromUrl("https://store.epicgames.com/p/some-game-name"),
).toBeNull();
});
});
describe("extractGameNameFromUrl — Nintendo US", () => {
it("strips the -switch-2 platform suffix", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/us/store/products/mario-tennis-fever-switch-2/",
),
).toBe("Mario Tennis Fever");
});
it("strips a single -switch suffix", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/us/store/products/the-legend-of-zelda-tears-of-the-kingdom-switch",
),
).toBe("The Legend Of Zelda Tears Of The Kingdom");
});
it("works with no platform suffix", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/us/store/products/pikmin-4",
),
).toBe("Pikmin 4");
});
it("ignores trailing query strings", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/us/store/products/animal-crossing-new-horizons-switch?source=share",
),
).toBe("Animal Crossing New Horizons");
});
});
describe("extractGameNameFromUrl — Nintendo EU", () => {
it("strips the trailing numeric id and .html suffix", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/en-gb/Games/Nintendo-Switch-download-software/Teenage-Mutant-Ninja-Turtles-Splintered-Fate-2557953.html",
),
).toBe("Teenage Mutant Ninja Turtles Splintered Fate");
});
it("supports other locale prefixes", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/de-de/Games/Nintendo-Switch/Hollow-Knight-1234567.html",
),
).toBe("Hollow Knight");
});
it("works when the slug carries no numeric id", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/en-gb/Games/Nintendo-Switch/Stardew-Valley.html",
),
).toBe("Stardew Valley");
});
it("returns null for non-Games paths", () => {
expect(
extractGameNameFromUrl(
"https://www.nintendo.com/en-gb/News/2024/December/Update.html",
),
).toBeNull();
});
});
describe("extractGameNameFromUrl — Humble Bundle", () => {
it("extracts a single-word slug", () => {
expect(
extractGameNameFromUrl("https://www.humblebundle.com/store/pragmata"),
).toBe("Pragmata");
});
it("extracts a hyphenated multi-word slug", () => {
expect(
extractGameNameFromUrl(
"https://www.humblebundle.com/store/baldurs-gate-3",
),
).toBe("Baldurs Gate 3");
});
it("ignores trailing query strings", () => {
expect(
extractGameNameFromUrl(
"https://www.humblebundle.com/store/dredge?ref=hp",
),
).toBe("Dredge");
});
it("returns null for non-store Humble paths", () => {
expect(
extractGameNameFromUrl("https://www.humblebundle.com/games"),
).toBeNull();
});
});
describe("extractGameNameFromUrl — unsupported storefronts", () => {
it("returns null for PlayStation Store", () => {
expect(
extractGameNameFromUrl(
"https://store.playstation.com/en-us/product/UP9000-CUSA00000_00-XXXXXXXX",
),
).toBeNull();
});
it("returns null for Xbox", () => {
expect(
extractGameNameFromUrl("https://www.xbox.com/en-us/games/store/foo/12345"),
).toBeNull();
});
it("returns null for Amazon Luna", () => {
expect(
extractGameNameFromUrl("https://www.amazon.com/luna/landing"),
).toBeNull();
});
it("returns null for empty or whitespace input", () => {
expect(extractGameNameFromUrl("")).toBeNull();
expect(extractGameNameFromUrl(" ")).toBeNull();
});
it("returns null for non-store URLs", () => {
expect(extractGameNameFromUrl("https://example.com/whatever")).toBeNull();
});
});
describe("isLinkNameMismatch", () => {
it("returns false when the link's tokens are a subset of the game name's tokens", () => {
expect(
isLinkNameMismatch(
"Marvel's Spider-Man Remastered",
"https://store.steampowered.com/app/1817070/Marvels_Spider-Man_Remastered/",
),
).toBe(false);
});
it("returns false when the game name has extra editorial words around the link slug", () => {
expect(
isLinkNameMismatch(
"Pragmata Pro",
"https://www.humblebundle.com/store/pragmata",
),
).toBe(false);
});
it("returns false on an exact match", () => {
expect(
isLinkNameMismatch(
"Hollow Knight",
"https://team-cherry.itch.io/hollow-knight",
),
).toBe(false);
});
it("returns true when the link points at a completely different game", () => {
expect(
isLinkNameMismatch(
"Pragmata",
"https://store.epicgames.com/en-US/p/lucky-tower-ultimate-aa04de",
),
).toBe(true);
});
it("returns true when the link adds tokens missing from the game name", () => {
expect(
isLinkNameMismatch(
"Spider-Man",
"https://www.humblebundle.com/store/marvels-spider-man-remastered",
),
).toBe(true);
});
it("ignores apostrophes and punctuation when tokenising", () => {
expect(
isLinkNameMismatch(
"Marvel's Spider-Man",
"https://www.humblebundle.com/store/marvels-spider-man",
),
).toBe(false);
});
it("returns false when the URL is not a recognised storefront", () => {
expect(
isLinkNameMismatch("Pragmata", "https://example.com/whatever"),
).toBe(false);
});
it("returns false when the game name is empty", () => {
expect(
isLinkNameMismatch(
"",
"https://www.humblebundle.com/store/pragmata",
),
).toBe(false);
});
it("returns false when the URL is empty", () => {
expect(isLinkNameMismatch("Pragmata", "")).toBe(false);
});
});
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff. Show more