Repository navigation
ui: language command docs and error list every language - #1998
Merged
Merged
Conversation
app.language.set's engine.commands docs and its unknown-language error were written by hand and had fallen behind: the docs missed es, fr and sr, the error missed de, fr and sr. Both are now built from Language::ALL (Language::code_list), and tests check every language is listed in each.
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.
app.language.settakes 11 language codes, but the two places that list them were written by hand and had fallen behind:engine.commandsdocs forapp.language.set(control.rs)es,fr,srlib.rs)de,fr,srChanges
Language::code_list(separator)builds the quoted list fromLanguage::ALL, and both places use it. A new language is listed automatically.language_command_docs_list_every_language(control.rs) and an extra check inlanguage_commands_switch_and_persistthat the error for"xx"names every code.docs/control-protocol.mdmentions where the codes are listed.Noticed by CodeRabbit on #1807 (Polish interface). That PR adds
plto both lists by hand. Whichever lands second drops that hand-written part, sinceLanguage::ALLwill include Polish.Tests
Locally on Windows:
cargo fmt --check,cargo test -p gridcraft-ui-egui(all pass).cargo clippy -p gridcraft-ui-egui -D warningsstops only at the existinglet_unit_valueindesktop_theme.rs, which is onmainand not touched here.Summary by CodeRabbit