Simplify locale: use single struct hierachy with optional fields#330
Merged
tolik518 merged 6 commits intotolik518:masterfrom Mar 8, 2026
Merged
Simplify locale: use single struct hierachy with optional fields#330tolik518 merged 6 commits intotolik518:masterfrom
tolik518 merged 6 commits intotolik518:masterfrom
Conversation
Owner
|
The changed lines looked scary before I've seen the changes :D I'll QA all the open PRs sometime next week as I'm currently in the middle of moving and I don't have internet in my new flat yet. If something critical happens in my absence, feel free to merge fixes I'll still lurk here, but only on the phone |
Owner
|
Looks good from what I've seen. After #327 was merged I'll merge this one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently
Localeis quite unwieldy. If one wants to add a single field, they have to make a new module, copy the struct with the field, add it, copy the struct that is in, change it and so on until Locale. Then they have to add these structs to the helper enums and add the get/set_field macro invocations.This architecture was chosen to have locale versions. I feel that there is too little benefit in having versions to justify this complexity.
With these changes, that replace the versions with simple optional fields, we save 240 lines in
locale.