@@ -90,6 +90,9 @@ class ArgsConfig : ArgsCommon {
9090 [ Option ( "disable-patching" , HelpText = "Disables clipboard patching" , SetName = "patching" ) ]
9191 public bool UnregisterPatching { get ; set ; }
9292
93+ [ Option ( "language" , HelpText = "ISO 639-1 language code for UI Localization ('auto' for system language)" , SetName = "language" ) ]
94+ public string Language { get ; set ; }
95+
9396 }
9497
9598 [ Verb ( "wizard" , HelpText = "Open the first-launch wizard" ) ]
@@ -119,6 +122,13 @@ static int Main(string[] args) {
119122 PortableSettingsProvider . ApplyProvider ( Settings . Default ) ;
120123#endif
121124
125+ // Localization
126+ try {
127+ Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
128+ } catch ( CultureNotFoundException e ) {
129+ Console . WriteLine ( e . Message ) ;
130+ }
131+
122132 Settings . Default . continuousMode = false ; // always start in normal mode
123133 Settings . Default . Save ( ) ;
124134
@@ -397,6 +407,10 @@ static int RunConfig(ArgsConfig args) {
397407 Settings . Default . clrClipboard = ( bool ) args . ClearClipboard ;
398408 if ( args . Autosave != null )
399409 Wizard . SetAutosaveMode ( ( bool ) args . Autosave ) ;
410+ if ( args . Language != null ) {
411+ Settings . Default . language = args . Language . ToLowerInvariant ( ) == "auto" ? "" : args . Language ;
412+ Thread . CurrentThread . CurrentUICulture = CultureInfo . CreateSpecificCulture ( Settings . Default . language ) ;
413+ }
400414 if ( args . RegisterContextMenu )
401415 foreach ( var entry in RegistryUtil . AllContextMenu ) {
402416 entry . Register ( ) ;
0 commit comments