Repository navigation
For new strings, in the absence of localization, the English text is sent - #77
Merged
Merged
Conversation
Add base-template filtering and English fallback merging, validate dictionary JSON values, and handle malformed files, duplicate keys, and language IDs more safely. Add unit tests for loading and fallback behavior. Co-Authored-By: ChatGPT <noreply@openai.com>
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.
Compare
developwithaqpanaciy-custom-dictionarySummary
Previously, a language without a server dictionary received the full English
0.json, which could overwrite translations already built into the client. A partial server dictionary also received no English entries for new content missing from that file.When
customDictionary/base.json.templateis present, the server now builds the fallback from English keys outside the client baseline, then overlays all entries from the selected server language. The selected language takes precedence, including explicit empty strings. Selecting English still returns the full server0.json. The server prepares these dictionaries at startup for use in the existing sign-in response.Without the template, the server logs a startup warning and uses the previous selection rules. A language with its own file receives that dictionary. Other languages receive the full English file when available.
The loader skips keys that GenXY cannot safely carry and logs the file, key, and line number. For repeated JSON keys it keeps the first value and logs a warning. If a template is present and either the template or the required English dictionary cannot be loaded, the server logs an error and disables custom dictionaries.
Related pull request
The companion OPDB PR supplies the Live 36 baseline and corrected language data. Place its
base.json.templatealongside the numbered dictionaries incustomDictionaryto enable the new behavior.Validation