Skip to content

Commit

Permalink
gmoccapy: localization of CombiDRO
Browse files Browse the repository at this point in the history
  • Loading branch information
hansu committed Jul 28, 2024
1 parent 43fb611 commit d46bde2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/python/gladevcp/combi_dro.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
from hal_glib import GStat
import re

# localization
import locale
BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
LOCALEDIR = os.path.join(BASE, "share", "locale")
locale.setlocale(locale.LC_ALL, '')

# constants
_INCH = 0
_MM = 1
Expand All @@ -43,7 +49,6 @@
try:
INIPATH = os.environ['INI_FILE_NAME']
except:
# INIPATH = '/home/emcmesa/linuxcnc-dev/configs/sim/gmoccapy/gmoccapy.ini'
pass

# This is the main class
Expand Down Expand Up @@ -481,9 +486,9 @@ def _position(self, object, p, rel_p, dtg, joint_actual_position):
main_dro = tmpl(main * scale)
left_dro = tmpl(left * scale)
right_dro = tmpl(right * scale)
self.widgets["main_dro"].set_label(main_dro)
self.widgets["dro_left"].set_label(left_dro)
self.widgets["dro_right"].set_label(right_dro)
self.widgets["main_dro"].set_label(locale.localize(main_dro))
self.widgets["dro_left"].set_label(locale.localize(left_dro))
self.widgets["dro_right"].set_label(locale.localize(right_dro))
self.dtg = dtg * scale
self.abs_pos = abs_pos * scale
self.rel_pos = rel_pos * scale
Expand Down

0 comments on commit d46bde2

Please sign in to comment.