Update Chinese translation, adding braces for some strings.

This commit is contained in:
Solitarily 2017-11-13 23:30:26 +08:00
parent 232d7daa38
commit 896eb1c990
5 changed files with 6219 additions and 5601 deletions

View file

@ -3397,18 +3397,18 @@ while ((s.joints == 0) or (s.kinematics_type < linuxcnc.KINEMATICS_IDENTITY)):
s.poll() s.poll()
if s.kinematics_type == linuxcnc.KINEMATICS_IDENTITY: if s.kinematics_type == linuxcnc.KINEMATICS_IDENTITY:
ja_name = "Axes" ja_name = _("Axes")
else: else:
ja_name = "Joints" ja_name = _("Joints")
if homing_order_defined: if homing_order_defined:
widgets.homebutton.configure(text=_("Home All"), command="home_all_joints") widgets.homebutton.configure(text=_("Home All"), command="home_all_joints")
root_window.tk.call("DynamicHelp::add", widgets.homebutton, root_window.tk.call("DynamicHelp::add", widgets.homebutton,
"-text", _("Home all %s [Ctrl-Home]" % ja_name)) "-text", _("Home all %s [Ctrl-Home]") % ja_name)
widgets.homemenu.add_command(command=commands.home_all_joints) widgets.homemenu.add_command(command=commands.home_all_joints)
root_window.tk.call("setup_menu_accel", widgets.homemenu, "end", root_window.tk.call("setup_menu_accel", widgets.homemenu, "end",
_("Home All %s" % ja_name)) _("Home All %s") % ja_name)
widgets.unhomemenu.add_command(command=commands.unhome_all_joints) widgets.unhomemenu.add_command(command=commands.unhome_all_joints)
root_window.tk.call("setup_menu_accel", widgets.unhomemenu, "end", _("Unhome All %s" % ja_name)) root_window.tk.call("setup_menu_accel", widgets.unhomemenu, "end", _("Unhome All %s") % ja_name)
kinsmodule=inifile.find("KINS", "KINEMATICS") kinsmodule=inifile.find("KINS", "KINEMATICS")
kins_is_trivkins = False kins_is_trivkins = False
@ -3480,7 +3480,7 @@ num_joints = s.joints
gave_individual_homing_message = "" gave_individual_homing_message = ""
for jnum in range(num_joints): for jnum in range(num_joints):
if s.kinematics_type == linuxcnc.KINEMATICS_IDENTITY: if s.kinematics_type == linuxcnc.KINEMATICS_IDENTITY:
ja_name = "Axis" ja_name = _("Axis ")
ja_id = aletter_for_jnum(jnum) ja_id = aletter_for_jnum(jnum)
if ja_id.lower() in duplicate_coord_letters: if ja_id.lower() in duplicate_coord_letters:
if ja_id not in gave_individual_homing_message: if ja_id not in gave_individual_homing_message:
@ -3497,7 +3497,7 @@ for jnum in range(num_joints):
command=lambda jnum=jnum: commands.home_joint_number(jnum)) command=lambda jnum=jnum: commands.home_joint_number(jnum))
widgets.unhomemenu.add_command( widgets.unhomemenu.add_command(
command=lambda jnum=jnum: commands.unhome_joint_number(jnum)) command=lambda jnum=jnum: commands.unhome_joint_number(jnum))
ja_name = "Joint" ja_name = _("Joint")
if joint_sequence[jnum] is '': if joint_sequence[jnum] is '':
ja_id = "%d"%jnum ja_id = "%d"%jnum
elif (int(joint_sequence[jnum]) < 0): elif (int(joint_sequence[jnum]) < 0):

View file

@ -247,7 +247,7 @@ class gmoccapy(object):
if arg == "-logo": if arg == "-logo":
self.logofile = str(argv[ index + 1 ]) self.logofile = str(argv[ index + 1 ])
message = _("**** GMOCCAPY INI Entry **** \n") message = _("**** GMOCCAPY INI Entry **** \n")
message += _("logo entry found = {0}".format(self.logofile)) message += _("logo entry found = {0}").format(self.logofile)
print (message) print (message)
self.logofile = self.logofile.strip("\"\'") self.logofile = self.logofile.strip("\"\'")
if not os.path.isfile(self.logofile): if not os.path.isfile(self.logofile):
@ -648,7 +648,7 @@ class gmoccapy(object):
# to much axes given, can only handle 5 # to much axes given, can only handle 5
if len(self.axis_list) > 5: if len(self.axis_list) > 5:
message = _("**** GMOCCAPY INFO : ****") message = _("**** GMOCCAPY INFO : ****")
message += _("**** gmoccapy can only handle 5 axis, ****\n**** but you have given {0} through your INI file ****\n".format(len(self.axis_list))) message += _("**** gmoccapy can only handle 5 axis, ****\n**** but you have given {0} through your INI file ****\n").format(len(self.axis_list))
message += _("**** gmoccapy will not start ****\n\n") message += _("**** gmoccapy will not start ****\n\n")
print(message) print(message)
self.dialogs.warning_dialog(self, _("Very critical situation"), message, sound = False) self.dialogs.warning_dialog(self, _("Very critical situation"), message, sound = False)
@ -676,7 +676,7 @@ class gmoccapy(object):
image = self.widgets["img_home_{0}".format(self.axisletter_five)] image = self.widgets["img_home_{0}".format(self.axisletter_five)]
self.widgets.btn_home_5.set_image(image) self.widgets.btn_home_5.set_image(image)
self.widgets.btn_home_5.set_property("tooltip-text", _("Home axis {0}".format(self.axisletter_five.upper()))) self.widgets.btn_home_5.set_property("tooltip-text", _("Home axis {0}").format(self.axisletter_five.upper()))
if self.axisletter_five in "abc": if self.axisletter_five in "abc":
self.widgets.Combi_DRO_5.set_property("mm_text_template", "%11.2f") self.widgets.Combi_DRO_5.set_property("mm_text_template", "%11.2f")
@ -684,7 +684,7 @@ class gmoccapy(object):
image = self.widgets["img_home_{0}".format(self.axisletter_five)] image = self.widgets["img_home_{0}".format(self.axisletter_five)]
self.widgets.btn_home_5.set_image(image) self.widgets.btn_home_5.set_image(image)
self.widgets.btn_home_5.set_property("tooltip-text", _("Home axis {0}".format(self.axisletter_five.upper()))) self.widgets.btn_home_5.set_property("tooltip-text", _("Home axis {0}").format(self.axisletter_five.upper()))
self.widgets.btn_home_5.show() self.widgets.btn_home_5.show()
self.widgets.btn_5_plus.set_label("{0}+".format(self.axisletter_five.upper())) self.widgets.btn_5_plus.set_label("{0}+".format(self.axisletter_five.upper()))
@ -694,7 +694,7 @@ class gmoccapy(object):
image = self.widgets["img_touch_off_{0}".format(self.axisletter_five)] image = self.widgets["img_touch_off_{0}".format(self.axisletter_five)]
self.widgets.btn_set_value_5.set_image(image) self.widgets.btn_set_value_5.set_image(image)
self.widgets.btn_set_value_5.set_property("tooltip-text", _("Set axis {0} value to".format(self.axisletter_five.upper()))) self.widgets.btn_set_value_5.set_property("tooltip-text", _("Set axis {0} value to").format(self.axisletter_five.upper()))
self.widgets.btn_set_value_5.show() self.widgets.btn_set_value_5.show()
if self.axisletter_five: if self.axisletter_five:
@ -713,7 +713,7 @@ class gmoccapy(object):
image = self.widgets["img_home_{0}".format(self.axisletter_four)] image = self.widgets["img_home_{0}".format(self.axisletter_four)]
self.widgets.btn_home_4.set_image(image) self.widgets.btn_home_4.set_image(image)
self.widgets.btn_home_4.set_property("tooltip-text", _("Home axis {0}".format(self.axisletter_four.upper()))) self.widgets.btn_home_4.set_property("tooltip-text", _("Home axis {0}").format(self.axisletter_four.upper()))
self.widgets.btn_home_4.show() self.widgets.btn_home_4.show()
self.widgets.btn_4_plus.set_label("{0}+".format(self.axisletter_four.upper())) self.widgets.btn_4_plus.set_label("{0}+".format(self.axisletter_four.upper()))
@ -723,7 +723,7 @@ class gmoccapy(object):
image = self.widgets["img_touch_off_{0}".format(self.axisletter_four)] image = self.widgets["img_touch_off_{0}".format(self.axisletter_four)]
self.widgets.btn_set_value_4.set_image(image) self.widgets.btn_set_value_4.set_image(image)
self.widgets.btn_set_value_4.set_property("tooltip-text", _("Set axis {0} value to".format(self.axisletter_four.upper()))) self.widgets.btn_set_value_4.set_property("tooltip-text", _("Set axis {0} value to").format(self.axisletter_four.upper()))
self.widgets.btn_set_value_4.show() self.widgets.btn_set_value_4.show()
if self.axisletter_four in "abc": if self.axisletter_four in "abc":
@ -831,10 +831,10 @@ class gmoccapy(object):
# and according to machine units the digits to display # and according to machine units the digits to display
if self.stat.linear_units == _MM: if self.stat.linear_units == _MM:
self.widgets.spc_jog_vel.set_digits(0) self.widgets.spc_jog_vel.set_digits(0)
self.widgets.spc_jog_vel.set_property("unit", "mm/min") self.widgets.spc_jog_vel.set_property("unit", _("mm/min"))
else: else:
self.widgets.spc_jog_vel.set_digits(2) self.widgets.spc_jog_vel.set_digits(2)
self.widgets.spc_jog_vel.set_property("unit", "inch/min") self.widgets.spc_jog_vel.set_property("unit", _("inch/min"))
# the size of the DRO # the size of the DRO
self.dro_size = self.prefs.getpref("dro_size", 28, int) self.dro_size = self.prefs.getpref("dro_size", 28, int)
@ -1064,7 +1064,7 @@ class gmoccapy(object):
# If there are themes then add them to combo box # If there are themes then add them to combo box
model = self.widgets.theme_choice.get_model() model = self.widgets.theme_choice.get_model()
model.clear() model.clear()
model.append(("Follow System Theme",)) model.append((_("Follow System Theme"),))
themes = [] themes = []
if os.path.exists(USERTHEMEDIR): if os.path.exists(USERTHEMEDIR):
names = os.listdir(USERTHEMEDIR) names = os.listdir(USERTHEMEDIR)
@ -1455,7 +1455,7 @@ class gmoccapy(object):
pin = hal_glib.GPin( pin = hal_glib.GPin(
self.halcomp.newpin("messages." + message[2] + "-response", hal.HAL_BIT, hal.HAL_OUT)) self.halcomp.newpin("messages." + message[2] + "-response", hal.HAL_BIT, hal.HAL_OUT))
else: else:
print(_("**** GMOCCAPY ERROR **** /n Message type {0} not supported".format(message[1]))) print(_("**** GMOCCAPY ERROR **** /n Message type {0} not supported").format(message[1]))
def _show_user_message(self, pin, message): def _show_user_message(self, pin, message):
if message[1] == "status": if message[1] == "status":
@ -1479,7 +1479,7 @@ class gmoccapy(object):
else: else:
self.halcomp["messages." + message[2] + "-waiting"] = 0 self.halcomp["messages." + message[2] + "-waiting"] = 0
else: else:
print(_("**** GMOCCAPY ERROR **** /n Message type {0} not supported".format(message[1]))) print(_("**** GMOCCAPY ERROR **** /n Message type {0} not supported").format(message[1]))
def _show_offset_tab(self, state): def _show_offset_tab(self, state):
page = self.widgets.ntb_preview.get_nth_page(1) page = self.widgets.ntb_preview.get_nth_page(1)
@ -2035,7 +2035,7 @@ class gmoccapy(object):
for code in o_codes[1:]: for code in o_codes[1:]:
parameter = self.dialogs.entry_dialog(self, data=None, header=_("Enter value:"), parameter = self.dialogs.entry_dialog(self, data=None, header=_("Enter value:"),
label=_("Set parameter {0} to:".format(code)), integer=False) label=_("Set parameter {0} to:").format(code), integer=False)
if parameter == "ERROR": if parameter == "ERROR":
print(_("conversion error")) print(_("conversion error"))
self.dialogs.warning_dialog(self, _("Conversion error !"), self.dialogs.warning_dialog(self, _("Conversion error !"),
@ -2353,7 +2353,7 @@ class gmoccapy(object):
new_tupple = (item[0], new_value) new_tupple = (item[0], new_value)
item = new_tupple item = new_tupple
print(_("**** GMOCCAPY INFO ****")) print(_("**** GMOCCAPY INFO ****"))
print(_("**** replaced {0} to {1} ****".format(old_value, new_value))) print(_("**** replaced {0} to {1} ****").format(old_value, new_value))
self.h_tabs[int_tab].append(item) self.h_tabs[int_tab].append(item)
# check if macros are in the INI file and add them to MDI Button List # check if macros are in the INI file and add them to MDI Button List
@ -2401,7 +2401,7 @@ class gmoccapy(object):
exc_type, exc_value, exc_traceback = sys.exc_info() exc_type, exc_value, exc_traceback = sys.exc_info()
formatted_lines = traceback.format_exc().splitlines() formatted_lines = traceback.format_exc().splitlines()
print(_("**** GMOCCAPY ERROR ****")) print(_("**** GMOCCAPY ERROR ****"))
print(_("**** {0} ****".format(formatted_lines[0]))) print(_("**** {0} ****").format(formatted_lines[0]))
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
print (formatted_lines[-1]) print (formatted_lines[-1])
@ -2411,7 +2411,7 @@ class gmoccapy(object):
self.widgets[name].set_sensitive(value) self.widgets[name].set_sensitive(value)
except Exception, e: except Exception, e:
print (_("**** GMOCCAPY ERROR ****")) print (_("**** GMOCCAPY ERROR ****"))
print _("**** No widget named: {0} to sensitize ****".format(name)) print _("**** No widget named: {0} to sensitize ****").format(name)
traceback.print_exc() traceback.print_exc()
def _update_active_gcodes(self): def _update_active_gcodes(self):
@ -2706,10 +2706,10 @@ class gmoccapy(object):
if metric_units: if metric_units:
self.widgets.spc_jog_vel.set_digits(0) self.widgets.spc_jog_vel.set_digits(0)
self.widgets.spc_jog_vel.set_property("unit", "mm/min") self.widgets.spc_jog_vel.set_property("unit", _("mm/min"))
else: else:
self.widgets.spc_jog_vel.set_digits(2) self.widgets.spc_jog_vel.set_digits(2)
self.widgets.spc_jog_vel.set_property("unit", "inch/min") self.widgets.spc_jog_vel.set_property("unit", _("inch/min"))
def on_tbtn_rel_toggled(self, widget, data=None): def on_tbtn_rel_toggled(self, widget, data=None):
if self.widgets.tbtn_dtg.get_active(): if self.widgets.tbtn_dtg.get_active():
@ -2736,10 +2736,10 @@ class gmoccapy(object):
def on_tbtn_units_toggled(self, widget, data=None): def on_tbtn_units_toggled(self, widget, data=None):
if widget.get_active(): if widget.get_active():
widget.set_label("inch") widget.set_label(_("inch"))
metric_units = False metric_units = False
else: else:
widget.set_label("mm") widget.set_label(_("mm"))
metric_units = True metric_units = True
for axis in self.axis_list: for axis in self.axis_list:
if axis == self.axisletter_four: if axis == self.axisletter_four:
@ -2813,7 +2813,7 @@ class gmoccapy(object):
def on_btn_launch_test_message_pressed(self, widget=None, data=None): def on_btn_launch_test_message_pressed(self, widget=None, data=None):
index = len(self.notification.messages) index = len(self.notification.messages)
text = _("Halo, welcome to the test message {0}".format(index)) text = _("Halo, welcome to the test message {0}").format(index)
self._show_error((13, text)) self._show_error((13, text))
def on_chk_turtle_jog_toggled(self, widget, data=None): def on_chk_turtle_jog_toggled(self, widget, data=None):
@ -3293,7 +3293,7 @@ class gmoccapy(object):
elif command == "reverse": elif command == "reverse":
self.command.spindle(-1, rpm_out) self.command.spindle(-1, rpm_out)
else: else:
print(_("Something went wrong, we have an unknown spindle widget {0}".format(command))) print(_("Something went wrong, we have an unknown spindle widget {0}").format(command))
def _check_spindle_range(self): def _check_spindle_range(self):
rpm = (self.stat.settings[2]) rpm = (self.stat.settings[2])
@ -3532,7 +3532,7 @@ class gmoccapy(object):
axis = self.axisletter_five axis = self.axisletter_five
else: else:
axis = "Unknown" axis = "Unknown"
message = _("Offset {0} could not be set, because off unknown axis".format(axis)) message = _("Offset {0} could not be set, because off unknown axis").format(axis)
self.dialogs.warning_dialog(self, _("Wrong offset setting!"), message) self.dialogs.warning_dialog(self, _("Wrong offset setting!"), message)
return return
if self.lathe_mode and axis =="x": if self.lathe_mode and axis =="x":
@ -3546,8 +3546,8 @@ class gmoccapy(object):
label=_("Set radius to:"), integer=False) label=_("Set radius to:"), integer=False)
else: else:
preset = self.prefs.getpref("offset_axis_{0}".format(axis), 0, float) preset = self.prefs.getpref("offset_axis_{0}".format(axis), 0, float)
offset = self.dialogs.entry_dialog(self, data=preset, header=_("Enter value for axis {0}".format(axis)), offset = self.dialogs.entry_dialog(self, data=preset, header=_("Enter value for axis {0}").format(axis),
label=_("Set axis {0} to:".format(axis)), integer=False) label=_("Set axis {0} to:").format(axis), integer=False)
if offset == "CANCEL": if offset == "CANCEL":
return return
elif offset == "ERROR": elif offset == "ERROR":
@ -3965,12 +3965,12 @@ class gmoccapy(object):
return return
value = self.dialogs.entry_dialog(self, data=None, value = self.dialogs.entry_dialog(self, data=None,
header=_("Enter value for axis {0} to set:".format(axis.upper())), header=_("Enter value for axis {0} to set:").format(axis.upper()),
label=_("Set parameter of tool {0:d} and axis {1} to:".format(self.stat.tool_in_spindle, axis.upper())), label=_("Set parameter of tool {0:d} and axis {1} to:").format(self.stat.tool_in_spindle, axis.upper()),
integer=False) integer=False)
if value == "ERROR": if value == "ERROR":
message = _("Conversion error because of wrong entry for touch off axis {0}".format(axis.upper())) message = _("Conversion error because of wrong entry for touch off axis {0}").format(axis.upper())
self.dialogs.warning_dialog(self, _("Conversion error !"), message) self.dialogs.warning_dialog(self, _("Conversion error !"), message)
return return
elif value == "CANCEL": elif value == "CANCEL":

View file

@ -264,7 +264,7 @@ class Data:
self.highlight_major = False self.highlight_major = False
self.display_order = (_REL,_DTG,_ABS) self.display_order = (_REL,_DTG,_ABS)
self.mode_order = (self._MAN,self._MDI,self._AUTO) self.mode_order = (self._MAN,self._MDI,self._AUTO)
self.mode_labels = ["Manual Mode","MDI Mode","Auto Mode"] self.mode_labels = [_("Manual Mode"),_("MDI Mode"),_("Auto Mode")]
self.IPR_mode = False self.IPR_mode = False
self.plot_view = ("p","x","y","y2","z","z2") self.plot_view = ("p","x","y","y2","z","z2")
self.task_mode = 0 self.task_mode = 0
@ -1304,7 +1304,7 @@ class Gscreen:
model = self.widgets.theme_choice.get_model() model = self.widgets.theme_choice.get_model()
model.clear() model.clear()
# add the default system theme # add the default system theme
model.append(("Follow System Theme",)) model.append((_("Follow System Theme"),))
# if there is a local custom theme add it # if there is a local custom theme add it
if self.data.local_theme: if self.data.local_theme:
model.append(("Local Config Theme",)) model.append(("Local Config Theme",))
@ -2525,12 +2525,12 @@ class Gscreen:
self.emc.estop_reset(1) self.emc.estop_reset(1)
elif not self.data.machine_on: elif not self.data.machine_on:
self.emc.machine_on(1) self.emc.machine_on(1)
self.widgets.on_label.set_text("Machine On") self.widgets.on_label.set_text(_("Machine On"))
self.add_alarm_entry(_("Machine powered on")) self.add_alarm_entry(_("Machine powered on"))
else: else:
self.emc.machine_off(1) self.emc.machine_off(1)
self.emc.estop(1) self.emc.estop(1)
self.widgets.on_label.set_text("Machine Off") self.widgets.on_label.set_text(_("Machine Off"))
self.add_alarm_entry(_("Machine Estopped!")) self.add_alarm_entry(_("Machine Estopped!"))
def on_calc_clicked(self,widget): def on_calc_clicked(self,widget):
@ -4585,15 +4585,15 @@ class Gscreen:
# Mode / view # Mode / view
modenames = self.data.mode_labels modenames = self.data.mode_labels
time = strftime("%a, %d %b %Y %I:%M:%S %P ", localtime()) time = strftime("%a, %d %b %Y %I:%M:%S %P ", localtime())
self.widgets.mode_label.set_label( "%s View -%s %s"% (modenames[self.data.mode_order[0]],self.data.plot_view[0],time) ) self.widgets.mode_label.set_label( _("%s View -%s %s")% (modenames[self.data.mode_order[0]],self.data.plot_view[0],time) )
def update_units_button_label(self): def update_units_button_label(self):
label = self.widgets.metric_select.get_label() label = self.widgets.metric_select.get_label()
data = self.data.dro_units data = self.data.dro_units
if data and not label == " mm ": if data and not label == _(" mm "):
temp = " mm " temp = _(" mm ")
elif data == 0 and not label == "Inch": elif data == 0 and not label == _("Inch"):
temp = "Inch" temp = _("Inch")
else: return else: return
self.widgets.metric_select.set_label(temp) self.widgets.metric_select.set_label(temp)

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff