diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/build-distribution-archives | 27 | ||||
| -rw-r--r-- | bin/generate-translation-files | 27 |
2 files changed, 37 insertions, 17 deletions
diff --git a/bin/build-distribution-archives b/bin/build-distribution-archives index 6402122b..68dd46cf 100755 --- a/bin/build-distribution-archives +++ b/bin/build-distribution-archives @@ -5,30 +5,23 @@ OS="${BUILD:-$(uname)}" ARCH="$(uname -m)" if [ "$BUILD" = "osx" ]; then - cp -a images/examples palettes symbols fonts LICENSE VERSION dist/inkstitch.app/Contents + cp -a images/examples palettes symbols fonts inx LICENSE VERSION dist/inkstitch.app/Contents cp -a icons locales print dist/inkstitch.app/Contents/MacOS cp -a electron/build/mac dist/inkstitch.app/Contents/electron rm -rf dist/inkstitch/ else - cp -a images/examples palettes symbols fonts LICENSE VERSION dist/inkstitch + cp -a images/examples palettes symbols fonts inx LICENSE VERSION dist/inkstitch cp -a icons locales print dist/inkstitch/bin cp -a electron/build/*-unpacked dist/inkstitch/electron fi mkdir artifacts +cd dist -for d in inx/*; do - lang=${d%.*} - lang=${lang#*/} - cp $d/*.inx dist - - cd dist - if [ "$BUILD" = "windows" ]; then - # The python zipfile command line utility can't handle directories - # containing files with UTF-8 names on Windows, so we use 7-zip instead. - 7z a ../artifacts/inkstitch-${VERSION}-${OS}-${lang}.zip * - else - python -m zipfile -c ../artifacts/inkstitch-${VERSION}-${OS}-${lang}.zip * - fi - cd .. -done +if [ "$$BUILD" = "windows" ]; then + # The python zipfile command line utility can't handle directories + # containing files with UTF-8 names on Windows, so we use 7-zip instead. + 7z a ../artifacts/inkstitch-${VERSION}-${OS}.zip *; +else + python -m zipfile -c ../artifacts/inkstitch-${VERSION}-${OS}.zip *; +fi diff --git a/bin/generate-translation-files b/bin/generate-translation-files new file mode 100644 index 00000000..c1f77a30 --- /dev/null +++ b/bin/generate-translation-files @@ -0,0 +1,27 @@ +#!/bin/bash + +# message files will look like this: +# translations/messages_en_US.po +if ls translations/*.po > /dev/null 2>&1; then + for po in translations/*.po; do + lang=${po%.*}; + lang=${lang#*_}; + mkdir -p locales/$lang/LC_MESSAGES/; + msgfmt $po -o locales/$lang/LC_MESSAGES/inkstitch.mo; + done; +else + mkdir -p locales; +fi; + +# copy locales also into the inx folder, inkscape needs +# them to be in exactly that place +mkdir -p inx; +cp -r locales/ inx/locale/; +# for some reason inkscape requires the language folder names +# as a two letter code ("en" instead of "en_US") +cd inx/locale; +for language in */; do + if [ ! -d ${language:0:2} ]; then + mv -- $language ${language:0:2}; + fi; +done; |
