# Japanese fork manifest — single source of truth.
#
# Consumed by:
#   * scripts/japort_audit.py            (presence / orphan / context checks)
#   * scripts/japort_check_upstream.py   (which upstream files to diff)
#   * docs/JAPANESE_FORK.md              (manual table sync — see audit)
#
# Editing rules:
#   * Add a new JP module    -> append to [[modules]]
#   * Retire a JP setting    -> append to [[deprecated_settings]]
#   * Touch a new upstream   -> append to [[upstream_hook_targets]]
#   * Change a data file     -> append to [[data_layer]]
# Keep the audit script green:  python scripts/japort_audit.py

schema_version = 1
fork_label     = "openmw-ja-port"

# ----------------------------------------------------------------------
# JP-only modules. The audit verifies that *both* hpp and cpp exist and
# that the basename is referenced by a CMakeLists.txt (otherwise the
# module is silently not linked).
# ----------------------------------------------------------------------

[[modules]]
base   = "apps/openmw/mwgui/localehelperja"
role   = "MWGui::JaLocale::isPreferred()"
touches = ["apps/openmw/mwgui/effectstringja.cpp",
           "apps/openmw/mwgui/journalbooks.cpp",
           "apps/openmw/mwgui/journalwindow.cpp"]

[[modules]]
base   = "apps/openmw/mwgui/dateformatja"
role   = "Tertiary-era / N日目 / セーブ日時 formatting"
touches = ["apps/openmw/mwgui/savegamedialog.cpp",
           "apps/openmw/mwgui/waitdialog.cpp",
           "apps/openmw/mwgui/journalviewmodel.cpp"]

[[modules]]
base   = "apps/openmw/mwgui/fontscalepolicyja"
role   = "Centralized font scale policy w/ JournalBooks ScalingLayer compensation"
touches = ["apps/openmw/mwgui/bookpage.cpp",
           "apps/openmw/mwgui/formatting.cpp"]

[[modules]]
base   = "apps/openmw/mwgui/bookpagekinsokuja"
role   = "Forbidden-line-head table for BookTypesetter (journal path)"
touches = ["apps/openmw/mwgui/bookpage.cpp"]

[[modules]]
base   = "apps/openmw/mwgui/effectstringja"
role   = "Natural Japanese magic-effect description formatter"
touches = ["apps/openmw/mwgui/widgets.cpp",
           "apps/openmw/mwgui/spellicons.cpp"]

[[modules]]
base   = "components/widgets/listfontpolicyja"
role   = "Quest-link list font height (matches JaFontScale)"
touches = ["components/widgets/list.cpp"]

[[modules]]
base   = "components/debug/systemlocaleja"
role   = "OS-level Japanese UI detection (safe pre-L10nManager)"
touches = ["components/debug/debugging.cpp",
           "components/settings/settings.cpp",
           "components/settings/parser.cpp",
           "components/crashcatcher/crashcatcher.cpp",
           "components/crashcatcher/windowscrashcatcher.cpp",
           "components/crashcatcher/windowscrashmonitor.cpp"]

[[modules]]
base   = "components/settings/settingsmigrationja"
role   = "Silent purge of retired JP-fork keys from user settings.cfg"
touches = ["components/settings/settings.cpp"]

# ----------------------------------------------------------------------
# Upstream files that carry one or more `// [openmw-ja-port-hook]` blocks.
# `expected_hooks` is the count the audit/diff script will assert.
# When upstream rewrites one of these files, increment / decrement here.
# ----------------------------------------------------------------------

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/bookpage.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/formatting.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/journalbooks.cpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/journalwindow.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/journalviewmodel.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/journalviewmodel.hpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/savegamedialog.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/waitdialog.cpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/widgets.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/spellicons.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/messagebox.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/windowmanagerimp.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "components/widgets/list.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "components/settings/settings.cpp"
expected_hooks = 5

[[upstream_hook_targets]]
path = "components/settings/parser.cpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "components/debug/debugging.cpp"
expected_hooks = 2

[[upstream_hook_targets]]
path = "apps/launcher/maindialog.cpp"
expected_hooks = 1

# Added 2026-06-19 vanilla rebase: previously-untracked upstream-touching files.
[[upstream_hook_targets]]
path = "apps/launcher/settingspage.cpp"
expected_hooks = 3

[[upstream_hook_targets]]
path = "components/crashcatcher/crashcatcher.cpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "components/crashcatcher/windowscrashcatcher.cpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "components/crashcatcher/windowscrashmonitor.cpp"
expected_hooks = 2

# Dialogue @#-link / @表示=トピック# support (JP-specific deltas on top of
# vanilla 0.51.0's native parseHyperText / getDisplayName / topicStandardForm).
[[upstream_hook_targets]]
path = "apps/openmw/mwdialogue/keywordsearch.hpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "apps/openmw/mwdialogue/keywordsearch.cpp"
expected_hooks = 4

[[upstream_hook_targets]]
path = "apps/openmw/mwgui/dialogue.cpp"
expected_hooks = 1

# dialoguemanagerimp: @#-link topic id resolution (explicit/implicit) + external
# voice-pack playback (tryPlayVoice). JP-critical for tes3jp Japanese DIAL ids.
[[upstream_hook_targets]]
path = "apps/openmw/mwdialogue/dialoguemanagerimp.hpp"
expected_hooks = 1

[[upstream_hook_targets]]
path = "apps/openmw/mwdialogue/dialoguemanagerimp.cpp"
expected_hooks = 5

# ----------------------------------------------------------------------
# Data layer files. Audit checks the file exists; intentional list so
# bulk upstream merges don't accidentally lose a translation file.
# ----------------------------------------------------------------------

[[data_layer]]
path  = "files/data/l10n/OMWEngine/ja.yaml"
note  = "core engine UI strings"

[[data_layer]]
path  = "files/data/l10n/Calendar/ja.yaml"
note  = "Japanese month names and date formatting"

[[data_layer]]
path  = "files/data/l10n/Interface/ja.yaml"
note  = "shared interface strings"

[[data_layer]]
path  = "files/data/l10n/OMWCamera/ja.yaml"
note  = "camera script UI strings"

[[data_layer]]
path  = "files/data/l10n/OMWCombat/ja.yaml"
note  = "combat script UI strings"

[[data_layer]]
path  = "files/data/l10n/OMWControls/ja.yaml"
note  = "controls UI strings"

[[data_layer]]
path  = "files/data/l10n/OMWMusic/ja.yaml"
note  = "music UI strings"

[[data_layer]]
path  = "files/data/l10n/OMWShaders/ja.yaml"
note  = "post-processing UI strings"

[[data_layer]]
path  = "files/data/CMakeLists.txt"
note  = "registers every Japanese l10n YAML for deployment"

[[data_layer]]
path  = "files/data/mygui/openmw_messagebox.layout"
note  = "subtitle / interactive box width = 640"

[[data_layer]]
path  = "files/settings-default.cfg"
note  = "default font scale / auto scaling / preferred locales"

[[data_layer]]
path  = "scripts/apply_mygui_patch.cmake"
note  = "MyGUI fetch-time patch (CJK wrap + line-head kinsoku)"

[[data_layer]]
path  = "files/lang/launcher_ja.ts"
note  = "launcher Qt translation catalog"

[[data_layer]]
path  = "files/lang/components_ja.ts"
note  = "shared Qt component translation catalog"

[[data_layer]]
path  = "files/lang/wizard_ja.ts"
note  = "settings wizard Qt translation catalog"

[[data_layer]]
path  = "files/journal_japanese_yomi.tsv"
note  = "journal topic reading dictionary copied beside openmw.exe"

[[data_layer]]
path  = "files/japanese_fallback_overrides.tsv"
note  = "launcher fallback dictionary copied beside openmw-launcher.exe"

[[data_layer]]
path  = "files/data/fonts/Kosugi-Regular.ttf"
note  = "Japanese TrueType font"

[[data_layer]]
path  = "CMakeLists.txt"
note  = "patched static MyGUI and Windows runtime dictionary install rules"

[[data_layer]]
path  = "scripts/package_japanese_release.py"
note  = "curated Windows engine/source ZIP builder and staging validator"

[[data_layer]]
path  = "scripts/sync_mjl_runtime_data.py"
note  = "synchronizes generated journal yomi from the MJL workspace"

# ----------------------------------------------------------------------
# Retired (category, key) pairs that the JP fork once shipped. These are
# silently dropped from user `settings.cfg` at startup so a leftover
# entry never crashes the engine. Mirror this list in
# components/settings/settingsmigrationja.cpp:kDeprecatedJaPortKeys.
# Audit asserts the two stay in sync.
# ----------------------------------------------------------------------

[[deprecated_settings]]
category = "General"
key      = "debug language toggle enabled"
removed  = "2026-04-25"
reason   = "JP/EN debug hot-toggle rolled back (low utility w/ MyGUI static labels)"
