Skip to content

util: add gen_oopsy_timeline_replace#1011

Open
Jaehyuk-Lee wants to merge 19 commits intoOverlayPlugin:mainfrom
Jaehyuk-Lee:oopsy-i18n-data
Open

util: add gen_oopsy_timeline_replace#1011
Jaehyuk-Lee wants to merge 19 commits intoOverlayPlugin:mainfrom
Jaehyuk-Lee:oopsy-i18n-data

Conversation

@Jaehyuk-Lee
Copy link

@Jaehyuk-Lee Jaehyuk-Lee commented Feb 21, 2026

resolves #999

Main feature

gen_oopsy_timeline_replace.ts automatically generates Oopsyraidsy's timelineReplace (replaceSync only).

Jobs done

  1. Development of source translation generator (gen_oopsy_timeline_replace.ts)
    • Created a script to auto-generate replaceSync fields for Oopsy data
    • Implemented regex generation to handle multiple translation candidates
    • Work case-insensitively
    • Fixed translation mappings related to German names and grammar rules (replaceGermanGrammarTags())
  2. Applied Oopsyraidsy replaceSync i18n Data
    • Automatically generated and applied timelineReplace translation mapped data into existing Oopsy data files

CLI Output

$ node --loader=ts-node/esm util/gen_oopsy_timeline_replace.ts
(node:34236) ExperimentalWarning: `--experimental-loader` may be removed in the future; instead use `register()`:
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:34236) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
Alert: ui/oopsyraidsy/data/05-shb/raid/e12s.ts: Multiple candidates for 'Ice Pillar' in cn: 冰柱, 氷柱
Alert:          Using existing translation: '冰柱'
Alert: ui/oopsyraidsy/data/05-shb/raid/e12s.ts: Multiple candidates for 'Ice Pillar' in tc: 冰柱, 氷柱
Alert:          Using existing translation: '冰柱'
Success: Updated: 13, Skipped: 242

How this work

  1. Search and process all data files from ui/oopsyraidsy/data (process repeatedly file by file)
  2. Find all source and target. Capture with regex /(?:source|target):\s*(?:['"]([^'"]+)['"]|\[((?:['"][^'"]+['"],?\s*)+)\])/g
  3. If there are no source and target, skip the file.
  4. Fetch BNpcName data from xivapi, and ffxiv-datamining-ko / cn / tc
  5. Map "English BNpcName" → "BNpcName ID" (works case-insensitive)
  6. Map "BNpcName ID" → "localized BNpcName"

Questions for Reviewers

Should I also include the following tasks in this PR?

  • add npm run command to run this script in package.json

@github-actions github-actions bot added 💬ko 💬cn util /util oopsy /ui/oopsyraidsy module needs-review Awaiting review 💬tc labels Feb 21, 2026
'locale': 'cn',
'replaceSync': {
'Chiseled Sculpture': '被创造的男性',
'Ice Pillar': '冰柱',
Copy link
Author

@Jaehyuk-Lee Jaehyuk-Lee Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I manually chose 冰柱 (options: 冰柱 / 氷柱) for Chinese translation which was being used in raidboss e12s data.

'Ice Pillar': '冰柱',

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

Labels

💬cn 💬ko needs-review Awaiting review oopsy /ui/oopsyraidsy module 💬tc util /util

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementing auto-generated timelineReplace for Oopsyraidsy

1 participant