Skip to content

Commit

Permalink
LanguageSelection: Restart UI when language is changed
Browse files Browse the repository at this point in the history
But show a popup to ensure if you really want this, which also protect
tasks and recordings. This to ensure everything is correctly translated.
E.g. the lists in configs were not translated
  • Loading branch information
littlesat committed Dec 23, 2016
1 parent c3384c5 commit c2cc0fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/python/Screens/LanguageSelection.py
Expand Up @@ -8,6 +8,8 @@
from Components.Pixmap import Pixmap
from Screens.InfoBar import InfoBar
from Screens.Rc import Rc
from Screens.MessageBox import MessageBox
from Screens.Standby import TryQuitMainloop
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN, SCOPE_LANGUAGE
from Tools.LoadPixmap import LoadPixmap
import enigma
Expand Down Expand Up @@ -49,10 +51,13 @@ def selectActiveLanguage(self):
def save(self):
self.commit(self.run())
if InfoBar.instance and self.oldActiveLanguage != config.osd.language.value:
self.close(True)
self.session.openWithCallback(self.restartGUI, MessageBox,_("GUI needs a restart to apply a new language\nDo you want to restart the GUI now?"), MessageBox.TYPE_YESNO, title=_("Restart GUI now?"))
else:
self.close()

def restartGUI(self, answer):
answer and self.session.open(TryQuitMainloop, 3)

def cancel(self):
language.activateLanguage(self.oldActiveLanguage)
self.close()
Expand Down

0 comments on commit c2cc0fc

Please sign in to comment.