#NEWLINE# def ok( self , event = None ) : #NEWLINE# #INDENT# labelLangIndex = self . cbLabelLang . valueIndex #NEWLINE# if ( ( labelLangIndex >= 0 ) and ( labelLangIndex != self . labelLangIndex ) ) : #NEWLINE# #INDENT# if ( labelLangIndex == 0 ) : #NEWLINE# #INDENT# langCode = self . mainWin . modelManager . defaultLang #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( langCode , sep , localeCode ) = self . languageCodes [ self . cbLabelLang . value ] . partition ( ' ' ) #NEWLINE# #UNINDENT# self . mainWin . config [ 'labelLangOverride' ] = langCode #NEWLINE# self . mainWin . labelLang = langCode #NEWLINE# #UNINDENT# uiLangIndex = self . cbUiLang . valueIndex #NEWLINE# if ( ( uiLangIndex >= 0 ) and ( uiLangIndex != self . uiLangIndex ) ) : #NEWLINE# #INDENT# if ( uiLangIndex == 0 ) : #NEWLINE# #INDENT# langCode = self . mainWin . modelManager . defaultLang #NEWLINE# localeCode = '' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( langCode , sep , localeCode ) = self . languageCodes [ self . cbUiLang . value ] . partition ( ' ' ) #NEWLINE# if ( not self . mainWin . isMSW ) : #NEWLINE# #INDENT# localeCode = ( langCode . replace ( '-' , '_' ) + '.UTF-8' ) #NEWLINE# #UNINDENT# #UNINDENT# newLocale = getUserLocale ( localeCode ) #NEWLINE# if ( newLocale is not None ) : #NEWLINE# #INDENT# self . mainWin . modelManager . locale = newLocale #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messagebox . showerror ( _ ( 'User interface locale error' ) , _ ( 'Locale setting {0} ({1}) is not supported on this system' ) . format ( langCode , localeCode ) , parent = self ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( localeCode != '' ) : #NEWLINE# #INDENT# self . mainWin . config [ 'userInterfaceLangOverride' ] = langCode #NEWLINE# self . mainWin . config [ 'userInterfaceLocaleOverride' ] = localeCode #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . mainWin . config . pop ( 'userInterfaceLangOverride' , None ) #NEWLINE# self . mainWin . config . pop ( 'userInterfaceLocaleOverride' , None ) #NEWLINE# #UNINDENT# self . mainWin . setUiLanguage ( langCode ) #NEWLINE# if messagebox . askyesno ( _ ( 'User interface language changed' ) , _ ( 'Should Arelle restart with changed user interface language, if there are any unsaved changes they would be lost!' ) , parent = self ) : #NEWLINE# #INDENT# self . mainWin . uiThreadQueue . put ( ( self . mainWin . quit , [ None , True ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messagebox . showwarning ( _ ( 'User interface language changed' ) , _ ( 'Please restart Arelle for the change in user interface language.' ) , parent = self ) #NEWLINE# #UNINDENT# #UNINDENT# self . close ( )