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

fixed string duplication for defaulted values #206

Merged
merged 2 commits into from
Mar 2, 2025
Merged

Conversation

Baptistemontan
Copy link
Owner

When a key was missing the value was defaulted to the default locale, but the process was to simply clone the value.
This worked perfectly but introduce some duplicates strings, now the value is not cloned anymore but marked to be defaulted to another locale, this basically change

match locale {
    Locale::en => "some string",
    Locale::fr =>  "some string", // <- duplicated string
}

to

match locale {
    Locale::en | Locale::fr => "some string",
}

@Baptistemontan
Copy link
Owner Author

Baptistemontan commented Mar 2, 2025

This change also allows to take the target default, for now it is still always the default locale, but this could allow to specify different default for each locales, such that en-GB default be en, and fr-CA be fr, tho this could introduce recursives default, either infinite or finite, this is to take into account.

@Baptistemontan Baptistemontan merged commit 3f40d9a into master Mar 2, 2025
29 checks passed
@Baptistemontan Baptistemontan deleted the dedup_defaults branch March 5, 2025 10:21
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