summaryrefslogtreecommitdiff
path: root/jfr_playoff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2019-06-23 14:07:43 +0200
committeremkael <emkael@tlen.pl>2019-06-23 14:07:43 +0200
commit1104824f43f9b0c9e0383baec06ae3c4760b9f8c (patch)
treed78c69febe5d427ec684f12961a8dcfbab0b776c /jfr_playoff
parentd4ae979a02ee312750ce2b681f34b74d116c6459 (diff)
Properly resetting translations tab data
Diffstat (limited to 'jfr_playoff')
-rw-r--r--jfr_playoff/gui/frames/translations.py8
-rw-r--r--jfr_playoff/gui/tabs.py6
2 files changed, 9 insertions, 5 deletions
diff --git a/jfr_playoff/gui/frames/translations.py b/jfr_playoff/gui/frames/translations.py
index 94af787..b705f59 100644
--- a/jfr_playoff/gui/frames/translations.py
+++ b/jfr_playoff/gui/frames/translations.py
@@ -24,10 +24,10 @@ class TranslationRow(RepeatableFrame):
class TranslationConfigurationFrame(ScrollableFrame):
def setTranslations(self, translations):
- translations = copy.copy(PLAYOFF_I18N_DEFAULTS)
- translations.update(translations)
+ default_translations = copy.copy(PLAYOFF_I18N_DEFAULTS)
+ default_translations.update(translations)
values = []
- for value in translations.iteritems():
+ for value in default_translations.iteritems():
values.append(value)
self.repeater.setValue(values)
@@ -35,6 +35,4 @@ class TranslationConfigurationFrame(ScrollableFrame):
self.repeater = WidgetRepeater(container, TranslationRow)
self.repeater.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
- self.setTranslations({})
-
__all__ = ['TranslationConfigurationFrame']
diff --git a/jfr_playoff/gui/tabs.py b/jfr_playoff/gui/tabs.py
index 7ef0f84..4a49d83 100644
--- a/jfr_playoff/gui/tabs.py
+++ b/jfr_playoff/gui/tabs.py
@@ -357,5 +357,11 @@ class TranslationsTab(PlayoffTab):
container, vertical=True)
self.translationsFrame.pack(side=tk.TOP, fill=tk.BOTH, expand=True)
+ def setValues(self, config):
+ if 'i18n' in config:
+ self.translationsFrame.setTranslations(config['i18n'])
+ else:
+ self.translationsFrame.setTranslations({})
+
__all__ = ['MainSettingsTab', 'TeamsTab', 'MatchesTab', 'SwissesTab',
'NetworkTab', 'VisualTab', 'StyleTab', 'TranslationsTab']