Fix language switching, localization gaps, and auto-detect system language#370
Open
Szy-Cathay wants to merge 1 commit into
Open
Fix language switching, localization gaps, and auto-detect system language#370Szy-Cathay wants to merge 1 commit into
Szy-Cathay wants to merge 1 commit into
Conversation
…nguage - Fix language switching not working: replace hardcoded "en" with SelectedLangauge from user settings in App startup - Auto-detect system language on first launch via CultureInfo.CurrentUICulture, mapping zh→cn, en→en, fr→fr, with en as fallback - Fix Reports > Bmd menu item showing raw key due to stale RmvToText key in language JSONs - Fix Kitbash animation panel CollapsableFilterControl buttons showing raw localization keys instead of translated text; replaced hardcoded English "Browse"/"Hide" with DI-based localization lookups - Sync Language_Cn.json with Language_En.json: add missing keys (MenuBar.File.OpenProjectFolder, ImportPackAsProject, ImportReferencePack), remove outdated MenuBar.File.OpenPack, translate all PackFileCache entries, add Dialog.Filter.Hide key Files changed: AssetEditor/App.xaml.cs AssetEditor/Language_Cn.json AssetEditor/Language_En.json Shared/SharedUI/Shared.Ui/BaseDialogs/FilterDialog/CollapsableFilterControl.xaml.cs
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.
Summary
This PR addresses several localization issues and adds system language auto-detection for first-time users.
Changes
Bug Fixes:
Language switching not working — The startup code was hardcoding
"en"inLoadLanguage()instead of reading the user's saved language preference fromApplicationSettings.SelectedLangauge. This caused the language setting to always reset to English on restart.Reports > Bmd menu shows raw key — The XAML uses
MenuBar.Reports.Bmdbut both language JSONs still had the old keyMenuBar.Reports.RmvToText. WhenLocExtensioncan't find a translation, it falls back to displaying the raw key string. Fixed by updating the key in both language files.Kitbash animation panel buttons show raw keys —
CollapsableFilterControl.xaml.cswas overriding the XAML{loc:Loc}bindings by settingBrowseButton.Contentto hardcoded English strings"Browse"and"Hide"inToggleSearchFiled()andHandleItemDoubleClicked(). Replaced with DI-based localization lookups that follow the sameIAssetEditorMain→LocalizationManagerpattern used byLocExtension.New Feature:
IsFirstTimeStartingApplicationistrue, readsCultureInfo.CurrentUICulture.TwoLetterISOLanguageName, mapszh→cn,en→en,fr→fr(withenas fallback), and saves the detected language before the UI loads. A file-existence check ensures the correspondingLanguage_*.jsonexists before applying.Localization Sync:
Chinese language file (
Language_Cn.json) brought in sync with English:MenuBar.File.OpenPackwithMenuBar.File.OpenProjectFolderMenuBar.File.ImportPackAsProject,MenuBar.File.ImportReferencePackPackFileCache.*entries (were English-only)Dialog.Filter.HidekeyEnglish language file (
Language_En.json) updated:MenuBar.Reports.RmvToText→MenuBar.Reports.BmdDialog.Filter.HidekeyFiles Changed
AssetEditor/App.xaml.csAssetEditor/Language_Cn.jsonAssetEditor/Language_En.jsonShared/SharedUI/Shared.Ui/BaseDialogs/FilterDialog/CollapsableFilterControl.xaml.csTesting
cn)