Skip to content

Commit

Permalink
Add language as printer.cfg parameter change from supreme_cake
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcurti committed Jun 1, 2024
1 parent 72fd938 commit 5a7fe0e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions klippy/extras/e3v3se_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,19 @@ class E3v3seDisplay:
# IMAGE LIBRARIES ID
ICON = 0
GIF_ICON = 27
language_chinese = 2
language_english = 4
language_german = 6
language_russian = 9
language_french = 12
language_turkish = 15
language_spanish = 17
language_italian = 19
language_portuguese = 21
language_japanese = 23
language_korean = 25
languages = {
"chinese": 2,
"english": 4,
"german": 6,
"russian": 9,
"french": 12,
"turkish": 15,
"spanish": 17,
"italian": 19,
"portuguese": 21,
"japanese": 23,
"korean": 25
}

# ICON ID
icon_logo = 0
Expand Down Expand Up @@ -428,6 +430,8 @@ def __init__(self, config):
self.gcode = self.printer.lookup_object("gcode")
self.printer.register_event_handler("klippy:ready", self.handle_ready)
self.encoder_state = self.ENCODER_DIFF_NO
language = config.get("language", "english")
self.selected_language = self.languages[language]


# register for key events
Expand All @@ -447,7 +451,7 @@ def __init__(self, config):
self._update_interval = 1
self._update_timer = self.reactor.register_timer(self.EachMomentUpdate)

self.selected_language = self.language_english


def key_event(self, key, eventtime):
if key == 'click':
Expand Down

0 comments on commit 5a7fe0e

Please sign in to comment.