1
0

contrib: mv locale-related scripts to contrib/locale/

This commit is contained in:
SomberNight
2025-04-10 17:45:21 +00:00
parent 1144d9b8ea
commit 31b176169a
11 changed files with 12 additions and 11 deletions

View File

@@ -81,7 +81,7 @@ task:
- pip install -r $ELECTRUM_REQUIREMENTS_CI
- pip install requests
locale_script:
- contrib/push_locale
- contrib/locale/push_locale.py
env:
ELECTRUM_IMAGE: python:3.10
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt

View File

@@ -110,7 +110,7 @@ $ python3 -m pip install --user -e .
Create translations (optional):
```
$ sudo apt-get install gettext
$ ./contrib/build_locale.sh electrum/locale/locale electrum/locale/locale
$ ./contrib/locale/build_locale.sh electrum/locale/locale electrum/locale/locale
```
Finally, to start Electrum:

View File

@@ -22,7 +22,7 @@ fi
# update locale
info "preparing electrum-locale."
(
"$CONTRIB/build_cleanlocale.sh"
"$CONTRIB/locale/build_cleanlocale.sh"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
)

View File

@@ -136,7 +136,7 @@ break_legacy_easy_install
info "preparing electrum-locale."
(
"$CONTRIB/build_cleanlocale.sh"
"$CONTRIB/locale/build_cleanlocale.sh"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
)

View File

@@ -52,6 +52,6 @@ The differences are as follows:
found and used at runtime.
- the normal tarball includes compiled (.mo) locale files, the source-only tarball does not.
Both tarballs contain (.po) source locale files. If you are packaging for a Linux distro,
you probably want to compile the .mo locale files yourself (see `contrib/build_locale.sh`).
you probably want to compile the .mo locale files yourself (see `contrib/locale/build_locale.sh`).
- the normal tarball includes generated `*_pb2.py` files. These are created
using `protobuf-compiler` from `.proto` files (see `contrib/generate_payreqpb2.sh`)

View File

@@ -26,7 +26,7 @@ fi
info "preparing electrum-locale."
(
"$CONTRIB/build_cleanlocale.sh"
"$CONTRIB/locale/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)

View File

@@ -18,7 +18,7 @@ info "Last commit: $VERSION"
info "preparing electrum-locale."
(
"$CONTRIB/build_cleanlocale.sh"
"$CONTRIB/locale/build_cleanlocale.sh"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
)

View File

@@ -2,7 +2,8 @@
set -e
CONTRIB="$(dirname "$(readlink -e "$0")")"
CONTRIB_LOCALE="$(dirname "$(readlink -e "$0")")"
CONTRIB="$CONTRIB_LOCALE"/..
PROJECT_ROOT="$CONTRIB"/..
cd "$PROJECT_ROOT"
@@ -12,4 +13,4 @@ LOCALE="$PROJECT_ROOT/electrum/locale/"
cd "$LOCALE"
git clean -ffxd
git reset --hard
"$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale"
"$CONTRIB_LOCALE/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale"

View File

@@ -16,7 +16,7 @@ except ImportError as e:
sys.exit(f"Error: {str(e)}. Try 'python3 -m pip install --user <module-name>'")
# set cwd
project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
project_root = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
os.chdir(project_root)
locale_dir = os.path.join(project_root, "electrum", "locale")

View File

@@ -134,7 +134,7 @@ info "preparing electrum-locale."
brew install gettext
brew link --force gettext
fi
"$CONTRIB/build_cleanlocale.sh"
"$CONTRIB/locale/build_cleanlocale.sh"
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
) || fail "failed generating locale"