build.sh: fix SimpleInit i18n locale
authorBigfootACA <bigfoot@classfun.cn>
星期三, 6 Oct 2021 08:38:17 +0000 (16:38 +0800)
committerBigfootACA <bigfoot@classfun.cn>
星期三, 6 Oct 2021 08:38:17 +0000 (16:38 +0800)
Signed-off-by: BigfootACA <bigfoot@classfun.cn>
.github/workflows/main.yml
README.md
README.zh.md
build.sh

index 9209a74cd6c606a8b4e77d207fa494a371b7fa36..c452790fd969326a5bdf01886331d4fc42653fd7 100644 (file)
@@ -55,7 +55,7 @@ jobs:
       - name: Install requires packages
         run: |
           sudo apt-get update
-          sudo apt-get -y install build-essential uuid-dev iasl nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git
+          sudo apt-get -y install build-essential uuid-dev iasl nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext
 
       - name: Build device ${{ matrix.device }}
         run: |
index 38841a1f7b4063a78a91d3d88e67d97ba06031cb..5aec7cdefb96900cfe2d82ad5afbfb01fdbc5d0c 100644 (file)
--- a/README.md
+++ b/README.md
@@ -62,7 +62,7 @@ For Ubuntu 20.04:
 ```bash
 sudo apt update
 sudo apt upgrade
-sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git
+sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext
 ```
 
 ## Building
index 6ddec928427b356ea7d7b3353c1031fb37f76109..183b68a83bbf0b99e151793c57a31c45576e2bc4 100644 (file)
@@ -66,7 +66,7 @@ Ubuntu 20.04:
 ```bash\r
 sudo apt update\r
 sudo apt upgrade\r
-sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git\r
+sudo apt install build-essential uuid-dev iasl git nasm gcc-aarch64-linux-gnu abootimg python3-distutils python3-pil python3-git gettext\r
 ```\r
 \r
 ## 构建\r
index 6fde84eead769d33a48c1a03f868f1d2b4350e8e..88bc7d8ce6526cd841984e33c618d8fe0c8960c7 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -191,7 +191,13 @@ export GITCOMMIT
 echo > ramdisk
 set -e
 python3 assets/generate-logo.py "${GITCOMMIT}"
-mkdir -p "${_SIMPLE_INIT}/build"
+mkdir -p "${_SIMPLE_INIT}/build" "${_SIMPLE_INIT}/usr/share/locale"
+for i in "${_SIMPLE_INIT}/po/"*.po
+do     [ -f "${i}" ]||continue
+       _name="$(basename "$i" .po)"
+       _path="${_SIMPLE_INIT}/root/usr/share/locale/${_name}/LC_MESSAGES"
+       msgfmt -o "${_path}/simple-init.mo" "${i}"
+done
 bash "${_SIMPLE_INIT}/scripts/gen-rootfs-source.sh" \
        "${_SIMPLE_INIT}" \
        "${_SIMPLE_INIT}/build"