contrib: mv locale-related scripts to contrib/locale/
This commit is contained in:
@@ -81,7 +81,7 @@ task:
|
|||||||
- pip install -r $ELECTRUM_REQUIREMENTS_CI
|
- pip install -r $ELECTRUM_REQUIREMENTS_CI
|
||||||
- pip install requests
|
- pip install requests
|
||||||
locale_script:
|
locale_script:
|
||||||
- contrib/push_locale
|
- contrib/locale/push_locale.py
|
||||||
env:
|
env:
|
||||||
ELECTRUM_IMAGE: python:3.10
|
ELECTRUM_IMAGE: python:3.10
|
||||||
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
|
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ $ python3 -m pip install --user -e .
|
|||||||
Create translations (optional):
|
Create translations (optional):
|
||||||
```
|
```
|
||||||
$ sudo apt-get install gettext
|
$ 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:
|
Finally, to start Electrum:
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ fi
|
|||||||
# update locale
|
# update locale
|
||||||
info "preparing electrum-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
|
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
|
||||||
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ break_legacy_easy_install
|
|||||||
|
|
||||||
info "preparing electrum-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
|
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
|
||||||
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -52,6 +52,6 @@ The differences are as follows:
|
|||||||
found and used at runtime.
|
found and used at runtime.
|
||||||
- the normal tarball includes compiled (.mo) locale files, the source-only tarball does not.
|
- 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,
|
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
|
- the normal tarball includes generated `*_pb2.py` files. These are created
|
||||||
using `protobuf-compiler` from `.proto` files (see `contrib/generate_payreqpb2.sh`)
|
using `protobuf-compiler` from `.proto` files (see `contrib/generate_payreqpb2.sh`)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ fi
|
|||||||
|
|
||||||
info "preparing electrum-locale."
|
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.
|
# 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
|
# Set option OMIT_UNCLEAN_FILES=1 to exclude the compiled locale files
|
||||||
# see https://askubuntu.com/a/144139 (also see MANIFEST.in)
|
# see https://askubuntu.com/a/144139 (also see MANIFEST.in)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ info "Last commit: $VERSION"
|
|||||||
|
|
||||||
info "preparing electrum-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
|
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
|
||||||
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONTRIB="$(dirname "$(readlink -e "$0")")"
|
CONTRIB_LOCALE="$(dirname "$(readlink -e "$0")")"
|
||||||
|
CONTRIB="$CONTRIB_LOCALE"/..
|
||||||
PROJECT_ROOT="$CONTRIB"/..
|
PROJECT_ROOT="$CONTRIB"/..
|
||||||
|
|
||||||
cd "$PROJECT_ROOT"
|
cd "$PROJECT_ROOT"
|
||||||
@@ -12,4 +13,4 @@ LOCALE="$PROJECT_ROOT/electrum/locale/"
|
|||||||
cd "$LOCALE"
|
cd "$LOCALE"
|
||||||
git clean -ffxd
|
git clean -ffxd
|
||||||
git reset --hard
|
git reset --hard
|
||||||
"$CONTRIB/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale"
|
"$CONTRIB_LOCALE/build_locale.sh" "$LOCALE/locale" "$LOCALE/locale"
|
||||||
@@ -16,7 +16,7 @@ except ImportError as e:
|
|||||||
sys.exit(f"Error: {str(e)}. Try 'python3 -m pip install --user <module-name>'")
|
sys.exit(f"Error: {str(e)}. Try 'python3 -m pip install --user <module-name>'")
|
||||||
|
|
||||||
# set cwd
|
# 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)
|
os.chdir(project_root)
|
||||||
|
|
||||||
locale_dir = os.path.join(project_root, "electrum", "locale")
|
locale_dir = os.path.join(project_root, "electrum", "locale")
|
||||||
@@ -134,7 +134,7 @@ info "preparing electrum-locale."
|
|||||||
brew install gettext
|
brew install gettext
|
||||||
brew link --force gettext
|
brew link --force gettext
|
||||||
fi
|
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
|
# we want the binary to have only compiled (.mo) locale files; not source (.po) files
|
||||||
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
rm -r "$PROJECT_ROOT/electrum/locale/locale"/*/electrum.po
|
||||||
) || fail "failed generating locale"
|
) || fail "failed generating locale"
|
||||||
|
|||||||
Reference in New Issue
Block a user