File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ static int Main(string[] args) {
130130
131131 // Localization
132132 try {
133- Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
133+ SystemCulture = CultureInfo . CurrentCulture ;
134+ if ( ! string . IsNullOrEmpty ( Settings . Default . language ) )
135+ Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
134136 } catch ( CultureNotFoundException e ) {
135137 Console . WriteLine ( e . Message ) ;
136138 }
@@ -161,6 +163,7 @@ static int Main(string[] args) {
161163 errs => DisplayHelp ( parseResult , errs ) ) ;
162164
163165 }
166+ public static CultureInfo SystemCulture { get ; set ; }
164167
165168 static int DisplayHelp < T > ( ParserResult < T > result , IEnumerable < Error > errs ) {
166169 HelpText helpText ;
@@ -415,7 +418,6 @@ static int RunConfig(ArgsConfig args) {
415418 Wizard . SetAutosaveMode ( ( bool ) args . Autosave ) ;
416419 if ( args . Language != null ) {
417420 Settings . Default . language = args . Language . ToLowerInvariant ( ) == "auto" ? "" : args . Language ;
418- Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
419421 }
420422 if ( args . RegisterContextMenu )
421423 foreach ( var entry in RegistryUtil . AllContextMenu ) {
Original file line number Diff line number Diff line change @@ -63,19 +63,21 @@ private void UpdateLanguageMenu() {
6363
6464 settingsMenuLanguage . DropDownItems . Clear ( ) ;
6565 foreach ( var culture in cultures ) {
66- var flag = string . Concat ( culture . TwoLetterISOLanguageName . ToUpperInvariant ( ) . Select ( x => char . ConvertFromUtf32 ( x + 0x1F1A5 ) ) ) ; // + "\ufe0f"
67- var description = Equals ( culture , CultureInfo . InvariantCulture ) ? Resources . str_system_language + @" 💻️"
66+ //var flag = string.Concat(culture.TwoLetterISOLanguageName.ToUpperInvariant().Select(x => char.ConvertFromUtf32(x + 0x1F1A5))); // + "\ufe0f"
67+ var code = Equals ( culture , CultureInfo . InvariantCulture ) ? "" : culture . Name ;
68+ var description = code == "" ? Resources . str_system_language + @" 💻️"
6869 : culture . DisplayName + @" – " + culture . NativeName + @" [" + culture . Name + @"]" ;
6970
7071 var item = new ToolStripMenuItem ( description , null , ( sender , args ) => {
71- Settings . Default . language = culture . Name ;
72+ Settings . Default . language = code ;
7273 Settings . Default . Save ( ) ;
73- Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
74+ Thread . CurrentThread . CurrentUICulture = string . IsNullOrEmpty ( Settings . Default . language ) ? Program . SystemCulture
75+ : CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
7476 ReloadUi ( ) ;
7577 Height += 100 ;
7678 } ) ;
7779
78- item . Checked = Settings . Default . language == culture . Name ;
80+ item . Checked = Settings . Default . language == code ;
7981 settingsMenuLanguage . DropDownItems . Add ( item ) ;
8082
8183 }
You can’t perform that action at this time.
0 commit comments