Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43d850d1d4 | ||
|
|
10ef68bfdc | ||
|
|
7e31791439 | ||
|
|
2d92d5ba81 | ||
|
|
fdb55f3018 | ||
|
|
12b0099238 | ||
|
|
e5776fa38c | ||
|
|
fe7e89d57e | ||
|
|
f637d89aae | ||
|
|
1e5720eecc | ||
|
|
08ebae0416 | ||
|
|
546802210e | ||
|
|
da22625178 | ||
|
|
f53b7df65b | ||
|
|
303f978a60 | ||
|
|
8405c6fa49 | ||
|
|
7ea308293a | ||
|
|
9f156d1f2c | ||
|
|
79be06b804 | ||
|
|
b4e32eac63 | ||
|
|
f8ada5944a |
No files matched your search
@@ -26,12 +26,12 @@ jobs:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: "17"
|
||||
|
||||
- uses: android-actions/setup-android@v3
|
||||
- uses: android-actions/setup-android@v4
|
||||
|
||||
- name: Install Android NDK (r27 LTS)
|
||||
run: sdkmanager "ndk;27.3.13750724"
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
||||
|
||||
- name: Cache cargo
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
run: cargo tauri android build --apk
|
||||
|
||||
- name: Upload APK to draft release
|
||||
uses: softprops/action-gh-release@v2
|
||||
uses: softprops/action-gh-release@v3
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
|
||||
draft: true
|
||||
|
||||
@@ -2,6 +2,99 @@
|
||||
|
||||
All notable changes to YTDescGen ship as tagged releases on `main`.
|
||||
|
||||
## v0.33.0 — 2026-07-13
|
||||
|
||||
A **feature** release that turns the description's Community block into the channel's
|
||||
full "join the chat" hub: two new invite links (**Signal**, **Instagram group chat**)
|
||||
and **Facebook Group** moved in from the generic Social list.
|
||||
|
||||
### Added
|
||||
|
||||
- **Signal + Instagram community invites** ([src/components/editor/CommunityEditor.tsx](src/components/editor/CommunityEditor.tsx), [src/utils/validation.ts](src/utils/validation.ts)) — two new inputs in the **Community** section that feed the `💬 COMMUNITY` description block for **every** output language (like Messenger). Signal expects `https://signal.group/#<id>`; Instagram expects the group-chat invite `https://www.instagram.com/j/<id>` or the short `https://ig.me/j/<id>` (distinct from the Instagram **profile** link, which stays in Social). Both hard-reject anything off-format via `ValidatedInput`, so a broken invite never reaches the description.
|
||||
- **Facebook Group moved into Community** ([src/config/social-fields.ts](src/config/social-fields.ts), [src/engine/description-builder.ts](src/engine/description-builder.ts)) — the old generic `fb_group` Social entry is now a dedicated `facebookGroupLink` community field with its own strict `https://facebook.com/groups/<id>` validator (tolerating `www.` / `m.` / `web.` and a trailing slash). It renders in the Community block for all languages. The block order is Messenger → Signal → Instagram → Facebook Group → Zalo (Vietnamese-only).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Three editor fields (`signalGroupLink`, `instagramGroupLink`, `facebookGroupLink`) thread through defaults, the store (persist **v16 → v17**), `GeneratorInput`, the editor → engine mapping, and template snapshots — guarded by the existing parity test. The v17 migration **lifts** a legacy `social.fb_group` value into `facebookGroupLink` and drops the dead key; `normalizeEditorPatch` does the same when a pre-move profile / preset / template is applied. Consequence: like the other community links, Facebook Group is no longer stored inside Profiles.
|
||||
- Nine i18n keys per locale added, one (`social.fb_group`) removed, across all six locales (validator **975 ui / 559 templates**). typecheck, lint, locale validation, and **613 tests** (583 + 30: three new validators, v17 migration incl. the fb_group lift, community render/order/all-language cases, mapping parity) pass; verified live — Vietnamese output shows all five lines in order with a localized heading, English output drops the Zalo line while keeping the rest, and a malformed Signal link surfaces an inline hard-reject error.
|
||||
- Five manifests bumped 0.32.1 → 0.33.0.
|
||||
|
||||
## v0.30.0 — 2026-06-27
|
||||
|
||||
A **feature** release adding two things creators kept doing by hand: advertising a
|
||||
game's **playtest / early-access signup**, and getting **stopped before a bad number**
|
||||
breaks a batch.
|
||||
|
||||
### Added
|
||||
|
||||
- **Playtest section** ([src/components/editor/PlaytestEditor.tsx](src/components/editor/PlaytestEditor.tsx), [src/config/playtest-platforms.ts](src/config/playtest-platforms.ts)) — a new entry in the **Store & Social** group: a signup link, a platform dropdown (Steam Playtest, Epic, itch.io, Discord / Community, Other), and an invite count. The invite input maxes out at the selected platform's cap (≤ 100); switching to a lower-cap platform clamps an over-budget count down. It renders into the description **only when a link is entered** — no toggle, no video-type gating — exactly like Store Links. The description block ([src/engine/description-builder.ts](src/engine/description-builder.ts)) is a localized `🧪 PLAYTEST / EARLY ACCESS` heading, the platform-labelled link, and an optional `🎟️ N invites available` line (emitted only for a positive whole number, so a stray decimal / negative can never produce a broken line).
|
||||
- **Invalid-number guarding** ([src/utils/validation.ts](src/utils/validation.ts)) — two pure validators (`validateIntegerInRange`, `validateBatchRange`) now reject negative, decimal, out-of-range, and `end < start` / over-100-span inputs. The **Batch** ([src/pages/BatchPage.tsx](src/pages/BatchPage.tsx)) and **Social bulk** ([src/pages/SocialPage.tsx](src/pages/SocialPage.tsx)) part-range inputs **disable the Generate button** and show a warning when the range is invalid; **Playlist** "Total videos" ([src/pages/PlaylistPage.tsx](src/pages/PlaylistPage.tsx)) and the new Playtest invite count warn inline and guard the output. The `Input` primitive ([src/components/ui/Input.tsx](src/components/ui/Input.tsx)) gained optional `errorText` / `helpText` props (backward-compatible).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Three editor fields (`playtestLink`, `playtestPlatform`, `playtestInvites`) thread through the store (persist **v14 → v15** migration: unknown platform → default, invite count clamped to an integer in `[0, 100]`), `GeneratorInput`, and the editor → engine mapping — guarded by the existing parity test.
|
||||
- 60 new i18n strings across all six locales (validator **948 ui / 544 templates**). typecheck, lint, locale validation, and **544 tests** (517 + 27: playtest block, validators, v15 migration, mapping parity) pass; verified live — the block renders and localizes (EN / JA), the itch.io cap clamps invites 80 → 50, decimals warn, and Batch generation blocks on `end < start` and over-100 ranges.
|
||||
- Five manifests bumped 0.29.3 → 0.30.0.
|
||||
|
||||
## v0.29.3 — 2026-06-20
|
||||
|
||||
A follow-up **hotfix** to v0.29.2. Forwarding the always-English `tEn` translator
|
||||
to multi-language Output (so the AI-translation disclaimer could render `EN · LOCAL`)
|
||||
also turned the **content-warnings, tech-notes, and playthrough-notes** blocks
|
||||
bilingual in every multi-language tab — because `tEn` was the single shared signal
|
||||
for bilingual rendering. Each multi-language tab is already a dedicated single
|
||||
language, so those "video" blocks should be that language only; only the
|
||||
translation disclaimer is meant to stay bilingual.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Multi-language tabs render content blocks single-language again** ([src/hooks/use-multilang-output.ts](src/hooks/use-multilang-output.ts), [src/engine/description-builder.ts](src/engine/description-builder.ts), [src/engine/template-renderer.ts](src/engine/template-renderer.ts)) — a new `bilingualContentBlocks` render option (default `true`) gates the three video blocks. The multi-language hook passes `false`, so content warnings / tech notes / playthrough notes show the target language only, while the `▸ 🌐 ABOUT THIS TRANSLATION` disclaimer keeps the raw `tEn` and stays bilingual `EN · LOCAL`. Single-language output is unchanged (default `true` preserves the v0.11/v0.12 bilingual blocks).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- The Social / cross-post path ([src/engine/social-post-builder.ts](src/engine/social-post-builder.ts)) is intentionally left as-is — it is driven by separate hooks, never wired through the multi-language Output tabs, and its bilingual content warnings are long-standing v0.24.0 behavior. The asymmetry is deliberate.
|
||||
- Additive, default-preserving change: the engine option defaults to the old behavior, so every existing caller and test is unaffected. typecheck, lint, locale validation (937/542), and all **517 tests** (513 + 4 new `bilingualContentBlocks` gate tests) pass; verified live — multi-language JA tab shows JA-only content blocks with a bilingual disclaimer, the EN tab omits the disclaimer, and single-language JA still renders content warnings bilingually.
|
||||
- Five manifests bumped 0.29.2 → 0.29.3.
|
||||
|
||||
## v0.29.2 — 2026-06-20
|
||||
|
||||
A one-line **hotfix**. The opt-in *"Show translation-quality notice"* setting
|
||||
(the AI-translation disclaimer, v0.24.0) had no effect when the Output page was
|
||||
showing **two or more languages at once** — the multi-language output hook had
|
||||
drifted out of sync with the single-language one and never forwarded the setting
|
||||
to the engine.
|
||||
|
||||
### Fixed
|
||||
|
||||
- **AI-translation disclaimer now appears in multi-language Output** ([src/hooks/use-multilang-output.ts](src/hooks/use-multilang-output.ts)) — the multi-language hook now forwards `showTranslationQuality` to `renderAll`, matching [useGeneratedOutput](src/hooks/use-generated-output.ts). The same patch also restores `showThirdPartyAds` (an identical latent gap — its disclaimer was dropped in multi-language mode too) and the always-English `tEn` translator, so the bilingual blocks render `EN · LOCAL` instead of target-language-only. Selecting 2+ languages and viewing a non-English/Vietnamese tab now shows the `▸ 🌐 ABOUT THIS TRANSLATION` block. Single-language output and the Batch page were already correct.
|
||||
|
||||
### Under the hood
|
||||
|
||||
- One-file fix; no engine, store, config, or i18n changes (the `translationQuality` template keys already exist in all six locales). typecheck, lint, locale validation (937/542), all **513 tests**, and the production build pass; verified live — the JA tab renders the block bilingually while the EN/VI tabs correctly omit it.
|
||||
- This hook has drifted out of sync before (a prior `showSponsorCredit` miss), so the recurrence is a known class of bug.
|
||||
- Five manifests bumped 0.29.1 → 0.29.2.
|
||||
|
||||
## v0.29.1 — 2026-06-17
|
||||
|
||||
A UI/UX hotfix for **mobile viewport overflow**. On Android and narrow web
|
||||
mobile (~360–400px) the **Batch** and **Profile** screens overran the viewport
|
||||
horizontally — rows laid out side-by-side on desktop never collapsed to a stack
|
||||
on small screens. This release makes those rows responsive and sweeps a few
|
||||
adjacent overflow spots. Layout-only: no logic, store, or i18n changes, and
|
||||
desktop layout is byte-for-byte unchanged (every change is gated behind the
|
||||
`sm` breakpoint).
|
||||
|
||||
### Fixed
|
||||
|
||||
- **Batch page fits mobile** ([src/pages/BatchPage.tsx](src/pages/BatchPage.tsx)) — the part-range row (Start / End / Generate) stacks vertically below `sm` with a full-width Generate button, and the result-card copy-button rows wrap instead of overflowing.
|
||||
- **Profile page fits mobile** ([src/pages/ProfilesPage.tsx](src/pages/ProfilesPage.tsx)) — the tab pill and the Export/Import buttons drop onto separate rows below `sm`; the Profile / Preset / Template cards ([ProfileCard](src/components/profiles/ProfileCard.tsx), [PresetCard](src/components/presets/PresetCard.tsx), [TemplateCard](src/components/templates/TemplateCard.tsx)) move their action buttons below the content and let long names wrap (`min-w-0`) instead of shoving the buttons off-screen.
|
||||
- **Adjacent mobile overflow swept** — responsive padding + a wrapping header on [Settings](src/pages/SettingsPage.tsx) (its Import/Export row shows on Android, where `IS_TAURI` is true), the video-settings selector grid collapses to one column below `sm` ([VideoSettingsForm](src/components/editor/VideoSettingsForm.tsx)), and modals are pinned to `calc(100% - 2rem)` so they never exceed the viewport ([Modal](src/components/ui/Modal.tsx)).
|
||||
|
||||
### Under the hood
|
||||
|
||||
- Layout-only className changes across 8 components. typecheck, lint, locale validation (937/542), all **513 tests**, and the production build pass; verified live at 375 px and 1280 px with zero horizontal overflow on Batch, Profiles, Settings, and Editor.
|
||||
- Five manifests bumped 0.29.0 → 0.29.1 (`package-lock.json`, which had drifted at 0.28.0, is resynced to 0.29.1).
|
||||
|
||||
## v0.29.0 — 2026-06-15
|
||||
|
||||
Adds an **Android build** — an installable, sideloadable signed `.apk` built
|
||||
|
||||
@@ -33,7 +33,7 @@ Built for the gameplay no-commentary niche — especially horror / scary games
|
||||
- **Batch mode** — generate metadata for all parts of a series in one pass.
|
||||
- **Cross-post captions** — a dedicated **Social** tab re-packages the same YouTube source into short-form captions for **TikTok** (4,000-char), **Instagram Reels**, and **Facebook Reels** — title, rig, content warnings, copyright, thanks, and hashtags (game + genre + curated per-platform popular tags). Single + bulk modes, per-platform character limits with smart overflow trimming, and JSON import/export.
|
||||
- **Desktop app** — Windows, macOS & Linux native binaries via Tauri (~8 MB).
|
||||
- **Android app** — installable, sideloadable `.apk` (Android 11+) built from the same Tauri 2 codebase. Grab it from [Releases](https://github.com/poli0981/youtube-generator/releases) and enable "Install unknown apps" to sideload.
|
||||
- **Android app** — installable, sideloadable `.apk` built from the same Tauri 2 codebase. **Requires Android 11+** (tested 11–16; real-device test on Android 12). Grab it from [Releases](https://github.com/poli0981/youtube-generator/releases) and enable "Install unknown apps" to sideload.
|
||||
- **Mobile-responsive web** — drawer navigation, touch-sized controls, iOS-safe text-input behavior. Tested down to 360 × 640.
|
||||
- **100% offline** — no server, no telemetry, no account. See [PRIVACY.md](./PRIVACY.md).
|
||||
|
||||
|
||||
@@ -260,6 +260,7 @@ separate mobile project. Build with `cargo tauri android build --apk`; see
|
||||
|---------|-------------|
|
||||
| Same codebase | One Tauri 2 project produces web, desktop, and Android |
|
||||
| Min version | Android 11+ (minSdk 30); `targetSdk` 36 (Android 16) |
|
||||
| Tested | Android 11 → 16 (emulators); real device on Android 12 |
|
||||
| Signed APK | Self-signed release APK for sideloading; CI publishes it to GitHub Releases |
|
||||
| Responsive UI | Drawer navigation, touch-sized controls, safe-area insets |
|
||||
| File export | Routed through the WebView download (lands in Downloads) on Android |
|
||||
|
||||
+33
-11
@@ -283,17 +283,39 @@ point, and the Android launcher icons live in `src-tauri/icons/android/`. The
|
||||
desktop-only tray / single-instance / hide-to-tray logic in `src-tauri/src/lib.rs`
|
||||
is gated behind `#[cfg(desktop)]` so the library compiles for Android.
|
||||
|
||||
> **Min version: Android 11 (minSdk 30), targetSdk 36.** Set via
|
||||
> `bundle.android.minSdkVersion` in `src-tauri/tauri.conf.json` (the source of
|
||||
> truth used by `tauri android init`) and the generated
|
||||
> `gen/android/app/build.gradle.kts` (`minSdk = 30` — edit this directly if you
|
||||
> change it without re-running `init`, since the gradle value is baked at init
|
||||
> time). Android 11+ covers the large majority of active devices and keeps a
|
||||
> modern, auto-updating System WebView (the WebView minimum is Android 10) plus
|
||||
> Google Play system/Play-services security updates, even though Google's
|
||||
> OS-level security bulletins for Android 11–13 have ended. Raising minSdk also
|
||||
> moots the ancient-WebView class of bug (e.g. the Chromium-91 `crypto.randomUUID`
|
||||
> boot crash fixed in this release).
|
||||
### Requirements & tested versions
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| **Minimum OS** | **Android 11** (API level 30, `minSdk 30`). The APK will not install below this. |
|
||||
| **Target OS** | **Android 16** (API level 36, `targetSdk 36`). |
|
||||
| **Architectures** | Universal APK — `arm64-v8a`, `armeabi-v7a`, `x86`, `x86_64`. |
|
||||
| **Tested** | **Android 11 → 16.** The v0.29.0 build was verified on Android emulators across this range **and on a real device running Android 12** (the maintainer's phone). |
|
||||
|
||||
Where the value lives: `bundle.android.minSdkVersion` in
|
||||
[`src-tauri/tauri.conf.json`](../src-tauri/tauri.conf.json) is the source of
|
||||
truth used by `tauri android init`; the generated
|
||||
`gen/android/app/build.gradle.kts` carries the baked `minSdk = 30` — edit that
|
||||
directly if you change the floor without re-running `init`.
|
||||
|
||||
**Why Android 11 is the floor (rationale):**
|
||||
|
||||
- **Coverage.** Android 11+ accounts for the large majority of active devices in
|
||||
2026 (Android 14/15 alone are the two biggest slices, and 11–13 together still
|
||||
hold a sizeable share). Going lower buys few extra users at growing compat cost.
|
||||
- **A modern, patched WebView.** The app renders entirely in the system WebView,
|
||||
whose minimum is Android 10. On Android 11+ the WebView auto-updates via Google
|
||||
Play, so the rendering/JS engine stays current and patched. This is exactly why
|
||||
the **real-device test on Android 12 worked**, while a *stale* Android-12
|
||||
emulator stuck on WebView 91 showed a black screen (the `crypto.randomUUID`
|
||||
boot crash) — that class of bug is fixed in v0.29.0 and is moot on an
|
||||
up-to-date WebView.
|
||||
- **Security upkeep.** Even though Google's *OS-level* monthly security bulletins
|
||||
for Android 11–13 have ended (Android 12 in 2025, Android 13 in early 2026),
|
||||
Android 11+ keeps receiving security updates for the components that matter to a
|
||||
sandboxed WebView app: Google Play system updates (Project Mainline), Google
|
||||
Play services, and System WebView. Requiring strict OS-bulletin support would
|
||||
mean Android 14+, which would drop more than half of users.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
|
||||
Generated
+96
-86
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.28.0",
|
||||
"version": "0.33.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.28.0",
|
||||
"version": "0.33.0",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.11.0",
|
||||
@@ -68,13 +68,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
|
||||
"integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
|
||||
"integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.28.5",
|
||||
"@babel/helper-validator-identifier": "^7.29.7",
|
||||
"js-tokens": "^4.0.0",
|
||||
"picocolors": "^1.1.1"
|
||||
},
|
||||
@@ -83,9 +83,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/compat-data": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",
|
||||
"integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
|
||||
"integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -93,21 +93,21 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/core": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
|
||||
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
|
||||
"integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/generator": "^7.29.0",
|
||||
"@babel/helper-compilation-targets": "^7.28.6",
|
||||
"@babel/helper-module-transforms": "^7.28.6",
|
||||
"@babel/helpers": "^7.28.6",
|
||||
"@babel/parser": "^7.29.0",
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/traverse": "^7.29.0",
|
||||
"@babel/types": "^7.29.0",
|
||||
"@babel/code-frame": "^7.29.7",
|
||||
"@babel/generator": "^7.29.7",
|
||||
"@babel/helper-compilation-targets": "^7.29.7",
|
||||
"@babel/helper-module-transforms": "^7.29.7",
|
||||
"@babel/helpers": "^7.29.7",
|
||||
"@babel/parser": "^7.29.7",
|
||||
"@babel/template": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7",
|
||||
"@jridgewell/remapping": "^2.3.5",
|
||||
"convert-source-map": "^2.0.0",
|
||||
"debug": "^4.1.0",
|
||||
@@ -124,14 +124,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/generator": {
|
||||
"version": "7.29.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.1.tgz",
|
||||
"integrity": "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
|
||||
"integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.0",
|
||||
"@babel/types": "^7.29.0",
|
||||
"@babel/parser": "^7.29.7",
|
||||
"@babel/types": "^7.29.7",
|
||||
"@jridgewell/gen-mapping": "^0.3.12",
|
||||
"@jridgewell/trace-mapping": "^0.3.28",
|
||||
"jsesc": "^3.0.2"
|
||||
@@ -141,14 +141,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-compilation-targets": {
|
||||
"version": "7.28.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz",
|
||||
"integrity": "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
|
||||
"integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/compat-data": "^7.28.6",
|
||||
"@babel/helper-validator-option": "^7.27.1",
|
||||
"@babel/compat-data": "^7.29.7",
|
||||
"@babel/helper-validator-option": "^7.29.7",
|
||||
"browserslist": "^4.24.0",
|
||||
"lru-cache": "^5.1.1",
|
||||
"semver": "^6.3.1"
|
||||
@@ -158,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-globals": {
|
||||
"version": "7.28.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.28.0.tgz",
|
||||
"integrity": "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
|
||||
"integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -168,29 +168,29 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-module-imports": {
|
||||
"version": "7.28.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz",
|
||||
"integrity": "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
|
||||
"integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.28.6",
|
||||
"@babel/types": "^7.28.6"
|
||||
"@babel/traverse": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-module-transforms": {
|
||||
"version": "7.28.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz",
|
||||
"integrity": "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
|
||||
"integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-module-imports": "^7.28.6",
|
||||
"@babel/helper-validator-identifier": "^7.28.5",
|
||||
"@babel/traverse": "^7.28.6"
|
||||
"@babel/helper-module-imports": "^7.29.7",
|
||||
"@babel/helper-validator-identifier": "^7.29.7",
|
||||
"@babel/traverse": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -210,9 +210,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
|
||||
"integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
|
||||
"integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -220,9 +220,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.28.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
|
||||
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
|
||||
"integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -230,9 +230,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-option": {
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz",
|
||||
"integrity": "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
|
||||
"integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -240,27 +240,27 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helpers": {
|
||||
"version": "7.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.2.tgz",
|
||||
"integrity": "sha512-HoGuUs4sCZNezVEKdVcwqmZN8GoHirLUcLaYVNBK2J0DadGtdcqgr3BCbvH8+XUo4NGjNl3VOtSjEKNzqfFgKw==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
|
||||
"integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/types": "^7.29.0"
|
||||
"@babel/template": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.29.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.2.tgz",
|
||||
"integrity": "sha512-4GgRzy/+fsBa72/RZVJmGKPmZu9Byn8o4MoLpmNe1m8ZfYnz5emHLQz3U4gLud6Zwl0RZIcgiLD7Uq7ySFuDLA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz",
|
||||
"integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@@ -311,33 +311,33 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/template": {
|
||||
"version": "7.28.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.28.6.tgz",
|
||||
"integrity": "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
|
||||
"integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.28.6",
|
||||
"@babel/parser": "^7.28.6",
|
||||
"@babel/types": "^7.28.6"
|
||||
"@babel/code-frame": "^7.29.7",
|
||||
"@babel/parser": "^7.29.7",
|
||||
"@babel/types": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",
|
||||
"integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
|
||||
"integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.29.0",
|
||||
"@babel/generator": "^7.29.0",
|
||||
"@babel/helper-globals": "^7.28.0",
|
||||
"@babel/parser": "^7.29.0",
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/types": "^7.29.0",
|
||||
"@babel/code-frame": "^7.29.7",
|
||||
"@babel/generator": "^7.29.7",
|
||||
"@babel/helper-globals": "^7.29.7",
|
||||
"@babel/parser": "^7.29.7",
|
||||
"@babel/template": "^7.29.7",
|
||||
"@babel/types": "^7.29.7",
|
||||
"debug": "^4.3.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -345,14 +345,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
|
||||
"integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz",
|
||||
"integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
"@babel/helper-validator-identifier": "^7.28.5"
|
||||
"@babel/helper-string-parser": "^7.29.7",
|
||||
"@babel/helper-validator-identifier": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -4021,10 +4021,20 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
|
||||
"integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "yt-desc-gen",
|
||||
"version": "0.29.0",
|
||||
"version": "0.33.0",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
|
||||
Generated
+1
-1
@@ -5535,7 +5535,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.29.0"
|
||||
version = "0.33.0"
|
||||
dependencies = [
|
||||
"tauri",
|
||||
"tauri-build",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "yt-desc-gen"
|
||||
version = "0.29.0"
|
||||
version = "0.33.0"
|
||||
description = "YouTube Gameplay Description Generator"
|
||||
authors = ["poli0981"]
|
||||
edition = "2021"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/tauri-apps/tauri/dev/crates/tauri-cli/schema.json",
|
||||
"productName": "YTDescGen",
|
||||
"version": "0.29.0",
|
||||
"version": "0.33.0",
|
||||
"identifier": "com.skullmute.ytdescgen",
|
||||
"build": {
|
||||
"beforeBuildCommand": "npm run build",
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ValidatedInput } from "@components/ui/ValidatedInput";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
validateMessengerUrl,
|
||||
validateZaloGroupUrl,
|
||||
validateSignalGroupUrl,
|
||||
validateInstagramInviteUrl,
|
||||
validateFacebookGroupUrl,
|
||||
} from "@utils/validation";
|
||||
|
||||
/**
|
||||
* Community invite links. A single section for "join the chat" links that
|
||||
* feed the description's "💬 COMMUNITY" block:
|
||||
*
|
||||
* - Messenger community (`https://m.me/ch/<id>`), Signal group
|
||||
* (`https://signal.group/#<id>`), Instagram group chat
|
||||
* (`https://www.instagram.com/j/<id>` or `https://ig.me/j/<id>`), and
|
||||
* Facebook Group (`https://facebook.com/groups/<id>`) — all shown for
|
||||
* every output language (v0.32.0 Messenger; v0.33.0 the rest, with
|
||||
* Facebook Group moved here from the Social section).
|
||||
* - Zalo group (`https://zalo.me/g/<code>`) — Zalo is a Vietnam-audience
|
||||
* app, so the input only appears (and the description line only renders)
|
||||
* when the output language is Vietnamese. A value entered while in
|
||||
* Vietnamese is preserved if the creator later switches language.
|
||||
*
|
||||
* Every input hard-rejects malformed links via {@link ValidatedInput}, so a
|
||||
* bad URL never reaches the generated description.
|
||||
*/
|
||||
export function CommunityEditor() {
|
||||
const { t } = useTranslation("ui");
|
||||
const messengerCommunityLink = useEditorStore((s) => s.messengerCommunityLink);
|
||||
const signalGroupLink = useEditorStore((s) => s.signalGroupLink);
|
||||
const instagramGroupLink = useEditorStore((s) => s.instagramGroupLink);
|
||||
const facebookGroupLink = useEditorStore((s) => s.facebookGroupLink);
|
||||
const zaloGroupLink = useEditorStore((s) => s.zaloGroupLink);
|
||||
const language = useEditorStore((s) => s.language);
|
||||
const setField = useEditorStore((s) => s.set);
|
||||
|
||||
const isVi = language === "vi";
|
||||
|
||||
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.community")}
|
||||
</span>
|
||||
<p className="text-xs text-text-muted">{t("editor.communityHelp")}</p>
|
||||
</div>
|
||||
|
||||
<ValidatedInput
|
||||
label={t("editor.messengerCommunityLink")}
|
||||
placeholder={t("editor.messengerCommunityLinkPlaceholder")}
|
||||
value={messengerCommunityLink}
|
||||
onChange={(v) => setField("messengerCommunityLink", v)}
|
||||
validate={validateMessengerUrl}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
<ValidatedInput
|
||||
label={t("editor.signalGroupLink")}
|
||||
placeholder={t("editor.signalGroupLinkPlaceholder")}
|
||||
value={signalGroupLink}
|
||||
onChange={(v) => setField("signalGroupLink", v)}
|
||||
validate={validateSignalGroupUrl}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
<ValidatedInput
|
||||
label={t("editor.instagramGroupLink")}
|
||||
placeholder={t("editor.instagramGroupLinkPlaceholder")}
|
||||
value={instagramGroupLink}
|
||||
onChange={(v) => setField("instagramGroupLink", v)}
|
||||
validate={validateInstagramInviteUrl}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
<ValidatedInput
|
||||
label={t("editor.facebookGroupLink")}
|
||||
placeholder={t("editor.facebookGroupLinkPlaceholder")}
|
||||
value={facebookGroupLink}
|
||||
onChange={(v) => setField("facebookGroupLink", v)}
|
||||
validate={validateFacebookGroupUrl}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
{isVi && (
|
||||
<ValidatedInput
|
||||
label={t("editor.zaloGroupLink")}
|
||||
placeholder={t("editor.zaloGroupLinkPlaceholder")}
|
||||
value={zaloGroupLink}
|
||||
onChange={(v) => setField("zaloGroupLink", v)}
|
||||
validate={validateZaloGroupUrl}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { ValidatedInput } from "@components/ui/ValidatedInput";
|
||||
import { Input } from "@components/ui/Input";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import {
|
||||
validateUrl,
|
||||
validateUrlWithPattern,
|
||||
validateIntegerInRange,
|
||||
} from "@utils/validation";
|
||||
import {
|
||||
PLAYTEST_PLATFORMS,
|
||||
maxInvitesForPlatform,
|
||||
} from "@config/playtest-platforms";
|
||||
|
||||
/**
|
||||
* Playtest section (v0.30.0). One signup link + the platform it lives on +
|
||||
* an optional invite count. Mirrors {@link StoreLinkEditor} but is a single
|
||||
* entry rather than one-per-platform. The invite-count input maxes out at
|
||||
* the selected platform's cap (≤100); switching to a lower-cap platform
|
||||
* clamps an over-budget count down. Renders into the description only when
|
||||
* a link is entered — no settings toggle gates it.
|
||||
*/
|
||||
export function PlaytestEditor() {
|
||||
const { t } = useTranslation("ui");
|
||||
const playtestLink = useEditorStore((s) => s.playtestLink);
|
||||
const playtestPlatform = useEditorStore((s) => s.playtestPlatform);
|
||||
const playtestInvites = useEditorStore((s) => s.playtestInvites);
|
||||
const setField = useEditorStore((s) => s.set);
|
||||
|
||||
const platform =
|
||||
PLAYTEST_PLATFORMS.find((p) => p.id === playtestPlatform) ?? PLAYTEST_PLATFORMS[0];
|
||||
const cap = maxInvitesForPlatform(playtestPlatform);
|
||||
|
||||
const platformOptions = PLAYTEST_PLATFORMS.map((p) => ({
|
||||
value: p.id,
|
||||
label: p.label,
|
||||
}));
|
||||
|
||||
// The store holds the invite count as a number; the input edits raw text
|
||||
// so a mid-edit "2.5" / "-1" can show a warning without snapping back.
|
||||
// Invalid text is NOT committed, so the description stays clean.
|
||||
const [invitesText, setInvitesText] = useState(
|
||||
playtestInvites > 0 ? String(playtestInvites) : "",
|
||||
);
|
||||
|
||||
// Resync the text when the store value changes from outside this input
|
||||
// (platform clamp, profile / preset load, draft reset). Only fires on a
|
||||
// real store change, so it never clobbers an in-progress invalid edit.
|
||||
useEffect(() => {
|
||||
const current = invitesText.trim() === "" ? 0 : Number(invitesText);
|
||||
if (current !== playtestInvites) {
|
||||
setInvitesText(playtestInvites > 0 ? String(playtestInvites) : "");
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [playtestInvites]);
|
||||
|
||||
const handlePlatformChange = (id: string) => {
|
||||
setField("playtestPlatform", id);
|
||||
const newCap = maxInvitesForPlatform(id);
|
||||
if (playtestInvites > newCap) {
|
||||
setField("playtestInvites", newCap);
|
||||
}
|
||||
};
|
||||
|
||||
const handleInvitesChange = (raw: string) => {
|
||||
setInvitesText(raw);
|
||||
const result = validateIntegerInRange(raw, { min: 1, max: cap, allowEmpty: true });
|
||||
if (result.valid) {
|
||||
setField("playtestInvites", raw.trim() === "" ? 0 : Number(raw));
|
||||
}
|
||||
};
|
||||
|
||||
const invitesValidation = validateIntegerInRange(invitesText, {
|
||||
min: 1,
|
||||
max: cap,
|
||||
allowEmpty: true,
|
||||
});
|
||||
const invitesError = invitesValidation.valid
|
||||
? undefined
|
||||
: t(invitesValidation.error ?? "", invitesValidation.errorParams);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm font-medium text-text-secondary">
|
||||
{t("editor.playtest.heading")}
|
||||
</span>
|
||||
|
||||
<ValidatedInput
|
||||
label={t("editor.playtest.linkLabel")}
|
||||
placeholder={platform?.urlPrefix ?? "https://"}
|
||||
value={playtestLink}
|
||||
onChange={(v) => setField("playtestLink", v)}
|
||||
validate={(v) =>
|
||||
platform ? validateUrlWithPattern(v, platform.urlPattern) : validateUrl(v)
|
||||
}
|
||||
inputMode="url"
|
||||
autoComplete="off"
|
||||
/>
|
||||
|
||||
<div className="grid grid-cols-[1fr_9rem] items-start gap-2">
|
||||
<Select
|
||||
label={t("editor.playtest.platformLabel")}
|
||||
value={playtestPlatform}
|
||||
options={platformOptions}
|
||||
onChange={handlePlatformChange}
|
||||
/>
|
||||
<Input
|
||||
label={t("editor.playtest.invitesLabel", { max: cap })}
|
||||
type="number"
|
||||
min={1}
|
||||
max={cap}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
value={invitesText}
|
||||
onChange={(e) => handleInvitesChange(e.target.value)}
|
||||
errorText={invitesError}
|
||||
helpText={t("editor.playtest.invitesHelp", { max: cap })}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -113,7 +113,7 @@ export function VideoSettingsForm() {
|
||||
<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">
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-3">
|
||||
<Select
|
||||
label={t("editor.resolution")}
|
||||
options={RESOLUTION_OPTIONS}
|
||||
|
||||
@@ -46,8 +46,8 @@ export function PresetCard({ preset }: PresetCardProps) {
|
||||
|
||||
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">
|
||||
<div className="flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{preset.gameName}</h3>
|
||||
<div className="mt-1.5 flex flex-wrap items-center gap-1.5 text-xs text-text-muted">
|
||||
{genreDefs.map((g) => (
|
||||
@@ -58,7 +58,7 @@ export function PresetCard({ preset }: PresetCardProps) {
|
||||
<span>{preset.platform}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="flex shrink-0 items-center gap-1.5">
|
||||
<Button variant="primary" size="sm" onClick={handleLoad}>
|
||||
<Upload className="h-3.5 w-3.5" />
|
||||
{t("presets.loadPreset")}
|
||||
|
||||
@@ -43,16 +43,16 @@ export function ProfileCard({ profile }: ProfileCardProps) {
|
||||
|
||||
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">
|
||||
<div className="flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h3 className="text-sm font-semibold text-text-primary">{profile.name}</h3>
|
||||
<p className="mt-0.5 text-xs text-text-secondary">{profile.channelName || "No channel"}</p>
|
||||
<div className="mt-1.5 flex gap-3 text-xs text-text-muted">
|
||||
<div className="mt-1.5 flex flex-wrap gap-3 text-xs text-text-muted">
|
||||
{socialCount > 0 && <span>{socialCount} social links</span>}
|
||||
{rigCount > 0 && <span>{rigCount} rig fields</span>}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="flex shrink-0 items-center gap-1.5">
|
||||
<Button variant="primary" size="sm" onClick={handleLoad}>
|
||||
<Upload className="h-3.5 w-3.5" />
|
||||
{t("profiles.loadProfile")}
|
||||
|
||||
@@ -35,16 +35,16 @@ export function TemplateCard({ template }: TemplateCardProps) {
|
||||
|
||||
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">
|
||||
<div className="flex flex-col gap-3 rounded-lg border border-border-strong bg-surface-2 p-4 shadow-md shadow-black/10 transition-colors hover:border-accent/30 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="min-w-0 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">
|
||||
<div className="mt-1.5 flex flex-wrap 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">
|
||||
<div className="flex shrink-0 items-center gap-1.5">
|
||||
<Button variant="primary" size="sm" onClick={handleApply}>
|
||||
<Upload className="h-3.5 w-3.5" />
|
||||
{t("templates.loadTemplate")}
|
||||
|
||||
@@ -80,6 +80,11 @@ export function TemplateSaveForm({ open, onClose }: TemplateSaveFormProps) {
|
||||
vnBankHolder: editor.vnBankHolder,
|
||||
vnMomo: editor.vnMomo,
|
||||
vnZalopay: editor.vnZalopay,
|
||||
messengerCommunityLink: editor.messengerCommunityLink,
|
||||
zaloGroupLink: editor.zaloGroupLink,
|
||||
signalGroupLink: editor.signalGroupLink,
|
||||
instagramGroupLink: editor.instagramGroupLink,
|
||||
facebookGroupLink: editor.facebookGroupLink,
|
||||
};
|
||||
addTemplate(name, snapshot);
|
||||
toast.success(t("templates.savedAs", { name: name.trim() || "Untitled" }));
|
||||
|
||||
@@ -4,11 +4,16 @@ import clsx from "clsx";
|
||||
interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
||||
label?: string;
|
||||
error?: boolean;
|
||||
/** Inline error message shown below the input (also forces the red border). */
|
||||
errorText?: string;
|
||||
/** Inline hint shown below the input when there is no error. */
|
||||
helpText?: string;
|
||||
}
|
||||
|
||||
export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
({ label, error, className, id, ...props }, ref) => {
|
||||
({ label, error, errorText, helpText, className, id, ...props }, ref) => {
|
||||
const inputId = id ?? label?.toLowerCase().replace(/\s+/g, "-");
|
||||
const isError = error || Boolean(errorText);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-1">
|
||||
@@ -20,13 +25,16 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
||||
<input
|
||||
ref={ref}
|
||||
id={inputId}
|
||||
aria-invalid={isError || undefined}
|
||||
className={clsx(
|
||||
"min-h-touch rounded-lg border bg-surface-1 px-3 py-2.5 text-base text-text-primary placeholder:text-text-muted transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50 sm:text-sm",
|
||||
error ? "border-danger" : "border-border focus:border-accent",
|
||||
isError ? "border-danger" : "border-border focus:border-accent",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
/>
|
||||
{errorText && <p className="text-xs text-danger">{errorText}</p>}
|
||||
{helpText && !errorText && <p className="text-xs text-text-muted">{helpText}</p>}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ export function Modal({ open, onClose, title, children, footer, className }: Mod
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
"mx-4 flex max-h-[85vh] w-full max-w-lg flex-col rounded-xl border border-border bg-surface-1 shadow-2xl",
|
||||
"mx-4 flex max-h-[85vh] w-[calc(100%-2rem)] max-w-lg flex-col rounded-xl border border-border bg-surface-1 shadow-2xl",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
} from "./graphics-settings";
|
||||
import type { VideoStyleEra } from "./video-styles";
|
||||
import { DEFAULT_GACHA_QUEST_TYPE, type GachaQuestType } from "./gacha-quest-types";
|
||||
import { DEFAULT_PLAYTEST_PLATFORM } from "./playtest-platforms";
|
||||
import type {
|
||||
SupportedLanguage,
|
||||
StoreLinkType,
|
||||
@@ -131,6 +132,22 @@ export interface EditorDefaults {
|
||||
vnBankHolder: string;
|
||||
vnMomo: string;
|
||||
vnZalopay: string;
|
||||
/** Playtest signup link (v0.30.0). Empty string = no playtest block. */
|
||||
playtestLink: string;
|
||||
/** Playtest platform id (see `@config/playtest-platforms`). */
|
||||
playtestPlatform: string;
|
||||
/** Playtest invites available, 0..platform max (≤100). 0 = unset. */
|
||||
playtestInvites: number;
|
||||
/** Messenger community invite link (v0.32.0). `https://m.me/ch/<id>`. Empty = no community line. */
|
||||
messengerCommunityLink: string;
|
||||
/** Zalo group invite link (v0.32.0). `https://zalo.me/g/<code>`. Rendered only for Vietnamese output. */
|
||||
zaloGroupLink: string;
|
||||
/** Signal group invite link (v0.33.0). `https://signal.group/#<id>`. Rendered for all languages. Empty = no line. */
|
||||
signalGroupLink: string;
|
||||
/** Instagram group-chat invite link (v0.33.0). `https://www.instagram.com/j/<id>` or `https://ig.me/j/<id>`. All languages. */
|
||||
instagramGroupLink: string;
|
||||
/** Facebook group invite link (v0.33.0). `https://facebook.com/groups/<id>`. Moved from the generic Social list; all languages. */
|
||||
facebookGroupLink: string;
|
||||
}
|
||||
|
||||
export interface SettingsDefaults {
|
||||
@@ -208,6 +225,14 @@ export const DEFAULTS = {
|
||||
vnBankHolder: "",
|
||||
vnMomo: "",
|
||||
vnZalopay: "",
|
||||
playtestLink: "",
|
||||
playtestPlatform: DEFAULT_PLAYTEST_PLATFORM,
|
||||
playtestInvites: 0,
|
||||
messengerCommunityLink: "",
|
||||
zaloGroupLink: "",
|
||||
signalGroupLink: "",
|
||||
instagramGroupLink: "",
|
||||
facebookGroupLink: "",
|
||||
} satisfies EditorDefaults,
|
||||
|
||||
settings: {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Predefined "why was this playlist dropped" reasons (v0.31.0).
|
||||
*
|
||||
* Drives the Playlist Generator's dropped-reason multi-select, shown only
|
||||
* when the playlist status is "dropped". Each id maps to a localized label
|
||||
* under `playlist.droppedReasons.<id>` in BOTH the `ui` namespace (the
|
||||
* selection chips) and the `templates` namespace (the rendered output) —
|
||||
* the same split used by content warnings. The list is a starting point,
|
||||
* just plain constants free to tune; the editor's free-text "other reason"
|
||||
* field covers anything not listed here.
|
||||
*/
|
||||
export const DROPPED_REASONS = [
|
||||
{ id: "boring", icon: "😴" },
|
||||
{ id: "performance", icon: "🐌" },
|
||||
{ id: "bugs", icon: "🐛" },
|
||||
{ id: "delisted", icon: "🗑️" },
|
||||
{ id: "low_views", icon: "📉" },
|
||||
{ id: "time", icon: "⏳" },
|
||||
] as const;
|
||||
|
||||
export type DroppedReasonId = (typeof DROPPED_REASONS)[number]["id"];
|
||||
@@ -0,0 +1,85 @@
|
||||
/**
|
||||
* Playtest platform catalogue (v0.30.0).
|
||||
*
|
||||
* Drives the editor's Playtest section: the creator picks ONE platform
|
||||
* their playtest signup lives on, pastes the link, and optionally records
|
||||
* how many invites they have to give away. Mirrors the {@link PlatformConfig}
|
||||
* shape from `@config/platforms` (id / label / urlPrefix / urlPattern) and
|
||||
* adds a per-platform `maxInvites`.
|
||||
*
|
||||
* Why per-platform caps: a playtest's invite budget varies by storefront
|
||||
* (Steam Playtest grants, itch.io download keys, Discord closed-beta seats…),
|
||||
* so the editor's invite-count input maxes out at the selected platform's
|
||||
* cap rather than one flat number. The absolute ceiling is
|
||||
* {@link PLAYTEST_MAX_INVITES_CAP} (100) — no platform may exceed it.
|
||||
*
|
||||
* The `maxInvites` numbers below are sensible starting points, NOT hard
|
||||
* facts — they're plain constants and meant to be tuned freely.
|
||||
*/
|
||||
|
||||
/** Absolute hard cap on playtest invites, regardless of platform. */
|
||||
export const PLAYTEST_MAX_INVITES_CAP = 100;
|
||||
|
||||
export interface PlaytestPlatformConfig {
|
||||
readonly id: string;
|
||||
readonly label: string;
|
||||
/** Shown as the link input's placeholder / hint. */
|
||||
readonly urlPrefix: string;
|
||||
/** Authoritative validator. Must match the entire trimmed URL. */
|
||||
readonly urlPattern: RegExp;
|
||||
/** Per-platform invite ceiling. Always ≤ {@link PLAYTEST_MAX_INVITES_CAP}. */
|
||||
readonly maxInvites: number;
|
||||
}
|
||||
|
||||
export const PLAYTEST_PLATFORMS: readonly PlaytestPlatformConfig[] = [
|
||||
{
|
||||
id: "steam",
|
||||
label: "Steam Playtest",
|
||||
urlPrefix: "https://store.steampowered.com/app/",
|
||||
urlPattern: /^https:\/\/store\.steampowered\.com\/app\/\d+(?:\/[^\s]*)?$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
id: "epic",
|
||||
label: "Epic Games Store",
|
||||
urlPrefix: "https://store.epicgames.com/",
|
||||
urlPattern: /^https:\/\/store\.epicgames\.com\/[^\s]+$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
id: "itchio",
|
||||
label: "itch.io",
|
||||
urlPrefix: "https://<dev>.itch.io/<game>",
|
||||
urlPattern:
|
||||
/^https:\/\/[a-z0-9][a-z0-9-]*\.itch\.io\/[a-z0-9][a-z0-9_-]*\/?$/i,
|
||||
maxInvites: 50,
|
||||
},
|
||||
{
|
||||
id: "discord",
|
||||
label: "Discord / Community",
|
||||
urlPrefix: "https://discord.gg/",
|
||||
urlPattern: /^https:\/\/(?:discord\.gg|discord\.com\/invite)\/[^\s]+$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
{
|
||||
// Catch-all for signup forms, publisher beta pages, Google Forms, etc.
|
||||
// Pattern is intentionally loose (any HTTPS URL with a host).
|
||||
id: "other",
|
||||
label: "Other / Signup form",
|
||||
urlPrefix: "https://",
|
||||
urlPattern: /^https:\/\/[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+(?:\/[^\s]*)?$/i,
|
||||
maxInvites: 100,
|
||||
},
|
||||
] as const;
|
||||
|
||||
/** Default platform id used by a fresh draft / migration back-fill. */
|
||||
export const DEFAULT_PLAYTEST_PLATFORM = PLAYTEST_PLATFORMS[0]?.id ?? "steam";
|
||||
|
||||
/**
|
||||
* Invite ceiling for a platform id, capped at the absolute maximum.
|
||||
* Unknown ids (e.g. a hand-edited blob) fall back to the absolute cap.
|
||||
*/
|
||||
export function maxInvitesForPlatform(id: string): number {
|
||||
const found = PLAYTEST_PLATFORMS.find((p) => p.id === id);
|
||||
return Math.min(found?.maxInvites ?? PLAYTEST_MAX_INVITES_CAP, PLAYTEST_MAX_INVITES_CAP);
|
||||
}
|
||||
@@ -16,7 +16,8 @@ export const SOCIAL_FIELDS = [
|
||||
{ id: "mastodon", label: "Mastodon", labelKey: "social.mastodon", urlPrefix: "", category: "social" },
|
||||
{ id: "facebook", label: "Facebook", labelKey: "social.facebook", urlPrefix: "https://facebook.com/", category: "social" },
|
||||
{ id: "fb_page", label: "Facebook Page", labelKey: "social.fb_page", urlPrefix: "https://facebook.com/", category: "social" },
|
||||
{ id: "fb_group", label: "Facebook Group", labelKey: "social.fb_group", urlPrefix: "https://facebook.com/groups/", category: "social" },
|
||||
// Facebook Group moved to the Community section in v0.33.0 — it's now a
|
||||
// dedicated `facebookGroupLink` editor field (see CommunityEditor).
|
||||
{ id: "telegram", label: "Telegram", labelKey: "social.telegram", urlPrefix: "https://t.me/", category: "social" },
|
||||
{ id: "website", label: "Website", labelKey: "social.website", urlPrefix: "", category: "social" },
|
||||
] as const;
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { GeneratorInput, TranslationFn, CharLimitWarning } from "./types";
|
||||
import { YT_LIMITS } from "./types";
|
||||
import { PLATFORMS } from "@config/platforms";
|
||||
import { PLAYTEST_PLATFORMS } from "@config/playtest-platforms";
|
||||
import { SOCIAL_FIELDS } from "@config/social-fields";
|
||||
import { formatRigValue } from "@config/rig-fields";
|
||||
import { DEFAULT_GACHA_QUEST_TYPE } from "@config/gacha-quest-types";
|
||||
@@ -25,7 +26,6 @@ const SOCIAL_ICONS: Record<string, string> = {
|
||||
mastodon: "🐘",
|
||||
facebook: "👤",
|
||||
fb_page: "📄",
|
||||
fb_group: "👥",
|
||||
telegram: "✈️",
|
||||
website: "🌐",
|
||||
};
|
||||
@@ -260,6 +260,12 @@ export interface BuildDescriptionOptions {
|
||||
* `EN · output-language`. When omitted, the warnings block falls
|
||||
* back to single-language output via `t`. */
|
||||
tEn?: TranslationFn;
|
||||
/** When false, content warnings / tech notes / playthrough notes render
|
||||
* single-language even when `tEn` is provided; the translation-quality
|
||||
* disclaimer stays bilingual. Multi-language Output tabs pass false so
|
||||
* each (single-language) tab doesn't show `EN · LOCAL` content blocks.
|
||||
* Defaults to true. v0.29.3. */
|
||||
bilingualContentBlocks?: boolean;
|
||||
}
|
||||
|
||||
export function buildDescription(
|
||||
@@ -276,7 +282,12 @@ export function buildDescription(
|
||||
showGameCopyright = false,
|
||||
showTranslationQuality = false,
|
||||
tEn,
|
||||
bilingualContentBlocks = true,
|
||||
} = options;
|
||||
// Multi-language Output tabs set this false: each tab is one target
|
||||
// language, so the v0.11/v0.12 content blocks must NOT render `EN · LOCAL`.
|
||||
// The translation-quality disclaimer keeps the raw `tEn` and stays bilingual.
|
||||
const contentBlockTEn = bilingualContentBlocks ? tEn : undefined;
|
||||
const sections: string[] = [];
|
||||
const gameName =
|
||||
input.gameNameLocalized?.[input.language] ?? input.gameName;
|
||||
@@ -339,7 +350,7 @@ export function buildDescription(
|
||||
// are skipped; if every bullet is empty the whole block is skipped.
|
||||
// Bilingual when `tEn` is provided AND output language ≠ English —
|
||||
// pattern mirrors the v0.11 content-warnings block.
|
||||
const pnBlock = buildPlaythroughNotesSection(input, t, tEn);
|
||||
const pnBlock = buildPlaythroughNotesSection(input, t, contentBlockTEn);
|
||||
if (pnBlock) sections.push(pnBlock);
|
||||
|
||||
// 2. No Commentary tagline
|
||||
@@ -403,6 +414,29 @@ export function buildDescription(
|
||||
);
|
||||
}
|
||||
|
||||
// 4.7 Playtest / early access — opt-in access block (v0.30.0). Always
|
||||
// available in the editor; renders only when a link is entered, so
|
||||
// it follows the Store Links convention (localized heading + plain
|
||||
// link line, NOT bilingual). The platform label prefixes the link;
|
||||
// the optional invites line is gated on a positive integer so a
|
||||
// stray decimal / negative that slipped past the editor can never
|
||||
// produce a broken line.
|
||||
if (input.playtestLink && input.playtestLink.trim()) {
|
||||
const link = input.playtestLink.trim();
|
||||
const platformLabel = getLabelForId(
|
||||
input.playtestPlatform ?? "",
|
||||
PLAYTEST_PLATFORMS,
|
||||
);
|
||||
const lines = [`🧪 ${platformLabel}: ${link}`];
|
||||
const invites = input.playtestInvites ?? 0;
|
||||
if (Number.isInteger(invites) && invites > 0) {
|
||||
lines.push(
|
||||
t("description.sections.playtestInvites", { count: String(invites) }),
|
||||
);
|
||||
}
|
||||
sections.push(`${t("description.sections.playtest")}\n${lines.join("\n")}`);
|
||||
}
|
||||
|
||||
// 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
|
||||
@@ -508,7 +542,7 @@ export function buildDescription(
|
||||
"description.contentWarnings",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
contentBlockTEn,
|
||||
);
|
||||
if (cwSection) sections.push(cwSection);
|
||||
|
||||
@@ -521,7 +555,7 @@ export function buildDescription(
|
||||
"description.techNotes",
|
||||
input.language,
|
||||
t,
|
||||
tEn,
|
||||
contentBlockTEn,
|
||||
);
|
||||
if (tnSection) sections.push(tnSection);
|
||||
|
||||
@@ -632,6 +666,30 @@ export function buildDescription(
|
||||
sections.push(`${t("description.sections.social")}\n${socialEntries.join("\n")}`);
|
||||
}
|
||||
|
||||
// 10.5 Community — a single "💬 COMMUNITY" block for "join the chat"
|
||||
// invites. Messenger, Signal, Instagram (group chat) and Facebook Group
|
||||
// render for every language; the Zalo group is a Vietnam-audience app so
|
||||
// its line is gated on Vietnamese output (same rationale as the VN donate
|
||||
// block above). Line labels are fixed brand names (not localized), like
|
||||
// the rest of this block. The whole block is skipped when no eligible
|
||||
// link is present.
|
||||
const communityLines: string[] = [];
|
||||
const messenger = input.messengerCommunityLink?.trim() ?? "";
|
||||
if (messenger) communityLines.push(`💬 Messenger: ${messenger}`);
|
||||
const signal = input.signalGroupLink?.trim() ?? "";
|
||||
if (signal) communityLines.push(`🔒 Signal: ${signal}`);
|
||||
const instagram = input.instagramGroupLink?.trim() ?? "";
|
||||
if (instagram) communityLines.push(`📸 Instagram: ${instagram}`);
|
||||
const facebookGroup = input.facebookGroupLink?.trim() ?? "";
|
||||
if (facebookGroup) communityLines.push(`👥 Facebook Group: ${facebookGroup}`);
|
||||
const zalo = input.zaloGroupLink?.trim() ?? "";
|
||||
if (zalo && input.language === "vi") communityLines.push(`💙 Zalo: ${zalo}`);
|
||||
if (communityLines.length > 0) {
|
||||
sections.push(
|
||||
`${t("description.sections.community")}\n${communityLines.join("\n")}`,
|
||||
);
|
||||
}
|
||||
|
||||
// 11. Playlist
|
||||
if (input.playlistLink && input.playlistLink.trim()) {
|
||||
sections.push(t("description.sections.playlist", { link: input.playlistLink }));
|
||||
|
||||
@@ -21,6 +21,38 @@ export interface PlaylistInput {
|
||||
totalVideos?: number;
|
||||
storeLinks?: Partial<Record<string, string>>;
|
||||
playlistNote?: string;
|
||||
/**
|
||||
* Selected dropped-reason ids (see `@config/dropped-reasons`). Only
|
||||
* rendered when {@link status} is "dropped". v0.31.0
|
||||
*/
|
||||
droppedReasons?: string[];
|
||||
/** Free-text custom dropped reason, appended after the predefined ones. v0.31.0 */
|
||||
droppedReasonCustom?: string;
|
||||
/**
|
||||
* Playlist URL, reused from the editor store — drives the pinned-comment
|
||||
* "watch the full playlist" line. Empty/absent omits the line. v0.31.0
|
||||
*/
|
||||
playlistLink?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dropped-reason bullet lines, shared by the description and the comment.
|
||||
* Empty unless the playlist is actually dropped. Each predefined id resolves
|
||||
* via `playlist.droppedReasons.<id>`; an unresolved key (missing translation)
|
||||
* is skipped rather than printed raw. The free-text custom reason, when set,
|
||||
* is appended last.
|
||||
*/
|
||||
function buildDroppedReasonBullets(input: PlaylistInput, t: TranslationFn): string[] {
|
||||
if (input.status !== "dropped") return [];
|
||||
const bullets: string[] = [];
|
||||
for (const id of input.droppedReasons ?? []) {
|
||||
const key = `playlist.droppedReasons.${id}`;
|
||||
const label = t(key);
|
||||
if (label && label !== key) bullets.push(`• ${label}`);
|
||||
}
|
||||
const custom = input.droppedReasonCustom?.trim();
|
||||
if (custom) bullets.push(`• ${custom}`);
|
||||
return bullets;
|
||||
}
|
||||
|
||||
export function buildPlaylistTitle(input: PlaylistInput, t: TranslationFn): string {
|
||||
@@ -43,6 +75,15 @@ export function buildPlaylistDescription(input: PlaylistInput, t: TranslationFn)
|
||||
|
||||
lines.push("");
|
||||
|
||||
// Dropped reasons (v0.31.0) — only when the series is marked dropped and
|
||||
// at least one reason (predefined or custom) is present.
|
||||
const droppedBullets = buildDroppedReasonBullets(input, t);
|
||||
if (droppedBullets.length > 0) {
|
||||
lines.push(t("playlist.droppedHeading"));
|
||||
lines.push(...droppedBullets);
|
||||
lines.push("");
|
||||
}
|
||||
|
||||
if (input.totalVideos && input.totalVideos > 0) {
|
||||
lines.push(t("playlist.videoCount", { count: String(input.totalVideos) }));
|
||||
lines.push("");
|
||||
@@ -71,3 +112,42 @@ export function buildPlaylistDescription(input: PlaylistInput, t: TranslationFn)
|
||||
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Pinned-comment template for the playlist's most-recent video (v0.31.0).
|
||||
* Status-adaptive: the opening line changes per status, and a dropped
|
||||
* playlist appends its reasons. Mirrors {@link buildPinnedComment}'s idioms
|
||||
* — sub-key composition, `t(key) === key` missing-key fallback, blocks
|
||||
* joined by a blank line, "" when nothing renders. Pure.
|
||||
*/
|
||||
export function buildPlaylistComment(input: PlaylistInput, t: TranslationFn): string {
|
||||
const blocks: string[] = [];
|
||||
|
||||
const openingKey = `playlist.comment.opening.${input.status}`;
|
||||
const opening = t(openingKey, { gameName: input.gameName });
|
||||
if (opening && opening !== openingKey) blocks.push(opening);
|
||||
|
||||
if (input.totalVideos && input.totalVideos > 0) {
|
||||
const count = t("playlist.videoCount", { count: String(input.totalVideos) });
|
||||
if (count && count !== "playlist.videoCount") blocks.push(count);
|
||||
}
|
||||
|
||||
const link = input.playlistLink?.trim();
|
||||
if (link) {
|
||||
const linkLine = t("playlist.comment.playlistPrompt", { link });
|
||||
if (linkLine && linkLine !== "playlist.comment.playlistPrompt") blocks.push(linkLine);
|
||||
}
|
||||
|
||||
const droppedBullets = buildDroppedReasonBullets(input, t);
|
||||
if (droppedBullets.length > 0) {
|
||||
const introKey = "playlist.comment.droppedReasonsIntro";
|
||||
const intro = t(introKey);
|
||||
const introLine = intro && intro !== introKey ? `${intro}\n` : "";
|
||||
blocks.push(`${introLine}${droppedBullets.join("\n")}`);
|
||||
}
|
||||
|
||||
const engagement = t("playlist.comment.engagement");
|
||||
if (engagement && engagement !== "playlist.comment.engagement") blocks.push(engagement);
|
||||
|
||||
return blocks.filter((b) => b.trim() !== "").join("\n\n");
|
||||
}
|
||||
@@ -67,6 +67,14 @@ export interface RenderOptions extends TagOptions {
|
||||
* to single-language output via `t`.
|
||||
*/
|
||||
tEn?: TranslationFn;
|
||||
/**
|
||||
* When false, the three "video" content blocks (content warnings, tech
|
||||
* notes, playthrough notes) render single-language even though `tEn` is
|
||||
* supplied — used by the multi-language Output tabs, where each tab is
|
||||
* already a single target language. The AI-translation disclaimer is
|
||||
* unaffected and stays bilingual. Defaults to true. v0.29.3.
|
||||
*/
|
||||
bilingualContentBlocks?: boolean;
|
||||
}
|
||||
|
||||
export function renderAll(
|
||||
@@ -89,6 +97,7 @@ export function renderAll(
|
||||
showGameCopyright: options?.showGameCopyright,
|
||||
showTranslationQuality: options?.showTranslationQuality,
|
||||
tEn: options?.tEn,
|
||||
bilingualContentBlocks: options?.bilingualContentBlocks,
|
||||
});
|
||||
const tags = generateTags(input, options);
|
||||
const tagString = formatTagString(tags);
|
||||
|
||||
@@ -821,6 +821,38 @@ export interface GeneratorInput {
|
||||
vnBankHolder?: string;
|
||||
vnMomo?: string;
|
||||
vnZalopay?: string;
|
||||
/**
|
||||
* Playtest access (v0.30.0). When {@link playtestLink} is non-empty the
|
||||
* description emits a "🧪 PLAYTEST / EARLY ACCESS" block: a heading, the
|
||||
* link prefixed by the platform label, and an optional
|
||||
* "N invites available" line. {@link playtestPlatform} is a config id
|
||||
* (see `@config/playtest-platforms`); {@link playtestInvites} is
|
||||
* 0..100 (0 = unset → no count line). Always rendered when filled, like
|
||||
* store links — no settings toggle gates it.
|
||||
*/
|
||||
playtestLink?: string;
|
||||
playtestPlatform?: string;
|
||||
playtestInvites?: number;
|
||||
/**
|
||||
* Community invite links (v0.32.0). {@link messengerCommunityLink}
|
||||
* (`https://m.me/ch/<id>`) renders for every language; {@link zaloGroupLink}
|
||||
* (`https://zalo.me/g/<code>`) is gated on {@link language} === `"vi"`
|
||||
* (Zalo is a Vietnam-audience app). Both feed a single "💬 COMMUNITY"
|
||||
* block, which is omitted when it would be empty.
|
||||
*/
|
||||
messengerCommunityLink?: string;
|
||||
zaloGroupLink?: string;
|
||||
/**
|
||||
* More community invite links (v0.33.0), all rendered for every output
|
||||
* language into the same "💬 COMMUNITY" block. {@link signalGroupLink}
|
||||
* (`https://signal.group/#<id>`), {@link instagramGroupLink} (the IG
|
||||
* group-chat invite `https://www.instagram.com/j/<id>` or
|
||||
* `https://ig.me/j/<id>`), and {@link facebookGroupLink}
|
||||
* (`https://facebook.com/groups/<id>`, moved here from the Social block).
|
||||
*/
|
||||
signalGroupLink?: string;
|
||||
instagramGroupLink?: string;
|
||||
facebookGroupLink?: string;
|
||||
}
|
||||
|
||||
export interface GeneratorOutput {
|
||||
|
||||
@@ -94,6 +94,14 @@ export function buildGeneratorInputFromEditor(
|
||||
vnBankHolder: state.vnBankHolder,
|
||||
vnMomo: state.vnMomo,
|
||||
vnZalopay: state.vnZalopay,
|
||||
playtestLink: state.playtestLink,
|
||||
playtestPlatform: state.playtestPlatform,
|
||||
playtestInvites: state.playtestInvites,
|
||||
messengerCommunityLink: state.messengerCommunityLink,
|
||||
zaloGroupLink: state.zaloGroupLink,
|
||||
signalGroupLink: state.signalGroupLink,
|
||||
instagramGroupLink: state.instagramGroupLink,
|
||||
facebookGroupLink: state.facebookGroupLink,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,20 @@ export function useMultilangOutput(
|
||||
showUsagePolicy,
|
||||
showSponsorCredit,
|
||||
showGameCopyright,
|
||||
showThirdPartyAds,
|
||||
showTranslationQuality,
|
||||
titleFormat,
|
||||
} = useSettingsStore();
|
||||
|
||||
// Always-English `t` for the bilingual translation-quality disclaimer.
|
||||
// In multi-language tabs each tab is already a single target language, so
|
||||
// we pass `bilingualContentBlocks: false` below — `tEn` therefore drives
|
||||
// ONLY the AI-translation disclaimer here (content warnings / tech notes /
|
||||
// playthrough notes stay single-language per tab), unlike `useGeneratedOutput`
|
||||
// where `tEn` also makes those blocks bilingual `EN · LOCAL`. v0.29.3.
|
||||
// `en` is eagerly bundled, so it never needs the readiness gate.
|
||||
const tEn = useMemo(() => i18n.getFixedT("en", "templates"), []);
|
||||
|
||||
return useMemo(() => {
|
||||
const results: Record<string, GeneratorOutput> = {};
|
||||
if (!ready) return results;
|
||||
@@ -41,7 +52,11 @@ export function useMultilangOutput(
|
||||
showUsagePolicy,
|
||||
showSponsorCredit,
|
||||
showGameCopyright,
|
||||
showThirdPartyAds,
|
||||
showTranslationQuality,
|
||||
titleFormat,
|
||||
tEn,
|
||||
bilingualContentBlocks: false,
|
||||
});
|
||||
}
|
||||
return results;
|
||||
@@ -57,6 +72,9 @@ export function useMultilangOutput(
|
||||
showUsagePolicy,
|
||||
showSponsorCredit,
|
||||
showGameCopyright,
|
||||
showThirdPartyAds,
|
||||
showTranslationQuality,
|
||||
titleFormat,
|
||||
tEn,
|
||||
]);
|
||||
}
|
||||
@@ -47,6 +47,12 @@
|
||||
"timestamps", "timestampsPlaceholder",
|
||||
"storeLinks", "storeLinkType", "rig", "social", "warnings",
|
||||
"playlistLink", "playlistLinkPlaceholder",
|
||||
"community", "communityHelp",
|
||||
"messengerCommunityLink", "messengerCommunityLinkPlaceholder",
|
||||
"zaloGroupLink", "zaloGroupLinkPlaceholder",
|
||||
"signalGroupLink", "signalGroupLinkPlaceholder",
|
||||
"instagramGroupLink", "instagramGroupLinkPlaceholder",
|
||||
"facebookGroupLink", "facebookGroupLinkPlaceholder",
|
||||
"contactEmail", "contactEmailPlaceholder", "contactEmailHelp",
|
||||
"musicAttribution", "musicAttributionPlaceholder",
|
||||
"sponsorName", "sponsorNamePlaceholder",
|
||||
@@ -81,6 +87,7 @@
|
||||
"gpuMissingSeries", "gpuMissingModel", "gpuCustomEmpty",
|
||||
"ramMissingDdr", "ramMissingSize", "ramCustomEmpty"
|
||||
],
|
||||
"editor.playtest": ["heading", "linkLabel", "platformLabel", "invitesLabel", "invitesHelp"],
|
||||
"editor.playthroughOptions": ["none", "blind", "replay", "newgame_plus", "postgame"],
|
||||
"editor.difficultyOptions": ["none", "easy", "normal", "hard", "nightmare", "custom"],
|
||||
"editor.playthroughNotes": [
|
||||
@@ -151,7 +158,7 @@
|
||||
"storeLinkTypes": ["paid", "free", "demo"],
|
||||
"output": [
|
||||
"title", "description", "tags",
|
||||
"copyTitle", "copyDescription", "copyTags", "copyAll",
|
||||
"copyTitle", "copyDescription", "copyTags", "copyAll", "copyComment",
|
||||
"copied", "charCount", "selectLanguages",
|
||||
"thumbnailText", "copyThumbnailText",
|
||||
"pinnedComment", "copyPinnedComment",
|
||||
@@ -174,7 +181,7 @@
|
||||
"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": ["os", "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", "telegram"],
|
||||
"social": ["kofi", "patreon", "buymeacoffee", "paypal", "github", "twitter", "discord", "website", "twitch", "tiktok", "instagram", "streamlabs", "bluesky", "mastodon", "facebook", "fb_page", "telegram"],
|
||||
"resolutions": ["720p", "1080p", "1440p", "4K"],
|
||||
"fpsOptions": ["30", "60", "120", "144"],
|
||||
"profiles": ["title", "createNew", "editProfile", "profileName", "profileNamePlaceholder", "loadProfile", "deleteConfirm", "emptyState", "exportProfiles", "importProfiles", "thirdPartyAdText", "thirdPartyAdTextPlaceholder", "thirdPartyAdTextHelp"],
|
||||
@@ -186,9 +193,10 @@
|
||||
"socialPost": ["title", "single", "bulk", "copyCaption", "emptyState", "trimmedHint", "overLimitHint", "exported", "exportFailed", "imported", "importFailed", "importedHeading"],
|
||||
"socialPost.platforms": ["tiktok", "instagram_reels", "facebook_reels"],
|
||||
"shortcuts": ["title", "generate", "copyAll", "saveDraft", "toggleSidebar", "help", "close", "searchPlaceholder", "noResults"],
|
||||
"validation": ["emailInvalid", "emailMaxExceeded", "urlInvalid", "urlPrefixMismatch", "playlistUrlInvalid"],
|
||||
"validation": ["emailInvalid", "emailMaxExceeded", "urlInvalid", "urlPrefixMismatch", "playlistUrlInvalid", "messengerUrlInvalid", "zaloUrlInvalid", "signalUrlInvalid", "instagramInviteUrlInvalid", "facebookGroupUrlInvalid", "numberRequired", "numberInvalid", "numberNotInteger", "numberOutOfRange", "rangeEndBeforeStart", "rangeTooLarge"],
|
||||
"logs": ["title", "emptyState", "clearAll", "clearConfirm", "clearPersistedConfirm", "clearSession", "searchPlaceholder", "exportJson", "exportTxt", "sessionCurrent", "sessionLabel", "entriesShort"],
|
||||
"playlist": ["title", "status", "contentType", "totalVideos", "customNote", "generatePlaylist"]
|
||||
"playlist": ["title", "status", "contentType", "totalVideos", "customNote", "generatePlaylist", "droppedReasonsLabel", "droppedReasonCustomLabel", "droppedReasonCustomPlaceholder", "pinnedComment"],
|
||||
"playlist.droppedReasons": ["boring", "performance", "bugs", "delisted", "low_views", "time"]
|
||||
},
|
||||
"templates": {
|
||||
"title": ["separator", "suffix"],
|
||||
@@ -214,9 +222,10 @@
|
||||
],
|
||||
"description": ["noCommentaryLine"],
|
||||
"description.sections": [
|
||||
"timestamps", "storeLinksBuy", "storeLinksDownload", "gameCopyright", "videoSettings", "rig",
|
||||
"timestamps", "storeLinksBuy", "storeLinksDownload", "gameCopyright", "playtest", "playtestInvites", "videoSettings", "rig",
|
||||
"modList", "vnDonate",
|
||||
"sponsorCredit", "thirdPartyAds", "music", "donate", "social",
|
||||
"community",
|
||||
"playlist", "contact", "cta",
|
||||
"copyright", "usagePolicyHeader", "usagePolicy"
|
||||
],
|
||||
@@ -288,8 +297,11 @@
|
||||
],
|
||||
"hashtags": ["gameplay", "noCommentary", "genre"],
|
||||
"playlist.status": ["completed", "dropped", "incomplete", "in_progress"],
|
||||
"playlist": ["titleFormat", "videoCount", "storeSection", "footer"],
|
||||
"playlist": ["titleFormat", "videoCount", "storeSection", "footer", "droppedHeading"],
|
||||
"playlist.description": ["full_gameplay", "boss_fights", "speedrun", "all_endings", "dlc", "100_percent", "guide", "highlights"],
|
||||
"playlist.droppedReasons": ["boring", "performance", "bugs", "delisted", "low_views", "time"],
|
||||
"playlist.comment": ["playlistPrompt", "droppedReasonsIntro", "engagement"],
|
||||
"playlist.comment.opening": ["completed", "dropped", "incomplete", "in_progress"],
|
||||
"timeline.keywords": ["chapter", "part", "boss", "final_boss", "intro", "ending", "tutorial", "credits"]
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "free demo"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 PLAYTEST / EARLY ACCESS",
|
||||
"playtestInvites": "🎟️ {{count}} invites available — first come, first served",
|
||||
"timestamps": "⏱ TIMESTAMPS",
|
||||
"storeLinksBuy": "🎮 GET THE GAME (if you want to buy)",
|
||||
"storeLinksDownload": "⬇️ DOWNLOAD THE GAME (if you want to play)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 MUSIC / SOUND",
|
||||
"donate": "☕ SUPPORT THE CHANNEL",
|
||||
"social": "🔗 FOLLOW ME",
|
||||
"community": "💬 COMMUNITY / JOIN THE GROUP",
|
||||
"playlist": "▶️ Watch the full series: {{link}}",
|
||||
"contact": "📧 Business inquiries: {{email}}",
|
||||
"cta": "👍 Like | 🔔 Subscribe | ↗️ Share",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}} video(s)",
|
||||
"storeSection": "🎮 Get the game:",
|
||||
"footer": "👍 Like | 🔔 Subscribe for more gameplay!",
|
||||
"droppedHeading": "⚠️ Why this series was dropped:",
|
||||
"droppedReasons": {
|
||||
"boring": "Game got boring / lost interest",
|
||||
"performance": "Performance issues (lag, low FPS)",
|
||||
"bugs": "Too many bugs / crashes",
|
||||
"delisted": "Removed / delisted from store",
|
||||
"low_views": "Low views / engagement",
|
||||
"time": "No time / shifted priorities"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ The {{gameName}} series is complete — thanks for watching, No Commentary all the way! 🎮",
|
||||
"in_progress": "▶️ New {{gameName}} part is live! More episodes coming soon. 🎮",
|
||||
"incomplete": "🔄 The {{gameName}} playthrough continues — catch up on the series so far!",
|
||||
"dropped": "❌ Update on the {{gameName}} series: I've decided to drop this playthrough."
|
||||
},
|
||||
"playlistPrompt": "▶️ Watch the full playlist here: {{link}}",
|
||||
"droppedReasonsIntro": "Here's why:",
|
||||
"engagement": "👍 Drop a like & 🔔 subscribe for more No Commentary gameplay!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "This playlist contains the full gameplay of {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
|
||||
"boss_fights": "This playlist contains boss fights from {{gameName}} on {{channelName}}.\nNo Commentary — pure gameplay experience.",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "Playtest",
|
||||
"linkLabel": "Playtest link",
|
||||
"platformLabel": "Platform",
|
||||
"invitesLabel": "Invitations (max {{max}})",
|
||||
"invitesHelp": "How many playtest invites you have to give away (1–{{max}})."
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "Game Info",
|
||||
"videoSettings": "Video Settings",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "Content warnings",
|
||||
"playlistLink": "Playlist Link",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 Community",
|
||||
"communityHelp": "Links to your community chat. The Zalo group only shows when the content language is Vietnamese.",
|
||||
"messengerCommunityLink": "Messenger Community Link",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Zalo Group Link",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Signal Group Link",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Instagram Group Chat Link",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Facebook Group Link",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "Contact Email",
|
||||
"contactEmailPlaceholder": "business@example.com",
|
||||
"musicAttribution": "Music / Sound Attribution",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "Copy Description",
|
||||
"copyTags": "Copy Tags",
|
||||
"copyAll": "Copy All",
|
||||
"copyComment": "Copy comment",
|
||||
"copied": "Copied!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "Select Languages",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Facebook Page",
|
||||
"fb_group": "Facebook Group",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "No matching shortcuts"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "Enter a number.",
|
||||
"numberInvalid": "Enter a valid number.",
|
||||
"numberNotInteger": "Enter a whole number (no decimals).",
|
||||
"numberOutOfRange": "Enter a number between {{min}} and {{max}}.",
|
||||
"rangeEndBeforeStart": "End part ({{end}}) must be ≥ start part ({{start}}).",
|
||||
"rangeTooLarge": "Range too large — generate at most {{maxSpan}} parts at once.",
|
||||
"emailInvalid": "Invalid email: {{email}}",
|
||||
"emailMaxExceeded": "Maximum {{max}} emails allowed (currently {{count}})",
|
||||
"urlInvalid": "Invalid URL. Must start with https://",
|
||||
"urlPrefixMismatch": "Expected URL starting with {{expected}}",
|
||||
"playlistUrlInvalid": "Invalid YouTube playlist URL. Expected: {{expected}}"
|
||||
"playlistUrlInvalid": "Invalid YouTube playlist URL. Expected: {{expected}}",
|
||||
"messengerUrlInvalid": "Invalid Messenger link. Expected: {{expected}}",
|
||||
"zaloUrlInvalid": "Invalid Zalo group link. Expected: {{expected}}",
|
||||
"signalUrlInvalid": "Invalid Signal group link. Expected: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "Invalid Instagram group chat link. Expected: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "Invalid Facebook group link. Expected: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "Paid",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "Content Type",
|
||||
"totalVideos": "Total Videos",
|
||||
"customNote": "Custom Note",
|
||||
"generatePlaylist": "Generate Playlist"
|
||||
"generatePlaylist": "Generate Playlist",
|
||||
"droppedReasonsLabel": "Reasons for dropping",
|
||||
"droppedReasonCustomLabel": "Other reason (optional)",
|
||||
"droppedReasonCustomPlaceholder": "e.g. server shut down, lost the save file…",
|
||||
"pinnedComment": "Pinned Comment (latest video)",
|
||||
"droppedReasons": {
|
||||
"boring": "Game got boring / lost interest",
|
||||
"performance": "Performance issues (lag, low FPS)",
|
||||
"bugs": "Too many bugs / crashes",
|
||||
"delisted": "Removed / delisted from store",
|
||||
"low_views": "Low views / engagement",
|
||||
"time": "No time / shifted priorities"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "Logs",
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "demo gratis"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 PLAYTEST / ACCESO ANTICIPADO",
|
||||
"playtestInvites": "🎟️ {{count}} invitaciones disponibles — por orden de llegada",
|
||||
"timestamps": "⏱ MARCAS DE TIEMPO",
|
||||
"storeLinksBuy": "🎮 CONSIGUE EL JUEGO (si quieres comprarlo)",
|
||||
"storeLinksDownload": "⬇️ DESCARGA EL JUEGO (si quieres jugar)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 MÚSICA / SONIDO",
|
||||
"donate": "☕ APOYA EL CANAL",
|
||||
"social": "🔗 SÍGUEME",
|
||||
"community": "💬 COMUNIDAD / ÚNETE AL GRUPO",
|
||||
"playlist": "▶️ Ver la serie completa: {{link}}",
|
||||
"contact": "📧 Consultas comerciales: {{email}}",
|
||||
"cta": "👍 Me gusta | 🔔 Suscríbete | ↗️ Comparte",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}} video(s)",
|
||||
"storeSection": "🎮 Obtener el juego:",
|
||||
"footer": "👍 Me gusta | 🔔 ¡Suscríbete para más gameplay!",
|
||||
"droppedHeading": "⚠️ Por qué se abandonó esta serie:",
|
||||
"droppedReasons": {
|
||||
"boring": "El juego se volvió aburrido / perdí interés",
|
||||
"performance": "Problemas de rendimiento (lag, FPS bajos)",
|
||||
"bugs": "Demasiados errores / cierres",
|
||||
"delisted": "Eliminado / retirado de la tienda",
|
||||
"low_views": "Pocas visitas / interacción",
|
||||
"time": "Sin tiempo / cambio de prioridades"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ ¡La serie de {{gameName}} está completa! Gracias por ver, sin comentarios de principio a fin. 🎮",
|
||||
"in_progress": "▶️ ¡Nueva parte de {{gameName}} ya disponible! Más episodios muy pronto. 🎮",
|
||||
"incomplete": "🔄 La partida de {{gameName}} continúa: ¡ponte al día con la serie!",
|
||||
"dropped": "❌ Novedad sobre la serie de {{gameName}}: he decidido abandonar esta partida."
|
||||
},
|
||||
"playlistPrompt": "▶️ Mira la lista de reproducción completa aquí: {{link}}",
|
||||
"droppedReasonsIntro": "Estas son las razones:",
|
||||
"engagement": "👍 ¡Deja un like y 🔔 suscríbete para más gameplay sin comentarios!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "Esta playlist contiene el gameplay completo de {{gameName}} en {{channelName}}.\nSin comentarios — experiencia de juego pura.",
|
||||
"boss_fights": "Esta playlist contiene todas las peleas de jefes de {{gameName}} en {{channelName}}.\nSin comentarios.",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "Playtest",
|
||||
"linkLabel": "Enlace de playtest",
|
||||
"platformLabel": "Plataforma",
|
||||
"invitesLabel": "Invitaciones (máx. {{max}})",
|
||||
"invitesHelp": "Cuántas invitaciones de playtest tienes para repartir (1–{{max}})."
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "Info del Juego",
|
||||
"videoSettings": "Ajustes de Video",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "Advertencias de contenido",
|
||||
"playlistLink": "Enlace de Lista de Reproducción",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 Comunidad",
|
||||
"communityHelp": "Enlaces al chat de tu comunidad. El grupo de Zalo solo aparece cuando el idioma del contenido es vietnamita.",
|
||||
"messengerCommunityLink": "Enlace de comunidad de Messenger",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Enlace de grupo de Zalo",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Enlace de grupo de Signal",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Enlace de chat grupal de Instagram",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Enlace de grupo de Facebook",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "Correo de Contacto",
|
||||
"contactEmailPlaceholder": "negocios@ejemplo.com",
|
||||
"musicAttribution": "Crédito Musical / Sonidos",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "Copiar Descripción",
|
||||
"copyTags": "Copiar Etiquetas",
|
||||
"copyAll": "Copiar Todo",
|
||||
"copyComment": "Copiar comentario",
|
||||
"copied": "¡Copiado!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "Seleccionar Idiomas",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Página de Facebook",
|
||||
"fb_group": "Grupo de Facebook",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "No se encontraron atajos"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "Introduce un número.",
|
||||
"numberInvalid": "Introduce un número válido.",
|
||||
"numberNotInteger": "Introduce un número entero (sin decimales).",
|
||||
"numberOutOfRange": "Introduce un número entre {{min}} y {{max}}.",
|
||||
"rangeEndBeforeStart": "La parte final ({{end}}) debe ser ≥ la parte inicial ({{start}}).",
|
||||
"rangeTooLarge": "Rango demasiado grande: genera como máximo {{maxSpan}} partes a la vez.",
|
||||
"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}}",
|
||||
"playlistUrlInvalid": "URL de lista de reproducción de YouTube inválida. Se espera: {{expected}}"
|
||||
"playlistUrlInvalid": "URL de lista de reproducción de YouTube inválida. Se espera: {{expected}}",
|
||||
"messengerUrlInvalid": "Enlace de Messenger inválido. Se espera: {{expected}}",
|
||||
"zaloUrlInvalid": "Enlace de grupo de Zalo inválido. Se espera: {{expected}}",
|
||||
"signalUrlInvalid": "Enlace de grupo de Signal inválido. Se espera: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "Enlace de chat grupal de Instagram inválido. Se espera: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "Enlace de grupo de Facebook inválido. Se espera: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "De pago",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "Tipo de Contenido",
|
||||
"totalVideos": "Total de Videos",
|
||||
"customNote": "Nota Personal",
|
||||
"generatePlaylist": "Generar Playlist"
|
||||
"generatePlaylist": "Generar Playlist",
|
||||
"droppedReasonsLabel": "Razones para abandonar",
|
||||
"droppedReasonCustomLabel": "Otra razón (opcional)",
|
||||
"droppedReasonCustomPlaceholder": "p. ej. cerraron el servidor, perdí la partida guardada…",
|
||||
"pinnedComment": "Comentario fijado (último vídeo)",
|
||||
"droppedReasons": {
|
||||
"boring": "El juego se volvió aburrido / perdí interés",
|
||||
"performance": "Problemas de rendimiento (lag, FPS bajos)",
|
||||
"bugs": "Demasiados errores / cierres",
|
||||
"delisted": "Eliminado / retirado de la tienda",
|
||||
"low_views": "Pocas visitas / interacción",
|
||||
"time": "Sin tiempo / cambio de prioridades"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "Registros",
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "無料体験版"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 プレイテスト / 早期アクセス",
|
||||
"playtestInvites": "🎟️ 招待枠 残り {{count}} 件 — 先着順",
|
||||
"timestamps": "⏱ タイムスタンプ",
|
||||
"storeLinksBuy": "🎮 ゲームを購入 (応援したい方へ)",
|
||||
"storeLinksDownload": "⬇️ ゲームをダウンロード (遊びたい方へ)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 音楽・サウンド",
|
||||
"donate": "☕ チャンネルを応援",
|
||||
"social": "🔗 フォローする",
|
||||
"community": "💬 コミュニティ / グループに参加",
|
||||
"playlist": "▶️ シリーズ全体を見る:{{link}}",
|
||||
"contact": "📧 お仕事の依頼:{{email}}",
|
||||
"cta": "👍 いいね | 🔔 チャンネル登録 | ↗️ シェア",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}}本の動画",
|
||||
"storeSection": "🎮 ゲーム購入:",
|
||||
"footer": "👍 高評価 | 🔔 チャンネル登録お願いします!",
|
||||
"droppedHeading": "⚠️ このシリーズを中止した理由:",
|
||||
"droppedReasons": {
|
||||
"boring": "ゲームに飽きた / 興味を失った",
|
||||
"performance": "パフォーマンスの問題(ラグ、低FPS)",
|
||||
"bugs": "バグ / クラッシュが多すぎる",
|
||||
"delisted": "ストアから削除 / 配信終了",
|
||||
"low_views": "再生回数 / 反応が少ない",
|
||||
"time": "時間がない / 優先度の変更"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ {{gameName}} シリーズが完結しました — ノーコメンタリーで最後までご視聴ありがとうございました!🎮",
|
||||
"in_progress": "▶️ {{gameName}} の新しいパートを公開しました!続きもお楽しみに。🎮",
|
||||
"incomplete": "🔄 {{gameName}} のプレイはまだ続きます — これまでのシリーズもぜひチェックしてください!",
|
||||
"dropped": "❌ {{gameName}} シリーズについてのお知らせ:このプレイは中止することにしました。"
|
||||
},
|
||||
"playlistPrompt": "▶️ 再生リスト全体はこちら:{{link}}",
|
||||
"droppedReasonsIntro": "理由は次のとおりです:",
|
||||
"engagement": "👍 高評価&🔔 チャンネル登録で、ノーコメンタリー実況をもっとお楽しみください!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "このプレイリストは{{channelName}}での{{gameName}}のフルゲームプレイです。\n解説なし — 純粋なゲームプレイ体験。",
|
||||
"boss_fights": "このプレイリストは{{channelName}}での{{gameName}}のボス戦集です。\n解説なし — 純粋なゲームプレイ体験。",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "プレイテスト",
|
||||
"linkLabel": "プレイテストのリンク",
|
||||
"platformLabel": "プラットフォーム",
|
||||
"invitesLabel": "招待枠(最大 {{max}})",
|
||||
"invitesHelp": "配布できるプレイテスト招待の数(1〜{{max}})。"
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "ゲーム情報",
|
||||
"videoSettings": "動画設定",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "コンテンツ警告",
|
||||
"playlistLink": "プレイリストリンク",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 コミュニティ",
|
||||
"communityHelp": "コミュニティチャットへのリンク。Zaloグループはコンテンツ言語がベトナム語の場合のみ表示されます。",
|
||||
"messengerCommunityLink": "Messengerコミュニティリンク",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Zaloグループリンク",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Signalグループリンク",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Instagramグループチャットリンク",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Facebookグループリンク",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "連絡先メール",
|
||||
"contactEmailPlaceholder": "business@example.com",
|
||||
"musicAttribution": "音楽・サウンドクレジット",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "説明文をコピー",
|
||||
"copyTags": "タグをコピー",
|
||||
"copyAll": "全てコピー",
|
||||
"copyComment": "コメントをコピー",
|
||||
"copied": "コピーしました!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "言語を選択",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Facebookページ",
|
||||
"fb_group": "Facebookグループ",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "該当するショートカットはありません"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "数値を入力してください。",
|
||||
"numberInvalid": "正しい数値を入力してください。",
|
||||
"numberNotInteger": "整数を入力してください(小数は不可)。",
|
||||
"numberOutOfRange": "{{min}}〜{{max}}の数値を入力してください。",
|
||||
"rangeEndBeforeStart": "終了パート({{end}})は開始パート({{start}})以上にしてください。",
|
||||
"rangeTooLarge": "範囲が大きすぎます — 一度に生成できるのは最大{{maxSpan}}パートまでです。",
|
||||
"emailInvalid": "無効なメール: {{email}}",
|
||||
"emailMaxExceeded": "最大{{max}}件のメール (現在{{count}}件)",
|
||||
"urlInvalid": "無効なURL。https://で始める必要があります",
|
||||
"urlPrefixMismatch": "{{expected}}で始まるURLが必要です",
|
||||
"playlistUrlInvalid": "無効なYouTubeプレイリストURLです。期待される形式: {{expected}}"
|
||||
"playlistUrlInvalid": "無効なYouTubeプレイリストURLです。期待される形式: {{expected}}",
|
||||
"messengerUrlInvalid": "無効なMessengerリンクです。期待される形式: {{expected}}",
|
||||
"zaloUrlInvalid": "無効なZaloグループリンクです。期待される形式: {{expected}}",
|
||||
"signalUrlInvalid": "無効なSignalグループリンクです。期待される形式: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "無効なInstagramグループチャットリンクです。期待される形式: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "無効なFacebookグループリンクです。期待される形式: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "有料",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "コンテンツタイプ",
|
||||
"totalVideos": "動画総数",
|
||||
"customNote": "カスタムノート",
|
||||
"generatePlaylist": "プレイリスト生成"
|
||||
"generatePlaylist": "プレイリスト生成",
|
||||
"droppedReasonsLabel": "中止した理由",
|
||||
"droppedReasonCustomLabel": "その他の理由(任意)",
|
||||
"droppedReasonCustomPlaceholder": "例:サーバー終了、セーブデータ消失…",
|
||||
"pinnedComment": "固定コメント(最新動画用)",
|
||||
"droppedReasons": {
|
||||
"boring": "ゲームに飽きた / 興味を失った",
|
||||
"performance": "パフォーマンスの問題(ラグ、低FPS)",
|
||||
"bugs": "バグ / クラッシュが多すぎる",
|
||||
"delisted": "ストアから削除 / 配信終了",
|
||||
"low_views": "再生回数 / 反応が少ない",
|
||||
"time": "時間がない / 優先度の変更"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "ログ",
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "무료 데모"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 플레이테스트 / 앞서 해보기",
|
||||
"playtestInvites": "🎟️ 초대 {{count}}개 남음 — 선착순",
|
||||
"timestamps": "⏱ 타임스탬프",
|
||||
"storeLinksBuy": "🎮 게임 구매 (구매하고 싶다면)",
|
||||
"storeLinksDownload": "⬇️ 게임 다운로드 (플레이하고 싶다면)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 음악 / 사운드",
|
||||
"donate": "☕ 채널 후원",
|
||||
"social": "🔗 팔로우",
|
||||
"community": "💬 커뮤니티 / 그룹 참여",
|
||||
"playlist": "▶️ 전체 시리즈 보기: {{link}}",
|
||||
"contact": "📧 비즈니스 문의: {{email}}",
|
||||
"cta": "👍 좋아요 | 🔔 구독 | ↗️ 공유",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}}개 영상",
|
||||
"storeSection": "🎮 게임 구매:",
|
||||
"footer": "👍 좋아요 | 🔔 구독 부탁드립니다!",
|
||||
"droppedHeading": "⚠️ 이 시리즈를 중단한 이유:",
|
||||
"droppedReasons": {
|
||||
"boring": "게임이 지루해짐 / 흥미 상실",
|
||||
"performance": "성능 문제 (렉, 낮은 FPS)",
|
||||
"bugs": "버그 / 크래시가 너무 많음",
|
||||
"delisted": "스토어에서 삭제 / 판매 종료",
|
||||
"low_views": "조회수 / 반응 저조",
|
||||
"time": "시간 부족 / 우선순위 변경"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ {{gameName}} 시리즈가 완결되었습니다 — 무해설로 끝까지 시청해 주셔서 감사합니다! 🎮",
|
||||
"in_progress": "▶️ {{gameName}} 새로운 파트가 올라왔습니다! 다음 편도 곧 찾아올게요. 🎮",
|
||||
"incomplete": "🔄 {{gameName}} 플레이는 계속됩니다 — 지난 시리즈도 확인해 보세요!",
|
||||
"dropped": "❌ {{gameName}} 시리즈 관련 소식: 이 플레이를 중단하기로 했습니다."
|
||||
},
|
||||
"playlistPrompt": "▶️ 전체 재생목록은 여기에서: {{link}}",
|
||||
"droppedReasonsIntro": "이유는 다음과 같습니다:",
|
||||
"engagement": "👍 좋아요와 🔔 구독으로 더 많은 무해설 게임플레이를 만나보세요!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 전체 게임플레이입니다.\n해설 없음 — 순수한 게임플레이 경험.",
|
||||
"boss_fights": "이 플레이리스트는 {{channelName}}에서 {{gameName}}의 모든 보스전을 담고 있습니다.\n해설 없음.",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "플레이테스트",
|
||||
"linkLabel": "플레이테스트 링크",
|
||||
"platformLabel": "플랫폼",
|
||||
"invitesLabel": "초대 수 (최대 {{max}})",
|
||||
"invitesHelp": "나눠줄 수 있는 플레이테스트 초대 수 (1–{{max}})."
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "게임 정보",
|
||||
"videoSettings": "비디오 설정",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "콘텐츠 경고",
|
||||
"playlistLink": "재생목록 링크",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 커뮤니티",
|
||||
"communityHelp": "커뮤니티 채팅 링크입니다. Zalo 그룹은 콘텐츠 언어가 베트남어일 때만 표시됩니다.",
|
||||
"messengerCommunityLink": "Messenger 커뮤니티 링크",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Zalo 그룹 링크",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Signal 그룹 링크",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Instagram 그룹 채팅 링크",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Facebook 그룹 링크",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "문의 이메일",
|
||||
"contactEmailPlaceholder": "business@example.com",
|
||||
"musicAttribution": "음악 / 사운드 크레딧",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "설명 복사",
|
||||
"copyTags": "태그 복사",
|
||||
"copyAll": "전체 복사",
|
||||
"copyComment": "댓글 복사",
|
||||
"copied": "복사 완료!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "언어 선택",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Facebook 페이지",
|
||||
"fb_group": "Facebook 그룹",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "일치하는 단축키 없음"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "숫자를 입력하세요.",
|
||||
"numberInvalid": "올바른 숫자를 입력하세요.",
|
||||
"numberNotInteger": "정수를 입력하세요 (소수 불가).",
|
||||
"numberOutOfRange": "{{min}}에서 {{max}} 사이의 숫자를 입력하세요.",
|
||||
"rangeEndBeforeStart": "끝 파트({{end}})는 시작 파트({{start}}) 이상이어야 합니다.",
|
||||
"rangeTooLarge": "범위가 너무 큽니다 — 한 번에 최대 {{maxSpan}}개 파트까지 생성할 수 있습니다.",
|
||||
"emailInvalid": "잘못된 이메일: {{email}}",
|
||||
"emailMaxExceeded": "최대 {{max}}개 이메일 허용 (현재 {{count}}개)",
|
||||
"urlInvalid": "잘못된 URL입니다. https://로 시작해야 합니다",
|
||||
"urlPrefixMismatch": "{{expected}}로 시작하는 URL이 필요합니다",
|
||||
"playlistUrlInvalid": "잘못된 YouTube 재생목록 URL입니다. 예상 형식: {{expected}}"
|
||||
"playlistUrlInvalid": "잘못된 YouTube 재생목록 URL입니다. 예상 형식: {{expected}}",
|
||||
"messengerUrlInvalid": "잘못된 Messenger 링크입니다. 예상 형식: {{expected}}",
|
||||
"zaloUrlInvalid": "잘못된 Zalo 그룹 링크입니다. 예상 형식: {{expected}}",
|
||||
"signalUrlInvalid": "잘못된 Signal 그룹 링크입니다. 예상 형식: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "잘못된 Instagram 그룹 채팅 링크입니다. 예상 형식: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "잘못된 Facebook 그룹 링크입니다. 예상 형식: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "유료",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "콘텐츠 유형",
|
||||
"totalVideos": "총 영상 수",
|
||||
"customNote": "사용자 메모",
|
||||
"generatePlaylist": "플레이리스트 생성"
|
||||
"generatePlaylist": "플레이리스트 생성",
|
||||
"droppedReasonsLabel": "중단한 이유",
|
||||
"droppedReasonCustomLabel": "기타 이유 (선택)",
|
||||
"droppedReasonCustomPlaceholder": "예: 서버 종료, 세이브 파일 분실…",
|
||||
"pinnedComment": "고정 댓글 (최신 영상용)",
|
||||
"droppedReasons": {
|
||||
"boring": "게임이 지루해짐 / 흥미 상실",
|
||||
"performance": "성능 문제 (렉, 낮은 FPS)",
|
||||
"bugs": "버그 / 크래시가 너무 많음",
|
||||
"delisted": "스토어에서 삭제 / 판매 종료",
|
||||
"low_views": "조회수 / 반응 저조",
|
||||
"time": "시간 부족 / 우선순위 변경"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "로그",
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "demo miễn phí"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 PLAYTEST / TRẢI NGHIỆM SỚM",
|
||||
"playtestInvites": "🎟️ Còn {{count}} lời mời — ai nhanh tay người đó được",
|
||||
"timestamps": "⏱ MỐC THỜI GIAN",
|
||||
"storeLinksBuy": "🎮 MUA GAME (nếu bạn muốn ủng hộ)",
|
||||
"storeLinksDownload": "⬇️ TẢI GAME (nếu bạn muốn chơi)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 NHẠC / ÂM THANH",
|
||||
"donate": "☕ ỦNG HỘ KÊNH",
|
||||
"social": "🔗 THEO DÕI MÌNH",
|
||||
"community": "💬 CỘNG ĐỒNG / THAM GIA NHÓM",
|
||||
"playlist": "▶️ Xem toàn bộ series: {{link}}",
|
||||
"contact": "📧 Liên hệ hợp tác: {{email}}",
|
||||
"cta": "👍 Like | 🔔 Đăng ký | ↗️ Chia sẻ",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}} video",
|
||||
"storeSection": "🎮 Tải / mua game:",
|
||||
"footer": "👍 Like | 🔔 Subscribe để xem thêm gameplay!",
|
||||
"droppedHeading": "⚠️ Vì sao series này bị dừng:",
|
||||
"droppedReasons": {
|
||||
"boring": "Game nhàm chán / mất hứng thú",
|
||||
"performance": "Vấn đề hiệu năng (lag, FPS thấp)",
|
||||
"bugs": "Quá nhiều lỗi / crash",
|
||||
"delisted": "Bị gỡ / khai tử khỏi store",
|
||||
"low_views": "Lượt xem / tương tác thấp",
|
||||
"time": "Không có thời gian / đổi ưu tiên"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ Series {{gameName}} đã hoàn thành — cảm ơn các bạn đã theo dõi, No Commentary trọn vẹn! 🎮",
|
||||
"in_progress": "▶️ Phần mới của {{gameName}} đã lên sóng! Các tập tiếp theo sẽ sớm ra mắt. 🎮",
|
||||
"incomplete": "🔄 Series {{gameName}} vẫn đang tiếp tục — xem lại các phần trước nhé!",
|
||||
"dropped": "❌ Cập nhật về series {{gameName}}: mình quyết định dừng playthrough này."
|
||||
},
|
||||
"playlistPrompt": "▶️ Xem toàn bộ playlist tại đây: {{link}}",
|
||||
"droppedReasonsIntro": "Lý do là:",
|
||||
"engagement": "👍 Để lại một like & 🔔 đăng ký kênh để xem thêm gameplay No Commentary nhé!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "Playlist này là toàn bộ gameplay của game {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
|
||||
"boss_fights": "Playlist này là tổng hợp các trận đánh boss trong {{gameName}} trên kênh {{channelName}}.\nKhông bình luận — chỉ có gameplay thuần túy.",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "Playtest",
|
||||
"linkLabel": "Link playtest",
|
||||
"platformLabel": "Nền tảng",
|
||||
"invitesLabel": "Số lời mời (tối đa {{max}})",
|
||||
"invitesHelp": "Bạn có bao nhiêu lời mời playtest để tặng (1–{{max}})."
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "Thông tin game",
|
||||
"videoSettings": "Cài đặt video",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "Cảnh báo nội dung",
|
||||
"playlistLink": "Link Playlist",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 Cộng đồng",
|
||||
"communityHelp": "Link nhóm chat cộng đồng. Nhóm Zalo chỉ hiển thị khi ngôn ngữ nội dung là Tiếng Việt.",
|
||||
"messengerCommunityLink": "Link cộng đồng Messenger",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Link nhóm Zalo",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Link nhóm Signal",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Link nhóm chat Instagram",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Link nhóm Facebook",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "Email liên hệ",
|
||||
"contactEmailPlaceholder": "business@example.com",
|
||||
"musicAttribution": "Credit nhạc / âm thanh",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "Sao chép mô tả",
|
||||
"copyTags": "Sao chép tags",
|
||||
"copyAll": "Sao chép tất cả",
|
||||
"copyComment": "Sao chép comment",
|
||||
"copied": "Đã sao chép!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "Chọn ngôn ngữ",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Facebook Page",
|
||||
"fb_group": "Facebook Group",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "Không có phím tắt phù hợp"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "Hãy nhập một số.",
|
||||
"numberInvalid": "Hãy nhập một số hợp lệ.",
|
||||
"numberNotInteger": "Hãy nhập số nguyên (không có số thập phân).",
|
||||
"numberOutOfRange": "Hãy nhập số trong khoảng {{min}} đến {{max}}.",
|
||||
"rangeEndBeforeStart": "Phần cuối ({{end}}) phải ≥ phần đầu ({{start}}).",
|
||||
"rangeTooLarge": "Khoảng quá lớn — chỉ tạo tối đa {{maxSpan}} phần mỗi lần.",
|
||||
"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}}",
|
||||
"playlistUrlInvalid": "URL playlist YouTube không hợp lệ. Định dạng mong muốn: {{expected}}"
|
||||
"playlistUrlInvalid": "URL playlist YouTube không hợp lệ. Định dạng mong muốn: {{expected}}",
|
||||
"messengerUrlInvalid": "Link Messenger không hợp lệ. Định dạng mong muốn: {{expected}}",
|
||||
"zaloUrlInvalid": "Link nhóm Zalo không hợp lệ. Định dạng mong muốn: {{expected}}",
|
||||
"signalUrlInvalid": "Link nhóm Signal không hợp lệ. Định dạng mong muốn: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "Link nhóm chat Instagram không hợp lệ. Định dạng mong muốn: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "Link nhóm Facebook không hợp lệ. Định dạng mong muốn: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "Trả phí",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "Loại nội dung",
|
||||
"totalVideos": "Tổng video",
|
||||
"customNote": "Ghi chú",
|
||||
"generatePlaylist": "Tạo Playlist"
|
||||
"generatePlaylist": "Tạo Playlist",
|
||||
"droppedReasonsLabel": "Lý do dừng series",
|
||||
"droppedReasonCustomLabel": "Lý do khác (tùy chọn)",
|
||||
"droppedReasonCustomPlaceholder": "vd: server đóng cửa, mất file save…",
|
||||
"pinnedComment": "Comment ghim (video mới nhất)",
|
||||
"droppedReasons": {
|
||||
"boring": "Game nhàm chán / mất hứng thú",
|
||||
"performance": "Vấn đề hiệu năng (lag, FPS thấp)",
|
||||
"bugs": "Quá nhiều lỗi / crash",
|
||||
"delisted": "Bị gỡ / khai tử khỏi store",
|
||||
"low_views": "Lượt xem / tương tác thấp",
|
||||
"time": "Không có thời gian / đổi ưu tiên"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "Nhật ký",
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
"demo": "免费试玩"
|
||||
},
|
||||
"sections": {
|
||||
"playtest": "🧪 试玩测试 / 抢先体验",
|
||||
"playtestInvites": "🎟️ 剩余 {{count}} 个名额 — 先到先得",
|
||||
"timestamps": "⏱ 时间戳",
|
||||
"storeLinksBuy": "🎮 获取游戏 (如果你想购买)",
|
||||
"storeLinksDownload": "⬇️ 下载游戏 (如果你想游玩)",
|
||||
@@ -118,6 +120,7 @@
|
||||
"music": "🎵 音乐 / 音效",
|
||||
"donate": "☕ 支持频道",
|
||||
"social": "🔗 关注我",
|
||||
"community": "💬 社区 / 加入群组",
|
||||
"playlist": "▶️ 观看完整系列:{{link}}",
|
||||
"contact": "📧 商务合作:{{email}}",
|
||||
"cta": "👍 点赞 | 🔔 订阅 | ↗️ 分享",
|
||||
@@ -610,6 +613,26 @@
|
||||
"videoCount": "📹 {{count}}个视频",
|
||||
"storeSection": "🎮 获取游戏:",
|
||||
"footer": "👍 点赞 | 🔔 订阅获取更多游戏实况!",
|
||||
"droppedHeading": "⚠️ 这个系列弃坑的原因:",
|
||||
"droppedReasons": {
|
||||
"boring": "游戏变无聊 / 失去兴趣",
|
||||
"performance": "性能问题(卡顿、低帧率)",
|
||||
"bugs": "太多 bug / 崩溃",
|
||||
"delisted": "已从商店下架 / 停售",
|
||||
"low_views": "播放量 / 互动太低",
|
||||
"time": "没时间 / 优先级改变"
|
||||
},
|
||||
"comment": {
|
||||
"opening": {
|
||||
"completed": "✅ {{gameName}} 系列已完结——感谢观看,全程无解说!🎮",
|
||||
"in_progress": "▶️ {{gameName}} 新一期已上线!更多内容敬请期待。🎮",
|
||||
"incomplete": "🔄 {{gameName}} 的流程仍在继续——快来补看之前的系列吧!",
|
||||
"dropped": "❌ 关于 {{gameName}} 系列的更新:我决定弃坑这个流程。"
|
||||
},
|
||||
"playlistPrompt": "▶️ 在此观看完整播放列表:{{link}}",
|
||||
"droppedReasonsIntro": "原因如下:",
|
||||
"engagement": "👍 点个赞并 🔔 订阅,观看更多无解说游戏实况!"
|
||||
},
|
||||
"description": {
|
||||
"full_gameplay": "本播放列表包含{{channelName}}的{{gameName}}完整游戏实况。\n无解说 — 纯粹的游戏体验。",
|
||||
"boss_fights": "本播放列表包含{{channelName}}的{{gameName}}全部Boss战。\n无解说。",
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
"playtest": {
|
||||
"heading": "试玩测试",
|
||||
"linkLabel": "试玩测试链接",
|
||||
"platformLabel": "平台",
|
||||
"invitesLabel": "邀请数量(最多 {{max}})",
|
||||
"invitesHelp": "你有多少个试玩测试邀请可以送出(1–{{max}})。"
|
||||
},
|
||||
"sections": {
|
||||
"gameInfo": "游戏信息",
|
||||
"videoSettings": "视频设置",
|
||||
@@ -285,6 +292,18 @@
|
||||
"warnings": "内容警告",
|
||||
"playlistLink": "播放列表链接",
|
||||
"playlistLinkPlaceholder": "https://youtube.com/playlist?list=...",
|
||||
"community": "💬 社区",
|
||||
"communityHelp": "社区聊天链接。Zalo 群仅在内容语言为越南语时显示。",
|
||||
"messengerCommunityLink": "Messenger 社区链接",
|
||||
"messengerCommunityLinkPlaceholder": "https://m.me/ch/yourid",
|
||||
"zaloGroupLink": "Zalo 群链接",
|
||||
"zaloGroupLinkPlaceholder": "https://zalo.me/g/xxxxxx",
|
||||
"signalGroupLink": "Signal 群组链接",
|
||||
"signalGroupLinkPlaceholder": "https://signal.group/#yourid",
|
||||
"instagramGroupLink": "Instagram 群聊链接",
|
||||
"instagramGroupLinkPlaceholder": "https://ig.me/j/yourid",
|
||||
"facebookGroupLink": "Facebook 群组链接",
|
||||
"facebookGroupLinkPlaceholder": "https://facebook.com/groups/yourid",
|
||||
"contactEmail": "联系邮箱",
|
||||
"contactEmailPlaceholder": "business@example.com",
|
||||
"musicAttribution": "音乐 / 音效署名",
|
||||
@@ -713,6 +732,7 @@
|
||||
"copyDescription": "复制描述",
|
||||
"copyTags": "复制标签",
|
||||
"copyAll": "复制全部",
|
||||
"copyComment": "复制评论",
|
||||
"copied": "已复制!",
|
||||
"charCount": "{{count}}/{{limit}}",
|
||||
"selectLanguages": "选择语言",
|
||||
@@ -894,7 +914,6 @@
|
||||
"mastodon": "Mastodon",
|
||||
"facebook": "Facebook",
|
||||
"fb_page": "Facebook主页",
|
||||
"fb_group": "Facebook群组",
|
||||
"telegram": "Telegram"
|
||||
},
|
||||
"resolutions": {
|
||||
@@ -1047,11 +1066,22 @@
|
||||
"noResults": "未找到快捷键"
|
||||
},
|
||||
"validation": {
|
||||
"numberRequired": "请输入一个数字。",
|
||||
"numberInvalid": "请输入有效的数字。",
|
||||
"numberNotInteger": "请输入整数(不能有小数)。",
|
||||
"numberOutOfRange": "请输入 {{min}} 到 {{max}} 之间的数字。",
|
||||
"rangeEndBeforeStart": "结束分集({{end}})必须 ≥ 起始分集({{start}})。",
|
||||
"rangeTooLarge": "范围太大 — 每次最多生成 {{maxSpan}} 个分集。",
|
||||
"emailInvalid": "无效邮箱: {{email}}",
|
||||
"emailMaxExceeded": "最多允许{{max}}个邮箱 (当前{{count}}个)",
|
||||
"urlInvalid": "无效URL。必须以https://开头",
|
||||
"urlPrefixMismatch": "URL应以{{expected}}开头",
|
||||
"playlistUrlInvalid": "无效的YouTube播放列表URL。期望格式: {{expected}}"
|
||||
"playlistUrlInvalid": "无效的YouTube播放列表URL。期望格式: {{expected}}",
|
||||
"messengerUrlInvalid": "无效的Messenger链接。期望格式: {{expected}}",
|
||||
"zaloUrlInvalid": "无效的Zalo群链接。期望格式: {{expected}}",
|
||||
"signalUrlInvalid": "无效的Signal群组链接。期望格式: {{expected}}",
|
||||
"instagramInviteUrlInvalid": "无效的Instagram群聊链接。期望格式: {{expected}}",
|
||||
"facebookGroupUrlInvalid": "无效的Facebook群组链接。期望格式: {{expected}}"
|
||||
},
|
||||
"storeLinkTypes": {
|
||||
"paid": "付费",
|
||||
@@ -1064,7 +1094,19 @@
|
||||
"contentType": "内容类型",
|
||||
"totalVideos": "视频总数",
|
||||
"customNote": "自定义备注",
|
||||
"generatePlaylist": "生成播放列表"
|
||||
"generatePlaylist": "生成播放列表",
|
||||
"droppedReasonsLabel": "弃坑原因",
|
||||
"droppedReasonCustomLabel": "其他原因(可选)",
|
||||
"droppedReasonCustomPlaceholder": "例如:服务器关闭、存档丢失……",
|
||||
"pinnedComment": "置顶评论(最新视频)",
|
||||
"droppedReasons": {
|
||||
"boring": "游戏变无聊 / 失去兴趣",
|
||||
"performance": "性能问题(卡顿、低帧率)",
|
||||
"bugs": "太多 bug / 崩溃",
|
||||
"delisted": "已从商店下架 / 停售",
|
||||
"low_views": "播放量 / 互动太低",
|
||||
"time": "没时间 / 优先级改变"
|
||||
}
|
||||
},
|
||||
"logs": {
|
||||
"title": "日志",
|
||||
|
||||
+35
-6
@@ -14,6 +14,7 @@ import { buildPinnedComment } from "@engine/pinned-comment-builder";
|
||||
import { YT_LIMITS } from "@engine/types";
|
||||
import type { GeneratorOutput, SupportedLanguage } from "@engine/types";
|
||||
import { useCurrentGeneratorInput } from "@hooks/use-current-generator-input";
|
||||
import { validateBatchRange } from "@utils/validation";
|
||||
import clsx from "clsx";
|
||||
|
||||
interface BatchLanguageRow {
|
||||
@@ -53,6 +54,16 @@ export function BatchPage() {
|
||||
const [results, setResults] = useState<BatchResult[]>([]);
|
||||
const [generating, setGenerating] = useState(false);
|
||||
|
||||
// Block generation on an invalid part range: negative / decimal / NaN
|
||||
// endpoints, end < start, or a span over 100 parts (the loop's hard cap).
|
||||
const rangeResult = useMemo(
|
||||
() => validateBatchRange(startPart, endPart, { maxSpan: 100 }),
|
||||
[startPart, endPart],
|
||||
);
|
||||
const rangeError = rangeResult.valid
|
||||
? undefined
|
||||
: t(rangeResult.error ?? "", rangeResult.errorParams);
|
||||
|
||||
const toggleLang = (lang: SupportedLanguage) => {
|
||||
setSelectedLangs((prev) => {
|
||||
if (prev.includes(lang)) {
|
||||
@@ -137,7 +148,7 @@ export function BatchPage() {
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-4xl p-6">
|
||||
<div className="mx-auto max-w-4xl p-4 sm:p-6">
|
||||
<h1 className="mb-4 text-lg font-bold text-text-primary">{t("batch.title")}</h1>
|
||||
|
||||
{/* Language selector */}
|
||||
@@ -163,26 +174,44 @@ export function BatchPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mb-6 flex items-end gap-4">
|
||||
<div className="mb-2 flex flex-col gap-3 sm:flex-row sm:items-end sm:gap-4">
|
||||
<Input
|
||||
label={t("batch.startPart")}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
error={!rangeResult.valid}
|
||||
value={startPart}
|
||||
onChange={(e) => setStartPart(e.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("batch.endPart")}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
error={!rangeResult.valid}
|
||||
value={endPart}
|
||||
onChange={(e) => setEndPart(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
className="w-full sm:w-auto"
|
||||
onClick={() => void handleGenerate()}
|
||||
disabled={!state.gameName || generating}
|
||||
disabled={!state.gameName || generating || !rangeResult.valid}
|
||||
>
|
||||
{t("batch.generateBatch")}
|
||||
</Button>
|
||||
</div>
|
||||
{rangeError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="mb-6 rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning"
|
||||
>
|
||||
{rangeError}
|
||||
</p>
|
||||
)}
|
||||
{!rangeError && <div className="mb-6" />}
|
||||
|
||||
{results.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
@@ -190,7 +219,7 @@ export function BatchPage() {
|
||||
</p>
|
||||
) : (
|
||||
<>
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div className="mb-4 flex flex-wrap items-center justify-between gap-2">
|
||||
<span className="text-sm text-text-secondary">
|
||||
{results.length} parts x {selectedLangs.length} languages
|
||||
</span>
|
||||
@@ -205,7 +234,7 @@ export function BatchPage() {
|
||||
<div className="flex flex-col gap-3">
|
||||
{result.languages.map((lang) => (
|
||||
<div key={lang.language} className="rounded-lg bg-surface-2 p-3">
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<div className="mb-1 flex flex-wrap items-center justify-between gap-2">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
{lang.language.toUpperCase()}
|
||||
</span>
|
||||
@@ -220,7 +249,7 @@ export function BatchPage() {
|
||||
<pre className="mb-2 max-h-20 overflow-y-auto whitespace-pre-wrap font-sans text-xs text-text-secondary">
|
||||
{lang.output.description.slice(0, 200)}...
|
||||
</pre>
|
||||
<div className="flex gap-2">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<CopyButton text={lang.output.description} label={t("output.copyDescription")} />
|
||||
<CopyButton text={lang.output.tagString} label={t("output.copyTags")} />
|
||||
{lang.pinnedComment && (
|
||||
|
||||
@@ -6,9 +6,11 @@ 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 { PlaytestEditor } from "@components/editor/PlaytestEditor";
|
||||
import { RigEditor } from "@components/editor/RigEditor";
|
||||
import { SocialEditor } from "@components/editor/SocialEditor";
|
||||
import { VietnameseDonateEditor } from "@components/editor/VietnameseDonateEditor";
|
||||
import { CommunityEditor } from "@components/editor/CommunityEditor";
|
||||
import { ContentWarningChecklist } from "@components/editor/ContentWarningChecklist";
|
||||
import { PlaythroughNotesForm } from "@components/editor/PlaythroughNotesForm";
|
||||
import { TechNotesChecklist } from "@components/editor/TechNotesChecklist";
|
||||
@@ -152,7 +154,9 @@ export function EditorPage() {
|
||||
onToggle={() => toggleAccordion("storeAndSocial")}
|
||||
>
|
||||
<StoreLinkEditor />
|
||||
<PlaytestEditor />
|
||||
<SocialEditor />
|
||||
<CommunityEditor />
|
||||
<VietnameseDonateEditor />
|
||||
</Accordion>
|
||||
</div>
|
||||
|
||||
@@ -9,15 +9,18 @@ import { ChipGroup } from "@components/ui/ChipGroup";
|
||||
import { Select } from "@components/ui/Select";
|
||||
import { CopyButton } from "@components/output/CopyButton";
|
||||
import { useEditorStore } from "@store/editor-store";
|
||||
import { validateIntegerInRange } from "@utils/validation";
|
||||
import { SUPPORTED_LANGUAGES } from "@i18n/index";
|
||||
import { useLanguagesReady } from "@hooks/use-languages-ready";
|
||||
import {
|
||||
buildPlaylistTitle,
|
||||
buildPlaylistDescription,
|
||||
buildPlaylistComment,
|
||||
type PlaylistStatus,
|
||||
type PlaylistContentType,
|
||||
type PlaylistInput,
|
||||
} from "@engine/playlist-builder";
|
||||
import { DROPPED_REASONS } from "@config/dropped-reasons";
|
||||
import type { SupportedLanguage } from "@engine/types";
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
@@ -47,6 +50,8 @@ export function PlaylistPage() {
|
||||
const [contentType, setContentType] = useState<PlaylistContentType>("full_gameplay");
|
||||
const [totalVideos, setTotalVideos] = useState("");
|
||||
const [customNote, setCustomNote] = useState("");
|
||||
const [droppedReasons, setDroppedReasons] = useState<string[]>([]);
|
||||
const [droppedReasonCustom, setDroppedReasonCustom] = useState("");
|
||||
const [language, setLanguage] = useState<SupportedLanguage>(editor.language);
|
||||
|
||||
const langOptions = SUPPORTED_LANGUAGES.map((l) => ({
|
||||
@@ -54,17 +59,47 @@ export function PlaylistPage() {
|
||||
label: `${l.flag} ${l.nativeName}`,
|
||||
}));
|
||||
|
||||
// Guard the output: only forward a valid whole number in range so a
|
||||
// negative / decimal / out-of-range entry simply omits the count line
|
||||
// instead of producing a broken "X videos" string.
|
||||
const totalVideosValidation = validateIntegerInRange(totalVideos, {
|
||||
min: 1,
|
||||
max: 1000,
|
||||
allowEmpty: true,
|
||||
});
|
||||
const totalVideosError = totalVideosValidation.valid
|
||||
? undefined
|
||||
: t(totalVideosValidation.error ?? "", totalVideosValidation.errorParams);
|
||||
|
||||
const playlistInput: PlaylistInput = useMemo(
|
||||
() => ({
|
||||
gameName: editor.gameName,
|
||||
channelName: editor.channelName,
|
||||
status,
|
||||
contentType,
|
||||
totalVideos: totalVideos ? parseInt(totalVideos) : undefined,
|
||||
totalVideos:
|
||||
totalVideosValidation.valid && totalVideos.trim()
|
||||
? parseInt(totalVideos)
|
||||
: undefined,
|
||||
storeLinks: editor.storeLinks,
|
||||
playlistNote: customNote,
|
||||
droppedReasons,
|
||||
droppedReasonCustom,
|
||||
playlistLink: editor.playlistLink,
|
||||
}),
|
||||
[editor.gameName, editor.channelName, status, contentType, totalVideos, editor.storeLinks, customNote],
|
||||
[
|
||||
editor.gameName,
|
||||
editor.channelName,
|
||||
status,
|
||||
contentType,
|
||||
totalVideos,
|
||||
totalVideosValidation.valid,
|
||||
editor.storeLinks,
|
||||
customNote,
|
||||
droppedReasons,
|
||||
droppedReasonCustom,
|
||||
editor.playlistLink,
|
||||
],
|
||||
);
|
||||
|
||||
// Lazy-loaded locales (v0.26): the dropdown can pick a language whose
|
||||
@@ -72,11 +107,12 @@ export function PlaylistPage() {
|
||||
const ready = useLanguagesReady([language]);
|
||||
|
||||
const output = useMemo(() => {
|
||||
if (!ready) return { title: "", description: "" };
|
||||
if (!ready) return { title: "", description: "", comment: "" };
|
||||
const tFn = i18n.getFixedT(language, "templates");
|
||||
return {
|
||||
title: buildPlaylistTitle(playlistInput, tFn),
|
||||
description: buildPlaylistDescription(playlistInput, tFn),
|
||||
comment: buildPlaylistComment(playlistInput, tFn),
|
||||
};
|
||||
}, [ready, playlistInput, language]);
|
||||
|
||||
@@ -100,6 +136,29 @@ export function PlaylistPage() {
|
||||
onChange={(v) => setStatus(v as PlaylistStatus)}
|
||||
/>
|
||||
|
||||
{status === "dropped" && (
|
||||
<>
|
||||
<ChipGroup
|
||||
label={t("playlist.droppedReasonsLabel")}
|
||||
multiple
|
||||
options={DROPPED_REASONS.map((r) => ({
|
||||
id: r.id,
|
||||
label: t(`playlist.droppedReasons.${r.id}`),
|
||||
icon: r.icon,
|
||||
}))}
|
||||
value={droppedReasons}
|
||||
onChange={setDroppedReasons}
|
||||
/>
|
||||
<Textarea
|
||||
label={t("playlist.droppedReasonCustomLabel")}
|
||||
placeholder={t("playlist.droppedReasonCustomPlaceholder")}
|
||||
value={droppedReasonCustom}
|
||||
onChange={(e) => setDroppedReasonCustom(e.target.value)}
|
||||
rows={2}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
<ChipGroup
|
||||
label={t("playlist.contentType")}
|
||||
options={CONTENT_TYPE_OPTIONS}
|
||||
@@ -110,8 +169,12 @@ export function PlaylistPage() {
|
||||
<Input
|
||||
label={t("playlist.totalVideos")}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
placeholder="e.g. 25"
|
||||
value={totalVideos}
|
||||
errorText={totalVideosError}
|
||||
onChange={(e) => setTotalVideos(e.target.value)}
|
||||
/>
|
||||
|
||||
@@ -149,6 +212,18 @@ export function PlaylistPage() {
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div className="mb-1 flex items-center justify-between">
|
||||
<span className="text-xs font-medium uppercase text-text-muted">
|
||||
{t("playlist.pinnedComment")}
|
||||
</span>
|
||||
<CopyButton text={output.comment} label={t("output.copyComment")} />
|
||||
</div>
|
||||
<pre className="max-h-64 overflow-y-auto whitespace-pre-wrap rounded bg-surface-2 p-2 font-sans text-xs text-text-secondary">
|
||||
{output.comment || "..."}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(`${output.title}\n\n${output.description}`);
|
||||
|
||||
@@ -176,8 +176,8 @@ export function ProfilesPage() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-3xl p-6">
|
||||
<div className="mb-6 flex items-center justify-between">
|
||||
<div className="mx-auto max-w-3xl p-4 sm:p-6">
|
||||
<div className="mb-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div className="flex gap-1 rounded-lg bg-surface-1 p-1">
|
||||
{(["profiles", "presets", "templates"] as const).map((t2) => (
|
||||
<button
|
||||
@@ -194,7 +194,7 @@ export function ProfilesPage() {
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{tab === "profiles" && (
|
||||
<>
|
||||
<Button variant="ghost" size="sm" onClick={handleExportProfiles}>
|
||||
|
||||
@@ -196,8 +196,8 @@ export function SettingsPage() {
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-2xl p-6">
|
||||
<div className="mb-6 flex items-center justify-between">
|
||||
<div className="mx-auto max-w-2xl p-4 sm:p-6">
|
||||
<div className="mb-6 flex flex-wrap items-center justify-between gap-2">
|
||||
<h1 className="text-lg font-bold text-text-primary">{t("settings.title")}</h1>
|
||||
{IS_TAURI && (
|
||||
<div className="flex gap-2">
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
type SocialPostOutput,
|
||||
} from "@engine/social-post-builder";
|
||||
import { useCurrentGeneratorInput } from "@hooks/use-current-generator-input";
|
||||
import { validateBatchRange } from "@utils/validation";
|
||||
import {
|
||||
exportTypedToJsonFile,
|
||||
importTypedFromJsonFile,
|
||||
@@ -75,6 +76,15 @@ export function SocialPage() {
|
||||
const [bulkResults, setBulkResults] = useState<BulkRow[]>([]);
|
||||
const [generating, setGenerating] = useState(false);
|
||||
|
||||
// Block bulk generation on an invalid part range (mirrors BatchPage).
|
||||
const rangeResult = useMemo(
|
||||
() => validateBatchRange(startPart, endPart, { maxSpan: 100 }),
|
||||
[startPart, endPart],
|
||||
);
|
||||
const rangeError = rangeResult.valid
|
||||
? undefined
|
||||
: t(rangeResult.error ?? "", rangeResult.errorParams);
|
||||
|
||||
// Import display (read-only)
|
||||
const [imported, setImported] = useState<SocialExportBundle | null>(null);
|
||||
|
||||
@@ -380,22 +390,38 @@ export function SocialPage() {
|
||||
<Input
|
||||
label={t("batch.startPart")}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
error={!rangeResult.valid}
|
||||
value={startPart}
|
||||
onChange={(e) => setStartPart(e.target.value)}
|
||||
/>
|
||||
<Input
|
||||
label={t("batch.endPart")}
|
||||
type="number"
|
||||
min={1}
|
||||
step={1}
|
||||
inputMode="numeric"
|
||||
error={!rangeResult.valid}
|
||||
value={endPart}
|
||||
onChange={(e) => setEndPart(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
onClick={() => void handleBulkGenerate()}
|
||||
disabled={!gameName || generating}
|
||||
disabled={!gameName || generating || !rangeResult.valid}
|
||||
>
|
||||
{t("common.generate")}
|
||||
</Button>
|
||||
</div>
|
||||
{rangeError && (
|
||||
<p
|
||||
role="alert"
|
||||
className="rounded-lg border border-warning/40 bg-warning/10 px-3 py-2 text-xs text-warning"
|
||||
>
|
||||
{rangeError}
|
||||
</p>
|
||||
)}
|
||||
|
||||
{bulkResults.length === 0 ? (
|
||||
<p className="rounded-lg border border-dashed border-border py-8 text-center text-sm text-text-muted">
|
||||
|
||||
+125
-1
@@ -38,6 +38,11 @@ import {
|
||||
DEFAULT_GACHA_QUEST_TYPE,
|
||||
type GachaQuestType,
|
||||
} from "@config/gacha-quest-types";
|
||||
import {
|
||||
PLAYTEST_PLATFORMS,
|
||||
PLAYTEST_MAX_INVITES_CAP,
|
||||
DEFAULT_PLAYTEST_PLATFORM,
|
||||
} from "@config/playtest-platforms";
|
||||
import { DEFAULTS } from "@config/defaults";
|
||||
|
||||
export interface EditorData {
|
||||
@@ -168,6 +173,22 @@ export interface EditorData {
|
||||
vnBankHolder: string;
|
||||
vnMomo: string;
|
||||
vnZalopay: string;
|
||||
/** Playtest signup link (v0.30.0). Empty = no Playtest description block. */
|
||||
playtestLink: string;
|
||||
/** Playtest platform id (see `@config/playtest-platforms`). */
|
||||
playtestPlatform: string;
|
||||
/** Playtest invites available — 0 = unset; clamped to the platform max (≤100). */
|
||||
playtestInvites: number;
|
||||
/** Messenger community invite link (v0.32.0). Empty = no community line. */
|
||||
messengerCommunityLink: string;
|
||||
/** Zalo group invite link (v0.32.0). Rendered into the description only for Vietnamese output. */
|
||||
zaloGroupLink: string;
|
||||
/** Signal group invite link (v0.33.0). `https://signal.group/#<id>`. All languages. */
|
||||
signalGroupLink: string;
|
||||
/** Instagram group-chat invite link (v0.33.0). `https://www.instagram.com/j/<id>` or `https://ig.me/j/<id>`. All languages. */
|
||||
instagramGroupLink: string;
|
||||
/** Facebook group invite link (v0.33.0). `https://facebook.com/groups/<id>`. Moved here from the generic `social` map. */
|
||||
facebookGroupLink: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,6 +282,24 @@ function normalizeEditorPatch(
|
||||
out.spoilerWarning = false;
|
||||
out.matureWarning = false;
|
||||
}
|
||||
// v0.33.0: Facebook Group moved from the generic `social` map to the
|
||||
// dedicated `facebookGroupLink` community field. A profile / preset /
|
||||
// template snapshot saved before the move still carries the value under
|
||||
// `social.fb_group`; lift it so applying the snapshot doesn't silently
|
||||
// drop the link. Don't override an explicit `facebookGroupLink` in the
|
||||
// patch. The stale `social.fb_group` entry is harmless at render time
|
||||
// (it's no longer in SOCIAL_FIELDS, so the Social block filters it out).
|
||||
const socialPatch: unknown = (patch as { social?: unknown }).social;
|
||||
if (socialPatch && typeof socialPatch === "object") {
|
||||
const legacyFbGroup = (socialPatch as Record<string, unknown>).fb_group;
|
||||
if (
|
||||
typeof legacyFbGroup === "string" &&
|
||||
legacyFbGroup.trim() !== "" &&
|
||||
typeof out.facebookGroupLink !== "string"
|
||||
) {
|
||||
out.facebookGroupLink = legacyFbGroup;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@@ -348,6 +387,14 @@ const initialState: EditorData = {
|
||||
vnBankHolder: DEFAULTS.editor.vnBankHolder,
|
||||
vnMomo: DEFAULTS.editor.vnMomo,
|
||||
vnZalopay: DEFAULTS.editor.vnZalopay,
|
||||
playtestLink: DEFAULTS.editor.playtestLink,
|
||||
playtestPlatform: DEFAULTS.editor.playtestPlatform,
|
||||
playtestInvites: DEFAULTS.editor.playtestInvites,
|
||||
messengerCommunityLink: DEFAULTS.editor.messengerCommunityLink,
|
||||
zaloGroupLink: DEFAULTS.editor.zaloGroupLink,
|
||||
signalGroupLink: DEFAULTS.editor.signalGroupLink,
|
||||
instagramGroupLink: DEFAULTS.editor.instagramGroupLink,
|
||||
facebookGroupLink: DEFAULTS.editor.facebookGroupLink,
|
||||
};
|
||||
|
||||
export const useEditorStore = create<EditorState>()(
|
||||
@@ -465,7 +512,28 @@ export const useEditorStore = create<EditorState>()(
|
||||
// migration defensively coerces unrecognised values to `""`
|
||||
// so a hand-edited blob or downgrade from a future version
|
||||
// can't leave the Select stuck on a missing option.
|
||||
version: 14,
|
||||
// v14 → v15: v0.30.0. Playtest section — `playtestLink`,
|
||||
// `playtestPlatform`, `playtestInvites` joined the schema.
|
||||
// Additive: empty link / default platform / 0 invites
|
||||
// back-fill. The migration coerces an unknown platform id to
|
||||
// the default and clamps the invite count to an integer in
|
||||
// [0, 100], so a hand-edited blob can't strand the editor's
|
||||
// platform Select or number input on a bad value.
|
||||
// v15 → v16: v0.32.0. Community links — `messengerCommunityLink`
|
||||
// (`https://m.me/ch/<id>`) and `zaloGroupLink`
|
||||
// (`https://zalo.me/g/<code>`) joined the schema. Additive:
|
||||
// both back-fill to "". Messenger renders for every output
|
||||
// language; the Zalo line only renders for Vietnamese output.
|
||||
// Non-string values coerce to "".
|
||||
// v16 → v17: v0.33.0. Community expansion — `signalGroupLink`
|
||||
// (`https://signal.group/#<id>`), `instagramGroupLink` (the
|
||||
// Instagram group-chat invite), and `facebookGroupLink`
|
||||
// (`https://facebook.com/groups/<id>`) joined the schema, all
|
||||
// rendered for every output language. Facebook Group also
|
||||
// moved OUT of the generic `social` map: the migration lifts a
|
||||
// legacy `social.fb_group` value into `facebookGroupLink` and
|
||||
// drops the dead key. Other fields back-fill to "".
|
||||
version: 17,
|
||||
migrate: (persistedState, version) =>
|
||||
migrateEditorState(persistedState, version),
|
||||
partialize: (state) => ({
|
||||
@@ -537,6 +605,14 @@ export const useEditorStore = create<EditorState>()(
|
||||
vnBankHolder: state.vnBankHolder,
|
||||
vnMomo: state.vnMomo,
|
||||
vnZalopay: state.vnZalopay,
|
||||
playtestLink: state.playtestLink,
|
||||
playtestPlatform: state.playtestPlatform,
|
||||
playtestInvites: state.playtestInvites,
|
||||
messengerCommunityLink: state.messengerCommunityLink,
|
||||
zaloGroupLink: state.zaloGroupLink,
|
||||
signalGroupLink: state.signalGroupLink,
|
||||
instagramGroupLink: state.instagramGroupLink,
|
||||
facebookGroupLink: state.facebookGroupLink,
|
||||
}),
|
||||
},
|
||||
),
|
||||
@@ -759,6 +835,54 @@ export function migrateEditorState(
|
||||
? state.videoStyleEra
|
||||
: "";
|
||||
}
|
||||
if (version < 15) {
|
||||
// v0.30.0 Playtest section. Additive back-fill + defensive coercion.
|
||||
if (typeof state.playtestLink !== "string") state.playtestLink = "";
|
||||
if (
|
||||
typeof state.playtestPlatform !== "string" ||
|
||||
!PLAYTEST_PLATFORMS.some((p) => p.id === state.playtestPlatform)
|
||||
) {
|
||||
state.playtestPlatform = DEFAULT_PLAYTEST_PLATFORM;
|
||||
}
|
||||
const inv = state.playtestInvites;
|
||||
state.playtestInvites =
|
||||
typeof inv === "number" && Number.isInteger(inv) && inv >= 0
|
||||
? Math.min(inv, PLAYTEST_MAX_INVITES_CAP)
|
||||
: 0;
|
||||
}
|
||||
if (version < 16) {
|
||||
// v0.32.0 Community links. Additive back-fill + defensive coercion.
|
||||
if (typeof state.messengerCommunityLink !== "string") {
|
||||
state.messengerCommunityLink = "";
|
||||
}
|
||||
if (typeof state.zaloGroupLink !== "string") state.zaloGroupLink = "";
|
||||
}
|
||||
if (version < 17) {
|
||||
// v0.33.0 Community expansion. Additive back-fill + defensive coercion,
|
||||
// plus a lift of the legacy `social.fb_group` link into the new
|
||||
// dedicated `facebookGroupLink` field (Facebook Group moved out of the
|
||||
// generic Social map into the Community section).
|
||||
if (typeof state.signalGroupLink !== "string") state.signalGroupLink = "";
|
||||
if (typeof state.instagramGroupLink !== "string") {
|
||||
state.instagramGroupLink = "";
|
||||
}
|
||||
if (typeof state.facebookGroupLink !== "string") {
|
||||
state.facebookGroupLink = "";
|
||||
}
|
||||
const social = state.social;
|
||||
if (social && typeof social === "object") {
|
||||
const legacyFbGroup = (social as Record<string, unknown>).fb_group;
|
||||
if (
|
||||
typeof legacyFbGroup === "string" &&
|
||||
legacyFbGroup.trim() !== "" &&
|
||||
state.facebookGroupLink === ""
|
||||
) {
|
||||
state.facebookGroupLink = legacyFbGroup;
|
||||
}
|
||||
// Drop the dead key so the moved link doesn't linger in `social`.
|
||||
delete (social as Record<string, unknown>).fb_group;
|
||||
}
|
||||
}
|
||||
return { ...initialState, ...state } as EditorData;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,14 @@ export interface TemplateSnapshot {
|
||||
vnBankHolder?: string;
|
||||
vnMomo?: string;
|
||||
vnZalopay?: string;
|
||||
/** Community invite links (v0.32.0). Optional for back-compat. */
|
||||
messengerCommunityLink?: string;
|
||||
zaloGroupLink?: string;
|
||||
/** More community invite links (v0.33.0) — Signal, Instagram group chat,
|
||||
* and Facebook Group (moved from Social). Optional for back-compat. */
|
||||
signalGroupLink?: string;
|
||||
instagramGroupLink?: string;
|
||||
facebookGroupLink?: string;
|
||||
/** Channel-level third-party advertising copy (v0.11). Optional for
|
||||
* back-compat with pre-v0.11 templates. */
|
||||
thirdPartyAdText?: string;
|
||||
|
||||
@@ -136,3 +136,217 @@ export function validatePlaylistUrl(input: string): ValidationResult {
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
/**
|
||||
* Strict validators for community-invite links (v0.32.0).
|
||||
*
|
||||
* - Messenger community: `https://m.me/ch/<id>` — the `/ch/` path is the
|
||||
* community/channel invite (distinct from a personal `m.me/<page>` link).
|
||||
* A trailing slash is allowed. Non-matching URLs are hard-rejected so a
|
||||
* broken invite never reaches the description.
|
||||
* - Zalo group: `https://zalo.me/g/<code>` — the `/g/` path is the group
|
||||
* join link, distinct from a personal `zalo.me/<phone>` profile. Only
|
||||
* rendered for Vietnamese output, but validated regardless of language.
|
||||
*/
|
||||
const MESSENGER_URL_REGEX = /^https:\/\/m\.me\/ch\/[A-Za-z0-9._-]+\/?$/;
|
||||
const MESSENGER_URL_EXPECTED = "https://m.me/ch/[id]";
|
||||
const ZALO_GROUP_URL_REGEX = /^https:\/\/zalo\.me\/g\/[A-Za-z0-9]+$/;
|
||||
const ZALO_GROUP_URL_EXPECTED = "https://zalo.me/g/[id]";
|
||||
|
||||
export function validateMessengerUrl(input: string): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return { valid: true };
|
||||
|
||||
const baseResult = validateUrl(trimmed);
|
||||
if (!baseResult.valid) return baseResult;
|
||||
|
||||
if (!MESSENGER_URL_REGEX.test(trimmed)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.messengerUrlInvalid",
|
||||
errorParams: { expected: MESSENGER_URL_EXPECTED },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
export function validateZaloGroupUrl(input: string): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return { valid: true };
|
||||
|
||||
const baseResult = validateUrl(trimmed);
|
||||
if (!baseResult.valid) return baseResult;
|
||||
|
||||
if (!ZALO_GROUP_URL_REGEX.test(trimmed)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.zaloUrlInvalid",
|
||||
errorParams: { expected: ZALO_GROUP_URL_EXPECTED },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
/**
|
||||
* Strict validators for the v0.33.0 community-invite links. Same shape as
|
||||
* the Messenger / Zalo validators above: empty is valid (optional field),
|
||||
* the base URL check runs first, then a platform-specific pattern that is
|
||||
* hard-rejected so a broken invite never reaches the description.
|
||||
*
|
||||
* - Signal group: `https://signal.group/#<payload>` — the `#` fragment is
|
||||
* the base64 group-invite blob (may contain `+ / = _ -`).
|
||||
* - Instagram group chat: `https://www.instagram.com/j/<id>` or the short
|
||||
* `https://ig.me/j/<id>` form — distinct from an `instagram.com/<user>`
|
||||
* profile link, which stays in the Social section.
|
||||
* - Facebook group: `https://facebook.com/groups/<id>` — the `www.`, `m.`
|
||||
* and `web.` subdomains and a trailing slash are tolerated. This moved
|
||||
* out of the generic Social map (which used a soft prefix warning) into
|
||||
* the Community section, so it now hard-rejects like its siblings.
|
||||
*/
|
||||
const SIGNAL_GROUP_URL_REGEX = /^https:\/\/signal\.group\/#[A-Za-z0-9+/=_-]+$/;
|
||||
const SIGNAL_GROUP_URL_EXPECTED = "https://signal.group/#[id]";
|
||||
const INSTAGRAM_INVITE_URL_REGEX =
|
||||
/^https:\/\/(?:www\.instagram\.com|ig\.me)\/j\/[A-Za-z0-9._-]+\/?$/;
|
||||
const INSTAGRAM_INVITE_URL_EXPECTED = "https://www.instagram.com/j/[id]";
|
||||
const FACEBOOK_GROUP_URL_REGEX =
|
||||
/^https:\/\/(?:www\.|m\.|web\.)?facebook\.com\/groups\/[A-Za-z0-9._-]+\/?$/;
|
||||
const FACEBOOK_GROUP_URL_EXPECTED = "https://facebook.com/groups/[id]";
|
||||
|
||||
export function validateSignalGroupUrl(input: string): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return { valid: true };
|
||||
|
||||
const baseResult = validateUrl(trimmed);
|
||||
if (!baseResult.valid) return baseResult;
|
||||
|
||||
if (!SIGNAL_GROUP_URL_REGEX.test(trimmed)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.signalUrlInvalid",
|
||||
errorParams: { expected: SIGNAL_GROUP_URL_EXPECTED },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
export function validateInstagramInviteUrl(input: string): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return { valid: true };
|
||||
|
||||
const baseResult = validateUrl(trimmed);
|
||||
if (!baseResult.valid) return baseResult;
|
||||
|
||||
if (!INSTAGRAM_INVITE_URL_REGEX.test(trimmed)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.instagramInviteUrlInvalid",
|
||||
errorParams: { expected: INSTAGRAM_INVITE_URL_EXPECTED },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
export function validateFacebookGroupUrl(input: string): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) return { valid: true };
|
||||
|
||||
const baseResult = validateUrl(trimmed);
|
||||
if (!baseResult.valid) return baseResult;
|
||||
|
||||
if (!FACEBOOK_GROUP_URL_REGEX.test(trimmed)) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.facebookGroupUrlInvalid",
|
||||
errorParams: { expected: FACEBOOK_GROUP_URL_EXPECTED },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
export interface IntRangeOptions {
|
||||
min: number;
|
||||
max: number;
|
||||
/** When true, an empty / whitespace-only string is valid (the field is
|
||||
* optional). When false, blank is rejected as `validation.numberRequired`. */
|
||||
allowEmpty?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a string holds a whole number within `[min, max]`.
|
||||
* Rejects (in order) blank-when-required, non-numeric, decimals /
|
||||
* non-integers, and out-of-range values — covering every "invalid number"
|
||||
* case the editor needs to warn on (v0.30.0). Pure; returns the shared
|
||||
* {@link ValidationResult} so it slots into the existing inline-error UI.
|
||||
*/
|
||||
export function validateIntegerInRange(
|
||||
input: string,
|
||||
{ min, max, allowEmpty = false }: IntRangeOptions,
|
||||
): ValidationResult {
|
||||
const trimmed = input.trim();
|
||||
if (!trimmed) {
|
||||
return allowEmpty ? { valid: true } : { valid: false, error: "validation.numberRequired" };
|
||||
}
|
||||
|
||||
const n = Number(trimmed);
|
||||
if (!Number.isFinite(n)) {
|
||||
return { valid: false, error: "validation.numberInvalid" };
|
||||
}
|
||||
if (!Number.isInteger(n)) {
|
||||
return { valid: false, error: "validation.numberNotInteger" };
|
||||
}
|
||||
if (n < min || n > max) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.numberOutOfRange",
|
||||
errorParams: { min, max },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
|
||||
export interface BatchRangeOptions {
|
||||
/** Maximum number of parts allowed in a single batch (inclusive span). */
|
||||
maxSpan: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate a Batch / Social-bulk "start → end part" range. Both endpoints
|
||||
* must be whole numbers ≥ 1, `end ≥ start`, and the inclusive span must not
|
||||
* exceed `maxSpan`. Returns the first failing reason so the caller can both
|
||||
* block generation (disable the button) and surface the message. v0.30.0.
|
||||
*/
|
||||
export function validateBatchRange(
|
||||
startStr: string,
|
||||
endStr: string,
|
||||
{ maxSpan }: BatchRangeOptions,
|
||||
): ValidationResult {
|
||||
const startResult = validateIntegerInRange(startStr, { min: 1, max: Number.MAX_SAFE_INTEGER });
|
||||
if (!startResult.valid) return startResult;
|
||||
const endResult = validateIntegerInRange(endStr, { min: 1, max: Number.MAX_SAFE_INTEGER });
|
||||
if (!endResult.valid) return endResult;
|
||||
|
||||
const start = Number(startStr.trim());
|
||||
const end = Number(endStr.trim());
|
||||
if (end < start) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.rangeEndBeforeStart",
|
||||
errorParams: { start, end },
|
||||
};
|
||||
}
|
||||
if (end - start + 1 > maxSpan) {
|
||||
return {
|
||||
valid: false,
|
||||
error: "validation.rangeTooLarge",
|
||||
errorParams: { maxSpan },
|
||||
};
|
||||
}
|
||||
|
||||
return { valid: true };
|
||||
}
|
||||
@@ -163,6 +163,90 @@ describe("buildDescription", () => {
|
||||
expect(result).not.toContain("(free)");
|
||||
});
|
||||
|
||||
it("includes the playtest block with platform label + link when a link is set (v0.30.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
playtestLink: "https://store.steampowered.com/app/1245620",
|
||||
playtestPlatform: "steam",
|
||||
playtestInvites: 25,
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("🧪 PLAYTEST / EARLY ACCESS");
|
||||
expect(result).toContain(
|
||||
"🧪 Steam Playtest: https://store.steampowered.com/app/1245620",
|
||||
);
|
||||
expect(result).toContain("25 invites available");
|
||||
});
|
||||
|
||||
it("omits the playtest block entirely when no link is set", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({ playtestPlatform: "steam", playtestInvites: 25 }),
|
||||
t,
|
||||
);
|
||||
expect(result).not.toContain("PLAYTEST / EARLY ACCESS");
|
||||
});
|
||||
|
||||
it("omits the invites line when the count is 0", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
playtestLink: "https://dev.itch.io/my-game",
|
||||
playtestPlatform: "itchio",
|
||||
playtestInvites: 0,
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("🧪 PLAYTEST / EARLY ACCESS");
|
||||
expect(result).not.toContain("invites available");
|
||||
});
|
||||
|
||||
it("guards the invites line against non-integer / negative counts", () => {
|
||||
const t = createMockT("en");
|
||||
const decimal = buildDescription(
|
||||
makeInput({
|
||||
playtestLink: "https://store.steampowered.com/app/1",
|
||||
playtestInvites: 2.5,
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(decimal).not.toContain("invites available");
|
||||
const negative = buildDescription(
|
||||
makeInput({
|
||||
playtestLink: "https://store.steampowered.com/app/1",
|
||||
playtestInvites: -3,
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(negative).not.toContain("invites available");
|
||||
});
|
||||
|
||||
it("falls back to the raw platform id when the platform is unknown", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
playtestLink: "https://example.com/signup",
|
||||
playtestPlatform: "mystery",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("🧪 mystery: https://example.com/signup");
|
||||
});
|
||||
|
||||
it("renders the localized playtest heading in Vietnamese", () => {
|
||||
const t = createMockT("vi");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "vi",
|
||||
playtestLink: "https://store.steampowered.com/app/1",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("🧪 PLAYTEST / TRẢI NGHIỆM SỚM");
|
||||
});
|
||||
|
||||
it("includes video settings with the v0.8-polish multi-line block", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
@@ -449,6 +533,147 @@ describe("buildDescription", () => {
|
||||
expect(result).not.toContain("💸 MoMo");
|
||||
});
|
||||
|
||||
it("renders the community block with the Messenger line for any language (v0.32.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({ messengerCommunityLink: "https://m.me/ch/mychannel" }),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("💬 COMMUNITY / JOIN THE GROUP");
|
||||
expect(result).toContain("💬 Messenger: https://m.me/ch/mychannel");
|
||||
expect(result).not.toContain("💙 Zalo");
|
||||
});
|
||||
|
||||
it("renders the Zalo group line when language is 'vi' (v0.32.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "vi",
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("💬 Messenger: https://m.me/ch/mychannel");
|
||||
expect(result).toContain("💙 Zalo: https://zalo.me/g/abc123");
|
||||
});
|
||||
|
||||
it("never renders the Zalo group line when language is not 'vi', even if set (v0.32.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "en",
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
// Messenger is language-agnostic and still renders…
|
||||
expect(result).toContain("💬 Messenger: https://m.me/ch/mychannel");
|
||||
// …but the Zalo line is gated to Vietnamese output.
|
||||
expect(result).not.toContain("💙 Zalo");
|
||||
expect(result).not.toContain("zalo.me/g/abc123");
|
||||
});
|
||||
|
||||
it("omits the community block entirely when it would be empty (v0.32.0)", () => {
|
||||
const t = createMockT("en");
|
||||
// Zalo is set but the output language is English and there's no
|
||||
// Messenger link → the block has no eligible lines and is skipped.
|
||||
const result = buildDescription(
|
||||
makeInput({ language: "en", zaloGroupLink: "https://zalo.me/g/abc123" }),
|
||||
t,
|
||||
);
|
||||
expect(result).not.toContain("COMMUNITY / JOIN THE GROUP");
|
||||
expect(result).not.toContain("💬 Messenger");
|
||||
expect(result).not.toContain("💙 Zalo");
|
||||
});
|
||||
|
||||
it("localizes the community heading for Vietnamese output (v0.32.0)", () => {
|
||||
const t = createMockT("vi");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "vi",
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("CỘNG ĐỒNG / THAM GIA NHÓM");
|
||||
expect(result).toContain("💙 Zalo: https://zalo.me/g/abc123");
|
||||
});
|
||||
|
||||
it("renders Signal, Instagram and Facebook Group community lines for any language (v0.33.0)", () => {
|
||||
// Japanese output — the three new links are language-agnostic (only
|
||||
// the heading localizes), so they must appear just like for English.
|
||||
const t = createMockT("ja");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "ja",
|
||||
signalGroupLink: "https://signal.group/#abc123",
|
||||
instagramGroupLink: "https://ig.me/j/xyz789",
|
||||
facebookGroupLink: "https://facebook.com/groups/mygroup",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(result).toContain("🔒 Signal: https://signal.group/#abc123");
|
||||
expect(result).toContain("📸 Instagram: https://ig.me/j/xyz789");
|
||||
expect(result).toContain("👥 Facebook Group: https://facebook.com/groups/mygroup");
|
||||
// Zalo is gated to Vietnamese output and unset here.
|
||||
expect(result).not.toContain("💙 Zalo");
|
||||
});
|
||||
|
||||
it("orders the community lines Messenger → Signal → Instagram → Facebook Group → Zalo (v0.33.0)", () => {
|
||||
const t = createMockT("vi");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "vi",
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
signalGroupLink: "https://signal.group/#abc123",
|
||||
instagramGroupLink: "https://ig.me/j/xyz789",
|
||||
facebookGroupLink: "https://facebook.com/groups/mygroup",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
const iMessenger = result.indexOf("💬 Messenger");
|
||||
const iSignal = result.indexOf("🔒 Signal");
|
||||
const iInstagram = result.indexOf("📸 Instagram");
|
||||
const iFacebook = result.indexOf("👥 Facebook Group");
|
||||
const iZalo = result.indexOf("💙 Zalo");
|
||||
expect(iMessenger).toBeGreaterThan(-1);
|
||||
expect(iSignal).toBeGreaterThan(iMessenger);
|
||||
expect(iInstagram).toBeGreaterThan(iSignal);
|
||||
expect(iFacebook).toBeGreaterThan(iInstagram);
|
||||
expect(iZalo).toBeGreaterThan(iFacebook);
|
||||
});
|
||||
|
||||
it("renders Facebook Group in the Community block, not the Social block (v0.33.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
facebookGroupLink: "https://facebook.com/groups/mygroup",
|
||||
social: { twitter: "myhandle" },
|
||||
}),
|
||||
t,
|
||||
);
|
||||
const iCommunity = result.indexOf("💬 COMMUNITY / JOIN THE GROUP");
|
||||
const iFacebook = result.indexOf(
|
||||
"👥 Facebook Group: https://facebook.com/groups/mygroup",
|
||||
);
|
||||
expect(iCommunity).toBeGreaterThan(-1);
|
||||
expect(iFacebook).toBeGreaterThan(iCommunity);
|
||||
// The FB group line appears exactly once — only under Community, never
|
||||
// in the Social block (fb_group is no longer a SOCIAL_FIELDS entry).
|
||||
expect(result.split("Facebook Group:").length - 1).toBe(1);
|
||||
});
|
||||
|
||||
it("omits the community block when only an empty Facebook Group link is set (v0.33.0)", () => {
|
||||
const t = createMockT("en");
|
||||
const result = buildDescription(makeInput({ facebookGroupLink: " " }), t);
|
||||
expect(result).not.toContain("COMMUNITY / JOIN THE GROUP");
|
||||
expect(result).not.toContain("👥 Facebook Group");
|
||||
});
|
||||
|
||||
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";
|
||||
@@ -1498,6 +1723,84 @@ describe("buildDescription — translation quality notice (v0.24.0)", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildDescription — bilingualContentBlocks gate (v0.29.3)", () => {
|
||||
it("multi-language tabs: content blocks single-language but translation-quality stays bilingual", () => {
|
||||
const t = createMockT("ja");
|
||||
const tEn = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "ja",
|
||||
contentWarnings: ["flashing_lights"],
|
||||
techNotes: ["fps_drops_hardware"],
|
||||
playthroughStatus: "blind",
|
||||
}),
|
||||
t,
|
||||
{ tEn, bilingualContentBlocks: false, showTranslationQuality: true },
|
||||
);
|
||||
// Content warnings: JA-only header + no EN pairing.
|
||||
expect(result).toContain("▸ ⚠️ コンテンツ警告");
|
||||
expect(result).not.toContain("▸ ⚠️ CONTENT WARNINGS");
|
||||
expect(result).not.toContain(
|
||||
"Flashing lights — photosensitive viewers take care",
|
||||
);
|
||||
// Tech notes: JA-only header + no EN pairing.
|
||||
expect(result).toContain("▸ 🛠 技術メモ");
|
||||
expect(result).not.toContain("▸ 🛠 TECH NOTES");
|
||||
expect(result).not.toContain(
|
||||
"FPS drops — caused by hardware (FPS counter visible top-left)",
|
||||
);
|
||||
// Playthrough notes: JA-only header + no EN pairing.
|
||||
expect(result).toContain("▸ 🎮 プレイ情報");
|
||||
expect(result).not.toContain("▸ 🎮 PLAYTHROUGH NOTES");
|
||||
// Translation-quality disclaimer: STILL bilingual (the v0.29.2 goal).
|
||||
expect(result).toContain("ABOUT THIS TRANSLATION"); // EN header via tEn
|
||||
expect(result).toContain("翻訳について"); // JA header — proves bilingual
|
||||
});
|
||||
|
||||
it("multi-language tabs: content warnings render single-language with no `· ` separator", () => {
|
||||
const t = createMockT("vi");
|
||||
const tEn = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({
|
||||
language: "vi",
|
||||
contentWarnings: ["jump_scares", "flashing_lights"],
|
||||
}),
|
||||
t,
|
||||
{ tEn, bilingualContentBlocks: false },
|
||||
);
|
||||
expect(result).not.toContain(" · ");
|
||||
expect(result).toContain("▸ ⚠️ CẢNH BÁO NỘI DUNG");
|
||||
expect(result).not.toContain("▸ ⚠️ CONTENT WARNINGS");
|
||||
expect(result).toContain("• Có jumpscare");
|
||||
});
|
||||
|
||||
it("single-language mode (default true): content warnings stay bilingual", () => {
|
||||
const t = createMockT("vi");
|
||||
const tEn = createMockT("en");
|
||||
const result = buildDescription(
|
||||
makeInput({ language: "vi", contentWarnings: ["jump_scares"] }),
|
||||
t,
|
||||
{ tEn }, // bilingualContentBlocks omitted → defaults to true
|
||||
);
|
||||
expect(result).toContain("▸ ⚠️ CONTENT WARNINGS / ▸ ⚠️ CẢNH BÁO NỘI DUNG");
|
||||
expect(result).toContain("• Jumpscares · Có jumpscare");
|
||||
});
|
||||
|
||||
it("explicit bilingualContentBlocks:true matches the default", () => {
|
||||
const t = createMockT("vi");
|
||||
const tEn = createMockT("en");
|
||||
const base = makeInput({
|
||||
language: "vi",
|
||||
contentWarnings: ["jump_scares"],
|
||||
techNotes: ["fps_drops_hardware"],
|
||||
playthroughStatus: "blind",
|
||||
});
|
||||
const a = buildDescription(base, t, { tEn });
|
||||
const b = buildDescription(base, t, { tEn, bilingualContentBlocks: true });
|
||||
expect(a).toBe(b);
|
||||
});
|
||||
});
|
||||
|
||||
describe("checkDescriptionWarning", () => {
|
||||
it("returns null for description under limit", () => {
|
||||
expect(checkDescriptionWarning("Short description")).toBeNull();
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import {
|
||||
buildPlaylistTitle,
|
||||
buildPlaylistDescription,
|
||||
buildPlaylistComment,
|
||||
type PlaylistInput,
|
||||
} from "@engine/playlist-builder";
|
||||
import { createMockT } from "../helpers/mock-t";
|
||||
|
||||
function makeInput(overrides: Partial<PlaylistInput> = {}): PlaylistInput {
|
||||
return {
|
||||
gameName: "Elden Ring",
|
||||
channelName: "TestChannel",
|
||||
status: "completed",
|
||||
contentType: "full_gameplay",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
describe("buildPlaylistTitle", () => {
|
||||
const t = createMockT("en");
|
||||
|
||||
it("prefixes the game name with the localized status label", () => {
|
||||
expect(buildPlaylistTitle(makeInput({ status: "completed" }), t)).toBe(
|
||||
"✅ Completed - Elden Ring",
|
||||
);
|
||||
expect(buildPlaylistTitle(makeInput({ status: "dropped" }), t)).toBe(
|
||||
"❌ Dropped - Elden Ring",
|
||||
);
|
||||
expect(buildPlaylistTitle(makeInput({ status: "incomplete" }), t)).toBe(
|
||||
"🔄 Incomplete - Elden Ring",
|
||||
);
|
||||
expect(buildPlaylistTitle(makeInput({ status: "in_progress" }), t)).toBe(
|
||||
"▶️ In Progress - Elden Ring",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildPlaylistDescription", () => {
|
||||
const t = createMockT("en");
|
||||
|
||||
it("renders the content-type line and footer for a minimal playlist", () => {
|
||||
const out = buildPlaylistDescription(makeInput(), t);
|
||||
expect(out).toContain("full gameplay of Elden Ring on TestChannel");
|
||||
expect(out).toContain("👍 Like | 🔔 Subscribe");
|
||||
});
|
||||
|
||||
it("includes a video-count line when totalVideos is set", () => {
|
||||
expect(buildPlaylistDescription(makeInput({ totalVideos: 25 }), t)).toContain(
|
||||
"📹 25 video(s)",
|
||||
);
|
||||
expect(buildPlaylistDescription(makeInput(), t)).not.toContain("📹");
|
||||
});
|
||||
|
||||
it("includes store links and a custom note when provided", () => {
|
||||
const out = buildPlaylistDescription(
|
||||
makeInput({
|
||||
storeLinks: { steam: "https://store.steampowered.com/app/1245620" },
|
||||
playlistNote: "Recorded on PC.",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(out).toContain("🎮 Get the game:");
|
||||
expect(out).toContain("https://store.steampowered.com/app/1245620");
|
||||
expect(out).toContain("Recorded on PC.");
|
||||
});
|
||||
|
||||
it("renders dropped reasons only when status is dropped", () => {
|
||||
const dropped = buildPlaylistDescription(
|
||||
makeInput({ status: "dropped", droppedReasons: ["boring", "performance"] }),
|
||||
t,
|
||||
);
|
||||
expect(dropped).toContain("⚠️ Why this series was dropped:");
|
||||
expect(dropped).toContain("• Game got boring / lost interest");
|
||||
expect(dropped).toContain("• Performance issues (lag, low FPS)");
|
||||
|
||||
// Same reasons, non-dropped status → no dropped block.
|
||||
const completed = buildPlaylistDescription(
|
||||
makeInput({ status: "completed", droppedReasons: ["boring"] }),
|
||||
t,
|
||||
);
|
||||
expect(completed).not.toContain("⚠️ Why this series was dropped:");
|
||||
});
|
||||
|
||||
it("appends the free-text custom reason after the predefined ones", () => {
|
||||
const out = buildPlaylistDescription(
|
||||
makeInput({
|
||||
status: "dropped",
|
||||
droppedReasons: ["bugs"],
|
||||
droppedReasonCustom: "Servers shut down",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(out).toContain("• Too many bugs / crashes");
|
||||
expect(out).toContain("• Servers shut down");
|
||||
});
|
||||
|
||||
it("omits the dropped block when no reason is selected", () => {
|
||||
const out = buildPlaylistDescription(makeInput({ status: "dropped" }), t);
|
||||
expect(out).not.toContain("⚠️ Why this series was dropped:");
|
||||
});
|
||||
|
||||
it("skips unknown reason ids rather than printing the raw key", () => {
|
||||
const out = buildPlaylistDescription(
|
||||
makeInput({ status: "dropped", droppedReasons: ["does_not_exist"] }),
|
||||
t,
|
||||
);
|
||||
expect(out).not.toContain("playlist.droppedReasons");
|
||||
expect(out).not.toContain("⚠️ Why this series was dropped:");
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildPlaylistComment", () => {
|
||||
const t = createMockT("en");
|
||||
|
||||
it("adapts the opening line to the playlist status", () => {
|
||||
expect(buildPlaylistComment(makeInput({ status: "completed" }), t)).toContain(
|
||||
"series is complete",
|
||||
);
|
||||
expect(buildPlaylistComment(makeInput({ status: "in_progress" }), t)).toContain(
|
||||
"part is live",
|
||||
);
|
||||
expect(buildPlaylistComment(makeInput({ status: "incomplete" }), t)).toContain(
|
||||
"playthrough continues",
|
||||
);
|
||||
expect(buildPlaylistComment(makeInput({ status: "dropped" }), t)).toContain(
|
||||
"decided to drop",
|
||||
);
|
||||
});
|
||||
|
||||
it("always ends with the engagement call-to-action", () => {
|
||||
expect(buildPlaylistComment(makeInput(), t)).toContain("subscribe for more");
|
||||
});
|
||||
|
||||
it("includes the playlist link line only when a link is set", () => {
|
||||
const withLink = buildPlaylistComment(
|
||||
makeInput({ playlistLink: "https://youtube.com/playlist?list=abc" }),
|
||||
t,
|
||||
);
|
||||
expect(withLink).toContain("Watch the full playlist here:");
|
||||
expect(withLink).toContain("https://youtube.com/playlist?list=abc");
|
||||
|
||||
expect(buildPlaylistComment(makeInput(), t)).not.toContain(
|
||||
"Watch the full playlist here:",
|
||||
);
|
||||
});
|
||||
|
||||
it("includes the video-count line only when totalVideos is set", () => {
|
||||
expect(buildPlaylistComment(makeInput({ totalVideos: 12 }), t)).toContain(
|
||||
"📹 12 video(s)",
|
||||
);
|
||||
expect(buildPlaylistComment(makeInput(), t)).not.toContain("📹");
|
||||
});
|
||||
|
||||
it("lists dropped reasons only for a dropped playlist", () => {
|
||||
const dropped = buildPlaylistComment(
|
||||
makeInput({
|
||||
status: "dropped",
|
||||
droppedReasons: ["boring"],
|
||||
droppedReasonCustom: "Save file corrupted",
|
||||
}),
|
||||
t,
|
||||
);
|
||||
expect(dropped).toContain("Here's why:");
|
||||
expect(dropped).toContain("• Game got boring / lost interest");
|
||||
expect(dropped).toContain("• Save file corrupted");
|
||||
|
||||
const completed = buildPlaylistComment(
|
||||
makeInput({ status: "completed", droppedReasons: ["boring"] }),
|
||||
t,
|
||||
);
|
||||
expect(completed).not.toContain("Here's why:");
|
||||
});
|
||||
|
||||
it("returns a non-empty comment for a minimal playlist", () => {
|
||||
expect(buildPlaylistComment(makeInput(), t).trim().length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("playlist builder localization (vi)", () => {
|
||||
const t = createMockT("vi");
|
||||
|
||||
it("renders the dropped heading and reasons in Vietnamese", () => {
|
||||
const out = buildPlaylistDescription(
|
||||
makeInput({ status: "dropped", droppedReasons: ["performance"] }),
|
||||
t,
|
||||
);
|
||||
expect(out).toContain("⚠️ Vì sao series này bị dừng:");
|
||||
expect(out).toContain("• Vấn đề hiệu năng (lag, FPS thấp)");
|
||||
});
|
||||
|
||||
it("renders the comment opening and CTA in Vietnamese", () => {
|
||||
const out = buildPlaylistComment(makeInput({ status: "completed" }), t);
|
||||
expect(out).toContain("đã hoàn thành");
|
||||
expect(out).toContain("đăng ký kênh");
|
||||
});
|
||||
});
|
||||
@@ -102,6 +102,14 @@ function makeEditorData(overrides: Partial<EditorData> = {}): EditorData {
|
||||
vnBankHolder: DEFAULTS.editor.vnBankHolder,
|
||||
vnMomo: DEFAULTS.editor.vnMomo,
|
||||
vnZalopay: DEFAULTS.editor.vnZalopay,
|
||||
playtestLink: DEFAULTS.editor.playtestLink,
|
||||
playtestPlatform: DEFAULTS.editor.playtestPlatform,
|
||||
playtestInvites: DEFAULTS.editor.playtestInvites,
|
||||
messengerCommunityLink: DEFAULTS.editor.messengerCommunityLink,
|
||||
zaloGroupLink: DEFAULTS.editor.zaloGroupLink,
|
||||
signalGroupLink: DEFAULTS.editor.signalGroupLink,
|
||||
instagramGroupLink: DEFAULTS.editor.instagramGroupLink,
|
||||
facebookGroupLink: DEFAULTS.editor.facebookGroupLink,
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
@@ -149,6 +157,36 @@ describe("buildGeneratorInputFromEditor — v0.12 fields propagation (regression
|
||||
]);
|
||||
});
|
||||
|
||||
it("passes through the playtest fields (v0.30.0)", () => {
|
||||
const input = buildGeneratorInputFromEditor(
|
||||
makeEditorData({
|
||||
playtestLink: "https://store.steampowered.com/app/1245620",
|
||||
playtestPlatform: "steam",
|
||||
playtestInvites: 25,
|
||||
}),
|
||||
);
|
||||
expect(input.playtestLink).toBe("https://store.steampowered.com/app/1245620");
|
||||
expect(input.playtestPlatform).toBe("steam");
|
||||
expect(input.playtestInvites).toBe(25);
|
||||
});
|
||||
|
||||
it("passes through the community invite links (v0.32.0 + v0.33.0)", () => {
|
||||
const input = buildGeneratorInputFromEditor(
|
||||
makeEditorData({
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
signalGroupLink: "https://signal.group/#abc123",
|
||||
instagramGroupLink: "https://ig.me/j/xyz789",
|
||||
facebookGroupLink: "https://facebook.com/groups/mygroup",
|
||||
}),
|
||||
);
|
||||
expect(input.messengerCommunityLink).toBe("https://m.me/ch/mychannel");
|
||||
expect(input.zaloGroupLink).toBe("https://zalo.me/g/abc123");
|
||||
expect(input.signalGroupLink).toBe("https://signal.group/#abc123");
|
||||
expect(input.instagramGroupLink).toBe("https://ig.me/j/xyz789");
|
||||
expect(input.facebookGroupLink).toBe("https://facebook.com/groups/mygroup");
|
||||
});
|
||||
|
||||
it("respects languageOverride for batch / multi-language rendering", () => {
|
||||
const input = buildGeneratorInputFromEditor(
|
||||
makeEditorData({ language: "en" }),
|
||||
|
||||
@@ -202,3 +202,186 @@ describe("migrateEditorState — v10 → v11 (v0.13)", () => {
|
||||
expect(result.gachaVersion).toBe("4.2");
|
||||
});
|
||||
});
|
||||
|
||||
describe("migrateEditorState — v14 → v15 (v0.30.0 Playtest)", () => {
|
||||
// Build a pre-v15 blob by routing v9 through every prior migration, then
|
||||
// strip the playtest keys so the v15 block is what supplies them.
|
||||
function makeV14Persisted(
|
||||
overrides: Record<string, unknown> = {},
|
||||
): Record<string, unknown> {
|
||||
const full = migrateEditorState(makeV9Persisted(), 9) as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>;
|
||||
delete full.playtestLink;
|
||||
delete full.playtestPlatform;
|
||||
delete full.playtestInvites;
|
||||
return { ...full, ...overrides };
|
||||
}
|
||||
|
||||
it("back-fills the playtest fields with safe defaults", () => {
|
||||
const result = migrateEditorState(makeV14Persisted(), 14);
|
||||
expect(result.playtestLink).toBe("");
|
||||
expect(result.playtestPlatform).toBe("steam");
|
||||
expect(result.playtestInvites).toBe(0);
|
||||
});
|
||||
|
||||
it("clamps an over-cap persisted invite count to 100", () => {
|
||||
const result = migrateEditorState(makeV14Persisted({ playtestInvites: 250 }), 14);
|
||||
expect(result.playtestInvites).toBe(100);
|
||||
});
|
||||
|
||||
it("coerces a decimal or negative invite count to 0", () => {
|
||||
expect(
|
||||
migrateEditorState(makeV14Persisted({ playtestInvites: 2.5 }), 14).playtestInvites,
|
||||
).toBe(0);
|
||||
expect(
|
||||
migrateEditorState(makeV14Persisted({ playtestInvites: -3 }), 14).playtestInvites,
|
||||
).toBe(0);
|
||||
});
|
||||
|
||||
it("coerces an unknown persisted platform to the default", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV14Persisted({ playtestPlatform: "mystery" }),
|
||||
14,
|
||||
);
|
||||
expect(result.playtestPlatform).toBe("steam");
|
||||
});
|
||||
|
||||
it("preserves valid persisted playtest values", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV14Persisted({
|
||||
playtestLink: "https://dev.itch.io/my-game",
|
||||
playtestPlatform: "itchio",
|
||||
playtestInvites: 40,
|
||||
}),
|
||||
14,
|
||||
);
|
||||
expect(result.playtestLink).toBe("https://dev.itch.io/my-game");
|
||||
expect(result.playtestPlatform).toBe("itchio");
|
||||
expect(result.playtestInvites).toBe(40);
|
||||
});
|
||||
});
|
||||
|
||||
describe("migrateEditorState — v15 → v16 (v0.32.0 Community links)", () => {
|
||||
// Build a pre-v16 blob by routing v9 through every prior migration, then
|
||||
// strip the community keys so the v16 block is what supplies them.
|
||||
function makeV15Persisted(
|
||||
overrides: Record<string, unknown> = {},
|
||||
): Record<string, unknown> {
|
||||
const full = migrateEditorState(makeV9Persisted(), 9) as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>;
|
||||
delete full.messengerCommunityLink;
|
||||
delete full.zaloGroupLink;
|
||||
return { ...full, ...overrides };
|
||||
}
|
||||
|
||||
it("back-fills the community link fields with empty strings", () => {
|
||||
const result = migrateEditorState(makeV15Persisted(), 15);
|
||||
expect(result.messengerCommunityLink).toBe("");
|
||||
expect(result.zaloGroupLink).toBe("");
|
||||
});
|
||||
|
||||
it("coerces non-string persisted community values to empty strings", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV15Persisted({ messengerCommunityLink: 42, zaloGroupLink: null }),
|
||||
15,
|
||||
);
|
||||
expect(result.messengerCommunityLink).toBe("");
|
||||
expect(result.zaloGroupLink).toBe("");
|
||||
});
|
||||
|
||||
it("preserves valid persisted community links", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV15Persisted({
|
||||
messengerCommunityLink: "https://m.me/ch/mychannel",
|
||||
zaloGroupLink: "https://zalo.me/g/abc123",
|
||||
}),
|
||||
15,
|
||||
);
|
||||
expect(result.messengerCommunityLink).toBe("https://m.me/ch/mychannel");
|
||||
expect(result.zaloGroupLink).toBe("https://zalo.me/g/abc123");
|
||||
});
|
||||
});
|
||||
|
||||
describe("migrateEditorState — v16 → v17 (v0.33.0 Community expansion)", () => {
|
||||
// Route v9 through every prior migration, then strip the v17 keys so the
|
||||
// v17 block is what supplies them.
|
||||
function makeV16Persisted(
|
||||
overrides: Record<string, unknown> = {},
|
||||
): Record<string, unknown> {
|
||||
const full = migrateEditorState(makeV9Persisted(), 9) as unknown as Record<
|
||||
string,
|
||||
unknown
|
||||
>;
|
||||
delete full.signalGroupLink;
|
||||
delete full.instagramGroupLink;
|
||||
delete full.facebookGroupLink;
|
||||
return { ...full, ...overrides };
|
||||
}
|
||||
|
||||
it("back-fills the new community link fields with empty strings", () => {
|
||||
const result = migrateEditorState(makeV16Persisted(), 16);
|
||||
expect(result.signalGroupLink).toBe("");
|
||||
expect(result.instagramGroupLink).toBe("");
|
||||
expect(result.facebookGroupLink).toBe("");
|
||||
});
|
||||
|
||||
it("coerces non-string persisted values to empty strings", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV16Persisted({
|
||||
signalGroupLink: 7,
|
||||
instagramGroupLink: null,
|
||||
facebookGroupLink: {},
|
||||
}),
|
||||
16,
|
||||
);
|
||||
expect(result.signalGroupLink).toBe("");
|
||||
expect(result.instagramGroupLink).toBe("");
|
||||
expect(result.facebookGroupLink).toBe("");
|
||||
});
|
||||
|
||||
it("preserves valid persisted new community links", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV16Persisted({
|
||||
signalGroupLink: "https://signal.group/#abc123",
|
||||
instagramGroupLink: "https://ig.me/j/xyz789",
|
||||
facebookGroupLink: "https://facebook.com/groups/mygroup",
|
||||
}),
|
||||
16,
|
||||
);
|
||||
expect(result.signalGroupLink).toBe("https://signal.group/#abc123");
|
||||
expect(result.instagramGroupLink).toBe("https://ig.me/j/xyz789");
|
||||
expect(result.facebookGroupLink).toBe("https://facebook.com/groups/mygroup");
|
||||
});
|
||||
|
||||
it("lifts a legacy social.fb_group value into facebookGroupLink and drops the dead key", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV16Persisted({
|
||||
social: {
|
||||
fb_group: "https://facebook.com/groups/mygroup",
|
||||
twitter: "myhandle",
|
||||
},
|
||||
}),
|
||||
16,
|
||||
);
|
||||
expect(result.facebookGroupLink).toBe("https://facebook.com/groups/mygroup");
|
||||
expect(result.social.fb_group).toBeUndefined();
|
||||
// Other social entries survive the lift.
|
||||
expect(result.social.twitter).toBe("myhandle");
|
||||
});
|
||||
|
||||
it("does not overwrite an explicit facebookGroupLink with the legacy value", () => {
|
||||
const result = migrateEditorState(
|
||||
makeV16Persisted({
|
||||
facebookGroupLink: "https://facebook.com/groups/explicit",
|
||||
social: { fb_group: "https://facebook.com/groups/legacy" },
|
||||
}),
|
||||
16,
|
||||
);
|
||||
expect(result.facebookGroupLink).toBe("https://facebook.com/groups/explicit");
|
||||
expect(result.social.fb_group).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -1,5 +1,15 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { validateUrlWithPattern, validatePlaylistUrl } from "@utils/validation";
|
||||
import {
|
||||
validateUrlWithPattern,
|
||||
validatePlaylistUrl,
|
||||
validateMessengerUrl,
|
||||
validateZaloGroupUrl,
|
||||
validateSignalGroupUrl,
|
||||
validateInstagramInviteUrl,
|
||||
validateFacebookGroupUrl,
|
||||
validateIntegerInRange,
|
||||
validateBatchRange,
|
||||
} from "@utils/validation";
|
||||
import { PLATFORMS } from "@config/platforms";
|
||||
|
||||
function platform(id: string) {
|
||||
@@ -238,3 +248,291 @@ describe("validatePlaylistUrl", () => {
|
||||
expect(validatePlaylistUrl("https://example.com/playlist").valid).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateMessengerUrl", () => {
|
||||
it("accepts a canonical m.me/ch community link", () => {
|
||||
const result = validateMessengerUrl("https://m.me/ch/mychannel");
|
||||
expect(result.valid).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
});
|
||||
|
||||
it("accepts the community link with or without a trailing slash", () => {
|
||||
expect(
|
||||
validateMessengerUrl("https://m.me/ch/Abb1hmBhU_97UMCF/").valid,
|
||||
).toBe(true);
|
||||
expect(validateMessengerUrl("https://m.me/ch/Abb1hmBhU_97UMCF").valid).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts a numeric id", () => {
|
||||
expect(validateMessengerUrl("https://m.me/ch/100123456789").valid).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts ids with dots, dashes and underscores", () => {
|
||||
expect(validateMessengerUrl("https://m.me/ch/my.page_name-1").valid).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects the old bare m.me link without the /ch/ segment", () => {
|
||||
const result = validateMessengerUrl("https://m.me/mychannel");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.messengerUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://m.me/ch/[id]");
|
||||
});
|
||||
|
||||
it("rejects a non-m.me host", () => {
|
||||
const result = validateMessengerUrl("https://messenger.com/ch/mychannel");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.messengerUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://m.me/ch/[id]");
|
||||
});
|
||||
|
||||
it("rejects the bare host and the /ch/ path with no id", () => {
|
||||
expect(validateMessengerUrl("https://m.me/").valid).toBe(false);
|
||||
expect(validateMessengerUrl("https://m.me").valid).toBe(false);
|
||||
expect(validateMessengerUrl("https://m.me/ch/").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an http (non-https) link", () => {
|
||||
expect(validateMessengerUrl("http://m.me/ch/mychannel").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts empty input (not an error)", () => {
|
||||
expect(validateMessengerUrl("").valid).toBe(true);
|
||||
expect(validateMessengerUrl(" ").valid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateZaloGroupUrl", () => {
|
||||
it("accepts a canonical zalo.me group link", () => {
|
||||
const result = validateZaloGroupUrl("https://zalo.me/g/abc123");
|
||||
expect(result.valid).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
});
|
||||
|
||||
it("rejects a personal zalo.me profile (no /g/ path)", () => {
|
||||
const result = validateZaloGroupUrl("https://zalo.me/0901234567");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.zaloUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://zalo.me/g/[id]");
|
||||
});
|
||||
|
||||
it("rejects the bare group path with no code", () => {
|
||||
expect(validateZaloGroupUrl("https://zalo.me/g/").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a non-zalo.me host", () => {
|
||||
expect(validateZaloGroupUrl("https://example.com/g/abc123").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an http (non-https) link", () => {
|
||||
expect(validateZaloGroupUrl("http://zalo.me/g/abc123").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts empty input (not an error)", () => {
|
||||
expect(validateZaloGroupUrl("").valid).toBe(true);
|
||||
expect(validateZaloGroupUrl(" ").valid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateSignalGroupUrl", () => {
|
||||
it("accepts a canonical signal.group link with a # payload", () => {
|
||||
const result = validateSignalGroupUrl("https://signal.group/#CjQKIAbc123_-def");
|
||||
expect(result.valid).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
});
|
||||
|
||||
it("accepts a base64 payload with + / = characters", () => {
|
||||
expect(
|
||||
validateSignalGroupUrl("https://signal.group/#CjQKIA+b/c=").valid,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a signal.group link with no fragment", () => {
|
||||
const result = validateSignalGroupUrl("https://signal.group/");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.signalUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://signal.group/#[id]");
|
||||
});
|
||||
|
||||
it("rejects an empty fragment", () => {
|
||||
expect(validateSignalGroupUrl("https://signal.group/#").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a non-signal host", () => {
|
||||
expect(validateSignalGroupUrl("https://example.com/#abc").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an http (non-https) link", () => {
|
||||
expect(validateSignalGroupUrl("http://signal.group/#abc").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts empty input (not an error)", () => {
|
||||
expect(validateSignalGroupUrl("").valid).toBe(true);
|
||||
expect(validateSignalGroupUrl(" ").valid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateInstagramInviteUrl", () => {
|
||||
it("accepts the www.instagram.com/j/ form", () => {
|
||||
const result = validateInstagramInviteUrl("https://www.instagram.com/j/AbCdEf123");
|
||||
expect(result.valid).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
});
|
||||
|
||||
it("accepts the short ig.me/j/ form", () => {
|
||||
expect(validateInstagramInviteUrl("https://ig.me/j/AbCdEf123").valid).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts a trailing slash", () => {
|
||||
expect(validateInstagramInviteUrl("https://ig.me/j/AbCdEf123/").valid).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a plain Instagram profile link (no /j/ path)", () => {
|
||||
const result = validateInstagramInviteUrl("https://www.instagram.com/myhandle");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.instagramInviteUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://www.instagram.com/j/[id]");
|
||||
});
|
||||
|
||||
it("rejects the bare /j/ path with no id", () => {
|
||||
expect(validateInstagramInviteUrl("https://ig.me/j/").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a non-Instagram host", () => {
|
||||
expect(validateInstagramInviteUrl("https://example.com/j/abc").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts empty input (not an error)", () => {
|
||||
expect(validateInstagramInviteUrl("").valid).toBe(true);
|
||||
expect(validateInstagramInviteUrl(" ").valid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateFacebookGroupUrl", () => {
|
||||
it("accepts a canonical facebook.com/groups link", () => {
|
||||
const result = validateFacebookGroupUrl("https://facebook.com/groups/mygroup");
|
||||
expect(result.valid).toBe(true);
|
||||
expect(result.error).toBeUndefined();
|
||||
});
|
||||
|
||||
it("accepts www., m. and web. subdomains and a trailing slash", () => {
|
||||
expect(validateFacebookGroupUrl("https://www.facebook.com/groups/mygroup").valid).toBe(true);
|
||||
expect(validateFacebookGroupUrl("https://m.facebook.com/groups/123456/").valid).toBe(true);
|
||||
expect(validateFacebookGroupUrl("https://web.facebook.com/groups/my.group").valid).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a plain Facebook profile / page link (no /groups/ path)", () => {
|
||||
const result = validateFacebookGroupUrl("https://facebook.com/mypage");
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.facebookGroupUrlInvalid");
|
||||
expect(result.errorParams?.expected).toBe("https://facebook.com/groups/[id]");
|
||||
});
|
||||
|
||||
it("rejects the bare /groups/ path with no id", () => {
|
||||
expect(validateFacebookGroupUrl("https://facebook.com/groups/").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an http (non-https) link", () => {
|
||||
expect(validateFacebookGroupUrl("http://facebook.com/groups/mygroup").valid).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts empty input (not an error)", () => {
|
||||
expect(validateFacebookGroupUrl("").valid).toBe(true);
|
||||
expect(validateFacebookGroupUrl(" ").valid).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateIntegerInRange", () => {
|
||||
it("accepts a whole number within range", () => {
|
||||
expect(validateIntegerInRange("5", { min: 1, max: 10 }).valid).toBe(true);
|
||||
expect(validateIntegerInRange("1", { min: 1, max: 10 }).valid).toBe(true);
|
||||
expect(validateIntegerInRange("10", { min: 1, max: 10 }).valid).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a blank value when allowEmpty is off", () => {
|
||||
const result = validateIntegerInRange("", { min: 1, max: 10 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberRequired");
|
||||
});
|
||||
|
||||
it("accepts a blank value when allowEmpty is on", () => {
|
||||
expect(validateIntegerInRange("", { min: 1, max: 10, allowEmpty: true }).valid).toBe(true);
|
||||
expect(validateIntegerInRange(" ", { min: 1, max: 10, allowEmpty: true }).valid).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects non-numeric input", () => {
|
||||
const result = validateIntegerInRange("abc", { min: 1, max: 10 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberInvalid");
|
||||
});
|
||||
|
||||
it("rejects a decimal / non-integer value", () => {
|
||||
const result = validateIntegerInRange("2.5", { min: 1, max: 10 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberNotInteger");
|
||||
});
|
||||
|
||||
it("rejects a negative value below the minimum", () => {
|
||||
const result = validateIntegerInRange("-3", { min: 1, max: 10 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberOutOfRange");
|
||||
expect(result.errorParams).toEqual({ min: 1, max: 10 });
|
||||
});
|
||||
|
||||
it("rejects zero when the minimum is 1", () => {
|
||||
expect(validateIntegerInRange("0", { min: 1, max: 10 }).valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a value above the maximum", () => {
|
||||
const result = validateIntegerInRange("11", { min: 1, max: 10 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberOutOfRange");
|
||||
});
|
||||
});
|
||||
|
||||
describe("validateBatchRange", () => {
|
||||
it("accepts a valid ascending range within the span", () => {
|
||||
expect(validateBatchRange("1", "5", { maxSpan: 100 }).valid).toBe(true);
|
||||
expect(validateBatchRange("3", "3", { maxSpan: 100 }).valid).toBe(true);
|
||||
});
|
||||
|
||||
it("accepts a range exactly at the max span", () => {
|
||||
expect(validateBatchRange("1", "100", { maxSpan: 100 }).valid).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects an end part before the start", () => {
|
||||
const result = validateBatchRange("5", "2", { maxSpan: 100 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.rangeEndBeforeStart");
|
||||
expect(result.errorParams).toEqual({ start: 5, end: 2 });
|
||||
});
|
||||
|
||||
it("rejects a range that exceeds the max span", () => {
|
||||
const result = validateBatchRange("1", "101", { maxSpan: 100 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.rangeTooLarge");
|
||||
expect(result.errorParams).toEqual({ maxSpan: 100 });
|
||||
});
|
||||
|
||||
it("rejects a decimal endpoint", () => {
|
||||
const result = validateBatchRange("1", "5.5", { maxSpan: 100 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberNotInteger");
|
||||
});
|
||||
|
||||
it("rejects a non-positive start", () => {
|
||||
expect(validateBatchRange("-1", "5", { maxSpan: 100 }).valid).toBe(false);
|
||||
expect(validateBatchRange("0", "5", { maxSpan: 100 }).valid).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a blank endpoint", () => {
|
||||
const result = validateBatchRange("", "5", { maxSpan: 100 });
|
||||
expect(result.valid).toBe(false);
|
||||
expect(result.error).toBe("validation.numberRequired");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user