diff --git a/contrib/android/make_apk.sh b/contrib/android/make_apk.sh index 72b6bc4dc..5d7348c8a 100755 --- a/contrib/android/make_apk.sh +++ b/contrib/android/make_apk.sh @@ -22,16 +22,9 @@ fi # update locale info "preparing electrum-locale." ( - cd "$PROJECT_ROOT" - git submodule update --init - - LOCALE="$PROJECT_ROOT/electrum/locale/" - cd "$LOCALE" - git clean -ffxd - git reset --hard - "$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" + "$CONTRIB/build_cleanlocale.sh" # we want the binary to have only compiled (.mo) locale files; not source (.po) files - rm -r locale/*/electrum.po + rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po ) pushd "$CONTRIB_ANDROID" diff --git a/contrib/build-linux/appimage/make_appimage.sh b/contrib/build-linux/appimage/make_appimage.sh index e302ca38c..540e363e8 100755 --- a/contrib/build-linux/appimage/make_appimage.sh +++ b/contrib/build-linux/appimage/make_appimage.sh @@ -136,16 +136,9 @@ break_legacy_easy_install info "preparing electrum-locale." ( - cd "$PROJECT_ROOT" - git submodule update --init - - LOCALE="$PROJECT_ROOT/electrum/locale/" - cd "$LOCALE" - git clean -ffxd - git reset --hard - "$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" + "$CONTRIB/build_cleanlocale.sh" # we want the binary to have only compiled (.mo) locale files; not source (.po) files - rm -r locale/*/electrum.po + rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po ) diff --git a/contrib/build-linux/sdist/make_sdist.sh b/contrib/build-linux/sdist/make_sdist.sh index 9c2469747..0bde8ba00 100755 --- a/contrib/build-linux/sdist/make_sdist.sh +++ b/contrib/build-linux/sdist/make_sdist.sh @@ -26,18 +26,12 @@ fi info "preparing electrum-locale." ( - cd "$PROJECT_ROOT" - git submodule update --init - - LOCALE="$PROJECT_ROOT/electrum/locale/" - cd "$LOCALE" - git clean -ffxd - git reset --hard + "$CONTRIB/build_cleanlocale.sh" # By default, include both source (.po) and compiled (.mo) locale files in the source dist. # Set option OMIT_UNCLEAN_FILES=1 to exclude the compiled locale files # see https://askubuntu.com/a/144139 (also see MANIFEST.in) - if ([ "$OMIT_UNCLEAN_FILES" != 1 ]); then - "$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" + if ([ "$OMIT_UNCLEAN_FILES" = 1 ]); then + rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/LC_MESSAGES/electrum.mo fi ) diff --git a/contrib/build-wine/build-electrum-git.sh b/contrib/build-wine/build-electrum-git.sh index 449eb17bf..a65e6fa9d 100755 --- a/contrib/build-wine/build-electrum-git.sh +++ b/contrib/build-wine/build-electrum-git.sh @@ -18,16 +18,9 @@ info "Last commit: $VERSION" info "preparing electrum-locale." ( - cd "$PROJECT_ROOT" - git submodule update --init - - LOCALE="$PROJECT_ROOT/electrum/locale/" - cd "$LOCALE" - git clean -ffxd - git reset --hard - "$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" + "$CONTRIB/build_cleanlocale.sh" # we want the binary to have only compiled (.mo) locale files; not source (.po) files - rm -r locale/*/electrum.po + rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po ) find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} + diff --git a/contrib/build_cleanlocale.sh b/contrib/build_cleanlocale.sh new file mode 100755 index 000000000..00d57a545 --- /dev/null +++ b/contrib/build_cleanlocale.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +CONTRIB="$(dirname "$(readlink -e "$0")")" +PROJECT_ROOT="$CONTRIB"/.. + +cd "$PROJECT_ROOT" +git submodule update --init + +LOCALE="$PROJECT_ROOT/electrum/locale/" +cd "$LOCALE" +git clean -ffxd +git reset --hard +"$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" diff --git a/contrib/osx/make_osx.sh b/contrib/osx/make_osx.sh index 68e50831e..25edc53a8 100755 --- a/contrib/osx/make_osx.sh +++ b/contrib/osx/make_osx.sh @@ -128,23 +128,15 @@ pyinstaller --version rm -rf ./dist -if ! which msgfmt > /dev/null 2>&1; then - brew install gettext - brew link --force gettext -fi - info "preparing electrum-locale." ( - cd "$PROJECT_ROOT" - git submodule update --init - - LOCALE="$PROJECT_ROOT/electrum/locale/" - cd "$LOCALE" - git clean -ffxd - git reset --hard - "$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale" + if ! which msgfmt > /dev/null 2>&1; then + brew install gettext + brew link --force gettext + fi + "$CONTRIB/build_cleanlocale.sh" # we want the binary to have only compiled (.mo) locale files; not source (.po) files - rm -r locale/*/electrum.po + rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po ) || fail "failed generating locale"