Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON converter #19

Merged
merged 17 commits into from
Jan 12, 2024
Merged

Add JSON converter #19

merged 17 commits into from
Jan 12, 2024

Conversation

kg583
Copy link
Member

@kg583 kg583 commented Dec 21, 2023

A straightforward JSON converter function, which doubly serves as a partial format validator. This would be called by CI to deposit the converted sheet in the built branch. The file name anticipates more formats, but there are no others I'd advocate for at this very moment.

The JSON format makes unique tags into keys and collects everything else into lists. Each token is a list of version dicts, and each translation lives in the version's langs dict, indexed by language code. The list of variants is not present if it is empty (okay with changing this).

@kg583 kg583 added the enhancement New feature or request label Dec 21, 2023
@kg583 kg583 self-assigned this Dec 21, 2023
@kg583
Copy link
Member Author

kg583 commented Dec 25, 2023

The past three commits add a rather beefy validator function for the primary sheet, which does more than a static XML schema could with regards to checking tag contents, name uniqueness, etc. It's a little tricky to test given that the sheets currently pass, but some dummy edits have proven its at least not doing nothing. Detailed errors on which token fails validation and how are provided at every opportunity.

@kg583 kg583 marked this pull request as draft December 30, 2023 06:18
@kg583 kg583 marked this pull request as ready for review December 30, 2023 06:20
@kg583 kg583 merged commit 9e81db1 into main Jan 12, 2024
2 checks passed
@kg583 kg583 deleted the formats branch January 12, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant