Skip to content

feat(localization): add StringTable discovery and validation - #131

Open
kunkunGames wants to merge 1 commit into
tumourlove:masterfrom
kunkunGames:agent/localization-string-table-inspection
Open

feat(localization): add StringTable discovery and validation#131
kunkunGames wants to merge 1 commit into
tumourlove:masterfrom
kunkunGames:agent/localization-string-table-inspection

Conversation

@kunkunGames

Copy link
Copy Markdown

Summary

Add a cohesive, read-only localization preflight surface for culture discovery and bounded StringTable discovery, readback, and validation without mutating or dirtying packages.

Problem

Monolith already exposes StringTable authoring through the broad blueprint namespace, but automation has no focused read-only contract for finding tables, paging large entry sets, bounding metadata/text payloads, or proving that validation covered the whole asset. Callers currently have to load and reconstruct this state themselves, and a truncated scan can be mistaken for a valid table.

Solution

Add four actions under a dedicated read-only and idempotent localization dispatcher:

Action Purpose
list_cultures Stable bounded Unreal culture discovery, including explicit-root resolution and unresolved names
list_string_tables Stable Asset Registry discovery with bounded pagination and optional returned-page details
get_string_table Exclusive-key entry pagination with independent metadata-row and text-length budgets
validate_string_table Deterministic bounded key/source issues, paginated diagnostics, and explicit completeness

All asset inputs require canonical mounted package paths or matching top-level object paths. Culture lists, asset pages, entry pages, metadata rows, text values, validation scans, and issue pages have documented hard bounds. Readback separates has_more_entries, all_entries_covered, and metadata_complete; validation reports valid=true only when the scan is complete and has zero errors.

The implementation keeps memory bounded while finding the lexicographically smallest entry keys, rather than materializing an unbounded sorted copy. It registers before the config-authoring gate because culture and StringTable inspection do not depend on config mutation, so these actions remain available when bEnableConfig=false.

The existing blueprint StringTable actions remain the authoring surface. This PR intentionally adds no create, set, remove, import, export, transaction, dirty, or save action.

Verification

  • UE 5.7 RunUAT BuildPlugin -NoTargetPlatforms -Rocket: 436/436 build actions passed; UAT exit code 0
  • UE 5.8 RunUAT BuildPlugin -NoTargetPlatforms -Rocket: 436/436 build actions passed; UAT exit code 0
  • final UE 5.7 Editor target rebuild: 436/436 build actions passed; UBT exit code 0
  • final UE 5.8 Editor target rebuild: 436/436 build actions passed; UBT exit code 0
  • UE 5.7 Automation RunTests Monolith.Localization.Read: 3/3 passed, zero failures/skips, exit code 0
  • UE 5.8 Automation RunTests Monolith.Localization.Read: 3/3 passed, zero failures/skips, exit code 0
  • implementation scan found exactly four localization actions and no production transaction, save, mutation, package-dirty, mutable StringTable, or asset create/delete calls
  • new source and tests contain no anonymous namespaces, using namespace directives, or individual using declarations
  • git diff --check passed
  • detailed evidence: Docs/testing/2026-08-04-string-table-discovery-validation.md

The first focused run in each engine also disproved a proposed case-insensitive duplicate-key audit: Unreal's FTextKey identity does not retain simultaneous Case and case rows in a StringTable. The unreachable check and misleading test were removed rather than reporting a diagnostic from data the engine cannot preserve; the final runs above are the post-correction 3/3 gates.

Compatibility and risk

This PR adds a direct AssetRegistry dependency to the existing editor module MonolithConfig; it does not add a runtime module or change the existing blueprint StringTable authoring contract. It also reconciles the stale documented config count with the seven actions already registered by source before adding the four-action localization namespace.

Large tables remain bounded by hard caps and explicit continuation/completeness fields. Invalid paths, wrong asset types, load failures, and incomplete validation fail explicitly; no fallback asset, widened path, substitute data, or silent legacy branch is used.

Visual evidence

Not applicable: this PR adds headless action handlers, schemas, automation tests, documentation, and routing guidance with no visual or editor-facing UI change.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3b829d9374

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return nullptr;
}

UObject* Object = FSoftObjectPath(OutObjectPath).TryLoad();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject redirected StringTable paths

When asset_path names an UObjectRedirector left by a StringTable rename, FSoftObjectPath::TryLoad() follows the redirect and returns the destination table. The action then silently inspects or validates a different asset and even reports its new path, despite the exact-path/no-substitution contract; reject redirects or verify that the loaded object's path still equals OutObjectPath before returning it.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant