Skip to content

test: Add localized text type and associated tests#291

Open
dandwyer wants to merge 1 commit intoRaidTheory:mainfrom
dandwyer:feature/test_localization
Open

test: Add localized text type and associated tests#291
dandwyer wants to merge 1 commit intoRaidTheory:mainfrom
dandwyer:feature/test_localization

Conversation

@dandwyer
Copy link
Copy Markdown

@dandwyer dandwyer commented Apr 14, 2026

@baschny : I deconflated this out of #287, per your request. From your comment there, understood that this may be controversial, but also noting some of the complexity in the schemas is driven by coercing a consistent output data type from inconsistent input data. This means that much of code can be deleted when data in the JSONs is made to match the canonical type.

Comment on lines +32 to +53
const LocalizedTextRaw = LocalizedTextCanonical.extend({
ko: z.string().optional(),
"ko-KR": z.string().optional(),
kr: z.string().optional()
}).describe("LocalizedTextRaw");

export const LocalizedText = LocalizedTextRaw.transform((data) => {
const { ko, ["ko-KR"]: _koKR, kr, ...rest } = data;

return {
...rest,
"ko-KR": _koKR ?? ko ?? kr
};
})
.pipe(LocalizedTextCanonical.strict())
.describe("LocalizedText");

// Private data exported for testing purposes only. Not intended for public use.
export const __internal__ = {
LocalizedTextCanonical,
LocalizedTextRaw
};
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

All this can go away when #287 is merged.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Understood that there is a lot going on in this file, but it should reduce review fatigue to ensure consistency when reviewing PRs associated w/ translations, which appear to be a frequent axis of change.

dandwyer added a commit to dandwyer/arcraiders-data that referenced this pull request Apr 15, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request Apr 15, 2026
dandwyer added a commit to dandwyer/arcraiders-data that referenced this pull request Apr 15, 2026
dandwyer added a commit to dandwyer/arcraiders-data that referenced this pull request Apr 15, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request Apr 16, 2026
dandwyer added a commit to dandwyer/arcraiders-data that referenced this pull request Apr 22, 2026
dandwyer added a commit to dandwyer/arcraiders-data that referenced this pull request Apr 22, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request Apr 28, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request Apr 29, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request May 1, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request May 4, 2026
github-actions Bot pushed a commit to dandwyer/arcraiders-data that referenced this pull request May 7, 2026
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