From 944834593de7f6008b0edbd8d75e18face9ee2a1 Mon Sep 17 00:00:00 2001 From: Kate Murphy Date: Tue, 16 Apr 2019 20:05:45 -0400 Subject: [PATCH 1/2] Build inx files in locale folders and build release for each locale --- Makefile | 16 ++++++++++------ lib/inx/utils.py | 13 +++++++++++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ed86a36ce..f3f94b493 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ ARCH:=$(shell uname -m) dist: distclean locales inx bin/build-dist $(EXTENSIONS) - cp inx/*.inx dist cp -a images/examples dist/inkstitch cp -a palettes dist/inkstitch cp -a symbols dist/inkstitch @@ -15,11 +14,16 @@ dist: distclean locales inx cp -a icons dist/inkstitch/bin cp -a locales dist/inkstitch/bin cp -a print dist/inkstitch/bin - if [ "$$BUILD" = "windows" ]; then \ - cd dist; zip -r ../inkstitch-$(VERSION)-win32.zip *; \ - else \ - cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz *; \ - fi + for d in inx/*; do \ + lang=$${d%.*}; \ + lang=$${lang#*/}; \ + cp $$d/*.inx dist; \ + if [ "$$BUILD" = "windows" ]; then \ + cd dist; zip -r ../inkstitch-$(VERSION)-win32-$$lang.zip *; cd ..; \ + else \ + cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH)-$$lang.tar.gz *; cd ..; \ + fi; \ + done distclean: rm -rf build dist inx locales *.spec *.tar.gz *.zip diff --git a/lib/inx/utils.py b/lib/inx/utils.py index a22b18925..1dc96829f 100644 --- a/lib/inx/utils.py +++ b/lib/inx/utils.py @@ -1,3 +1,4 @@ +import errno import os import gettext from os.path import dirname @@ -28,8 +29,16 @@ def build_environment(): def write_inx_file(name, contents): - inx_file_name = "inkstitch_%s_%s.inx" % (name, current_locale) - with open(os.path.join(inx_path, inx_file_name), 'w') as inx_file: + inx_locale_dir = os.path.join(inx_path, current_locale) + + try: + os.makedirs(inx_locale_dir) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + inx_file_name = "inkstitch_%s.inx" % name + with open(os.path.join(inx_locale_dir, inx_file_name), 'w') as inx_file: print >> inx_file, contents.encode("utf-8") From 3251b94332c291689cc76751a7be8629a6c7e64a Mon Sep 17 00:00:00 2001 From: Kate Murphy Date: Tue, 16 Apr 2019 20:18:46 -0400 Subject: [PATCH 2/2] Remove language name from menus --- templates/auto_satin.inx | 4 +--- templates/convert_to_satin.inx | 4 +--- templates/cut_satin.inx | 4 +--- templates/embroider.inx | 5 +---- templates/flip.inx | 4 +--- templates/global_commands.inx | 6 ++---- templates/install.inx | 4 +--- templates/layer_commands.inx | 4 +--- templates/lettering.inx | 5 +---- templates/object_commands.inx | 4 +--- templates/params.inx | 4 +--- templates/print.inx | 4 +--- templates/simulate.inx | 4 +--- 13 files changed, 14 insertions(+), 42 deletions(-) diff --git a/templates/auto_satin.inx b/templates/auto_satin.inx index d825d8a11..60ca29cd5 100644 --- a/templates/auto_satin.inx +++ b/templates/auto_satin.inx @@ -11,9 +11,7 @@ all - - - + diff --git a/templates/convert_to_satin.inx b/templates/convert_to_satin.inx index d214502a9..d0f879111 100644 --- a/templates/convert_to_satin.inx +++ b/templates/convert_to_satin.inx @@ -9,9 +9,7 @@ all - - - + diff --git a/templates/cut_satin.inx b/templates/cut_satin.inx index 4d330f062..c96d90929 100644 --- a/templates/cut_satin.inx +++ b/templates/cut_satin.inx @@ -9,9 +9,7 @@ all - - - + diff --git a/templates/embroider.inx b/templates/embroider.inx index 54f3be1ba..f030c8d66 100644 --- a/templates/embroider.inx +++ b/templates/embroider.inx @@ -19,10 +19,7 @@ all - - {# L10N This is used for the submenu under Extensions -> Ink/Stitch. Translate this to your language's word for its language, e.g. "Español" for the spanish translation. #} - - +