diff options
| -rw-r--r-- | lib/inx/utils.py | 6 | ||||
| -rw-r--r-- | templates/global_commands.xml | 2 | ||||
| -rw-r--r-- | templates/import_threadlist.xml | 2 | ||||
| -rw-r--r-- | templates/input.xml | 4 | ||||
| -rw-r--r-- | templates/install_custom_palette.xml | 2 | ||||
| -rw-r--r-- | templates/layer_commands.xml | 2 | ||||
| -rw-r--r-- | templates/object_commands.xml | 4 | ||||
| -rw-r--r-- | templates/output.xml | 4 | ||||
| -rw-r--r-- | templates/output_params_txt.xml | 58 | ||||
| -rw-r--r-- | templates/zip.xml | 10 |
10 files changed, 43 insertions, 51 deletions
diff --git a/lib/inx/utils.py b/lib/inx/utils.py index 944c265c..acee88ad 100644 --- a/lib/inx/utils.py +++ b/lib/inx/utils.py @@ -9,15 +9,11 @@ from os.path import dirname from jinja2 import Environment, FileSystemLoader -from ..i18n import translation as default_translation - _top_path = dirname(dirname(dirname(os.path.realpath(__file__)))) inx_path = os.path.join(_top_path, "inx") template_path = os.path.join(_top_path, "templates") version_path = _top_path -current_translation = default_translation - def build_environment(): env = Environment( @@ -26,8 +22,6 @@ def build_environment(): extensions=['jinja2.ext.i18n'] ) - env.install_gettext_translations(current_translation) - with open(os.path.join(version_path, 'LICENSE'), 'r') as license: env.globals["inkstitch_license"] = "".join(license.readlines()) diff --git a/templates/global_commands.xml b/templates/global_commands.xml index 0fda86bd..91404eac 100644 --- a/templates/global_commands.xml +++ b/templates/global_commands.xml @@ -4,7 +4,7 @@ <id>org.inkstitch.global_commands</id> <param name="description" type="description">These commands affect the entire embroidery design.</param> {% for command, description in global_commands %} - <param name="{{ command }}" type="boolean" _gui-text="{{ _(description) }}">false</param> + <param name="{{ command }}" type="boolean" gui-text="{{ description }}">false</param> {% endfor %} <param name="extension" type="string" gui-hidden="true">global_commands</param> <effect> diff --git a/templates/import_threadlist.xml b/templates/import_threadlist.xml index 8562d82d..27cc3394 100644 --- a/templates/import_threadlist.xml +++ b/templates/import_threadlist.xml @@ -3,7 +3,7 @@ <name>Import Threadlist</name> <id>org.inkstitch.import_threadlist</id> <param name="extension" type="string" gui-hidden="true">import_threadlist</param> - <param name="filepath" type="path" gui-text="{{ _('Choose file') }}" mode="file" filetypes="txt"/> + <param name="filepath" type="path" gui-text="Choose file" mode="file" filetypes="txt"/> <param name="method" type="optiongroup" _gui-text="Choose method"> <option value="1">Import Ink/Stitch threadlist</option> <option value="2">Import other threadlist*</option> diff --git a/templates/input.xml b/templates/input.xml index a348df5c..b868c5ae 100644 --- a/templates/input.xml +++ b/templates/input.xml @@ -5,8 +5,8 @@ <input> <extension>.{{ format }}</extension> <mimetype>application/x-embroidery-{{ format }}</mimetype> - <_filetypename>Ink/Stitch: {{ _(description) }} (.{{ format }})</_filetypename> - <_filetypetooltip>{{ _("convert %(file_extension)s file to Ink/Stitch manual-stitch paths") % dict(file_extension=format.upper()) }}</_filetypetooltip> + <filetypename>Ink/Stitch: {{ description }} (.{{ format }})</filetypename> + <filetypetooltip>{{ "convert %(file_extension)s file to Ink/Stitch manual-stitch paths" % dict(file_extension=format.upper()) }}</filetypetooltip> </input> <param name="extension" type="string" gui-hidden="true">input</param> <script> diff --git a/templates/install_custom_palette.xml b/templates/install_custom_palette.xml index badbc432..1c62b6d0 100644 --- a/templates/install_custom_palette.xml +++ b/templates/install_custom_palette.xml @@ -5,7 +5,7 @@ <param name="extension" type="string" gui-hidden="true">install_custom_palette</param> <label indent="1">Choose a .gpl color palette file to install into Inkscape.</label> <label indent="1">Restart Inkscape to use.</label> - <param indent="1" name="filepath" type="path" gui-text="{{ _('Choose file') }}" mode="file" filetypes="gpl"/> + <param indent="1" name="filepath" type="path" gui-text="Choose file" mode="file" filetypes="gpl"/> <effect needs-live-preview="false"> <object-type>all</object-type> <effects-menu> diff --git a/templates/layer_commands.xml b/templates/layer_commands.xml index 2584df70..0d934d48 100644 --- a/templates/layer_commands.xml +++ b/templates/layer_commands.xml @@ -4,7 +4,7 @@ <id>org.inkstitch.layer_commands</id> <param name="description" type="description">Commands will be added to the currently-selected layer.</param> {% for command, description in layer_commands %} - <param name="{{ command }}" type="boolean" _gui-text="{{ _(description) }}">false</param> + <param name="{{ command }}" type="boolean" gui-text="{{ description }}">false</param> {% endfor %} <param name="extension" type="string" gui-hidden="true">layer_commands</param> <effect> diff --git a/templates/object_commands.xml b/templates/object_commands.xml index db5580f5..6960de7f 100644 --- a/templates/object_commands.xml +++ b/templates/object_commands.xml @@ -2,8 +2,8 @@ <inkscape-extension translationdomain="inkstitch" xmlns="http://www.inkscape.org/namespace/inkscape/extension"> <name>Attach Commands to Selected Objects</name> <id>org.inkstitch.commands</id> - {% for command, description in object_commands %} - <param name="{{ command }}" type="boolean" _gui-text="{{ _(description ) }}">false</param> + {%- for command, description in object_commands -%} + <param name="{{ command }}" type="boolean" gui-text="{{ description }}">false</param> {% endfor %} <param name="extension" type="string" gui-hidden="true">object_commands</param> <effect> diff --git a/templates/output.xml b/templates/output.xml index 9c798204..5c35ca7d 100644 --- a/templates/output.xml +++ b/templates/output.xml @@ -5,8 +5,8 @@ <output> <extension>.{{ format }}</extension> <mimetype>{{ mimetype }}</mimetype> - <_filetypename>Ink/Stitch: {{ _(description) }} (.{{ format }})</_filetypename> - <_filetypetooltip>{{ _("Save design in %(file_extension)s format using Ink/Stitch") % dict(file_extension=format.upper()) }}</_filetypetooltip> + <filetypename>Ink/Stitch: {{ description }} (.{{ format }})</filetypename> + <filetypetooltip>{{ "Save design in %(file_extension)s format using Ink/Stitch" % dict(file_extension=format.upper()) }}</filetypetooltip> <dataloss>true</dataloss> </output> <param name="extension" type="string" gui-hidden="true">output</param> diff --git a/templates/output_params_txt.xml b/templates/output_params_txt.xml index 8b7f66f5..0522e887 100644 --- a/templates/output_params_txt.xml +++ b/templates/output_params_txt.xml @@ -1,41 +1,39 @@ {# these parameters are for g-code files (*.txt) #} <param type="notebook" name="gcode-settings"> <page name="embroidery" gui-text="Coordinate Settings"> - <param name="flip_x" type="boolean" gui-text="{{ _("negate X coordinate values") }}" gui-description="{{ _("Negate x coordinates") }}">false</param> - <param name="flip_y" type="boolean" gui-text="{{ _("negate Y coordinate values") }}" gui-description="{{ _("Negate y coordinates") }}">false</param> - <param type="optiongroup" name="alternate_z" gui-text="{{ _("Z coordinate value") }}" gui-description="{{ _("Either alternate Z value between 0 and 1 or travel custom value.") }}"> - <option value="true">{{ _("alternate Z value") }}</option> - <option value="false">{{ _("Z travel per stitch") }}</option> + <param name="flip_x" type="boolean" gui-text="negate X coordinate values" gui-description="Negate x coordinates">false</param> + <param name="flip_y" type="boolean" gui-text="negate Y coordinate values" gui-description="Negate y coordinates">false</param> + <param type="optiongroup" name="alternate_z" gui-text="Z coordinate value" gui-description="Either alternate Z value between 0 and 1 or travel custom value."> + <option value="true">alternate Z value</option> + <option value="false">Z travel per stitch</option> </param> - <param name="stitch_z_travel" type="float" gui-text="{{ _("Z travel per stitch") }}" - gui-description="{{ _('increment z coordinate by this amount per stitch if "Z travel per stitch" is enabled') }}">5.0</param> + <param name="stitch_z_travel" type="float" gui-text="Z travel per stitch" + gui-description='increment z coordinate by this amount per stitch if "Z travel per stitch" is enabled'>5.0</param> </page> <page name="custom-commands" gui-text="Custom Commands"> - <param name="custom_stitch" type="string" appearance="multiline" gui-text="{{ _("STITCH") }}" - gui-description="{{ _("Use '%X' for x-coordinate. Use '%Y' for y-coordinate and '%Z' for z-coordinate. Use '\\n' for a new line.") }}"></param> - <param name="custom_color_change" type="string" appearance="multiline" gui-text="{{ _("COLOR CHANGE") }}" - gui-description="{{ _("Use '\\n' for a new line. Leave empty to use default value. Use 'none' to remove.") }}"></param> - <param name="custom_stop" type="string" appearance="multiline" gui-text="{{ _("STOP") }}" - gui-description="{{ _("Use '\\n' for a new line. Leave empty to use default value. Use 'none' to remove.") }}"></param> - <param name="custom_start" type="string" appearance="multiline" gui-text="{{ _("START") }}" - gui-description="{{ _("Use '\\n' for a new line.") }}"></param> - <param name="custom_end" type="string" appearance="multiline" gui-text="{{ _("END") }}" - gui-description="{{ _("Use '\\n' for a new line.") }}"></param> + <param name="custom_stitch" type="string" appearance="multiline" gui-text="STITCH" + gui-description="Use '%X' for x-coordinate. Use '%Y' for y-coordinate and '%Z' for z-coordinate."></param> + <param name="custom_color_change" type="string" appearance="multiline" gui-text="COLOR CHANGE" + gui-description="Leave empty to use default value. Use 'none' to remove."></param> + <param name="custom_stop" type="string" appearance="multiline" gui-text="STOP" + gui-description="Leave empty to use default value. Use 'none' to remove."></param> + <param name="custom_start" type="string" appearance="multiline" gui-text="START"></param> + <param name="custom_end" type="string" appearance="multiline" gui-text="END"></param> </page> <page name="laser" gui-text="Laser Settings"> - <param name="laser_mode" type="boolean" gui-text="{{ _("laser mode") }}" - gui-description="{{ _("Laser mode (generate g-code for grbl laser mode)") }}">false</param> - <param name="dynamic_laser_power" type="boolean" gui-text="{{ _("dynamic laser power") }}" - gui-description="{{ _("Use Grbl's M4 dynamic laser power mode. Ensures consistent laser cutting power regardless of motor speed. Only for PWM-capable lasers.") }}" + <param name="laser_mode" type="boolean" gui-text="laser mode" + gui-description="Laser mode (generate g-code for grbl laser mode)">false</param> + <param name="dynamic_laser_power" type="boolean" gui-text="dynamic laser power" + gui-description="Use Grbl's M4 dynamic laser power mode. Ensures consistent laser cutting power regardless of motor speed. Only for PWM-capable lasers." min="0.0" max="5.0">true</param> - <param name="laser_warm_up_time" type="float" gui-text="{{ _("laser warm-up time") }}" - gui-description="{{ _("When turning on the laser, wait this many seconds for laser to warm up (G4 command)") }}">0.0</param> - <param name="spindle_speed" type="int" gui-text="{{ _("spindle speed") }}" - gui-description="{{ _("spindle speed (laser power for laser mode, set to -1 to omit)") }}" min="-1" max="1000000000">-1</param> - <param name="min_spindle_speed" type="int" gui-text="{{ _("min spindle speed") }}" - gui-description="{{ _("minimum spindle speed value (grbl $31 setting)") }}" min="-1" max="1000000000">-1</param> - <param name="max_spindle_speed" type="int" gui-text="{{ _("max spindle speed") }}" - gui-description="{{ _("minimum spindle speed value (grbl $30 setting)") }}" min="-1" max="1000000000">-1</param> - <param name="feed_rate" type="int" gui-text="{{ _("feed rate (in mm/min, set to -1 to omit)")}}" min="-1" max="1000000000">-1</param> + <param name="laser_warm_up_time" type="float" gui-text="laser warm-up time" + gui-description="When turning on the laser, wait this many seconds for laser to warm up (G4 command)">0.0</param> + <param name="spindle_speed" type="int" gui-text="spindle speed" + gui-description="spindle speed (laser power for laser mode, set to -1 to omit)" min="-1" max="1000000000">-1</param> + <param name="min_spindle_speed" type="int" gui-text="min spindle speed" + gui-description="minimum spindle speed value (grbl $31 setting)" min="-1" max="1000000000">-1</param> + <param name="max_spindle_speed" type="int" gui-text="max spindle speed" + gui-description="minimum spindle speed value (grbl $30 setting)" min="-1" max="1000000000">-1</param> + <param name="feed_rate" type="int" gui-text="feed rate (in mm/min, set to -1 to omit)" min="-1" max="1000000000">-1</param> </page> </param> diff --git a/templates/zip.xml b/templates/zip.xml index 983d0eb6..55366afd 100644 --- a/templates/zip.xml +++ b/templates/zip.xml @@ -5,17 +5,17 @@ <output> <extension>.zip</extension> <mimetype>application/zip</mimetype> - <_filetypename>{{ _("Ink/Stitch: ZIP export multiple formats (.zip)") }}</_filetypename> - <_filetypetooltip>{{ _("Create a ZIP with multiple embroidery file formats using Ink/Stitch") }}</_filetypetooltip> + <filetypename>Ink/Stitch: ZIP export multiple formats (.zip)</filetypename> + <filetypetooltip>Create a ZIP with multiple embroidery file formats using Ink/Stitch</filetypetooltip> <dataloss>true</dataloss> </output> {%- for format, description, mimetype, category in formats %} {%- if category == "embroidery" %} - <param name="format-{{ format }}" type="boolean" _gui-text=".{{ format | upper }}: {{ _(description) }}">false</param> + <param name="format-{{ format }}" type="boolean" _gui-text=".{{ format | upper }}: {{ description }}">false</param> {%- endif %} {%- endfor %} - <param name="format-svg" type="boolean" _gui-text=".SVG: {{ _("Scalable Vector Graphic") }}">false</param> - <param name="format-threadlist" type="boolean" _gui-text=".TXT: {{ _("Threadlist") }}">false</param> + <param name="format-svg" type="boolean" gui-text=".SVG: Scalable Vector Graphic">false</param> + <param name="format-threadlist" type="boolean" gui-text=".TXT: Threadlist">false</param> <param name="extension" type="string" gui-hidden="true">zip</param> <script> {{ command_tag | safe }} |
