From c3ed07ef70322ea0cde266f0217bc0cabaf3302c Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Fri, 4 Apr 2025 21:22:26 +0800 Subject: [PATCH] Block wrongly used words in Chinese translation --- ....18.1-find_lang-detect-Chinese-typos.patch | 33 +++++++++++++++++++ rpm.spec | 6 +++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 rpm-4.18.1-find_lang-detect-Chinese-typos.patch diff --git a/rpm-4.18.1-find_lang-detect-Chinese-typos.patch b/rpm-4.18.1-find_lang-detect-Chinese-typos.patch new file mode 100644 index 0000000..93e9b2d --- /dev/null +++ b/rpm-4.18.1-find_lang-detect-Chinese-typos.patch @@ -0,0 +1,33 @@ +--- rpm-4.18.1/scripts/find-lang.sh.orig 2023-07-24 00:05:17.801271891 +0800 ++++ rpm-4.18.1/scripts/find-lang.sh 2023-07-24 00:26:59.888943142 +0800 +@@ -281,4 +281,29 @@ + echo "No translations found for ${NAME} in ${TOP_DIR}" + exit 1 + fi +-exit 0 ++ ++# Deal with wrongly used typo in Chinese translation ++typos=("帐户" "帐号") ++have_typo=0 ++ ++for typo in ${typos[@]} ++do ++ # Search .mo translation files ++ for mo_file in `cat $MO_NAME |grep '%lang(zh) .*mo$'|awk '{ print $2 }'` ++ do ++ if msgunfmt --no-wrap $TOP_DIR/$mo_file | grep -q "$typo" ; then ++ have_typo=1 ++ echo "Typo $typo found in $mo_file" ++ fi ++ done ++ ++ # Search application files ++ for desktop_file in `find $TOP_DIR/usr/share/applications/ -name *.desktop | awk -F"$TOP_DIR" '{ print $2 } '` ++ do ++ if grep -q "$typo" $TOP_DIR$desktop_file ; then ++ have_typo=1 ++ echo "Typo $typo found in $desktop_file" ++ fi ++ done ++done ++exit $have_typo diff --git a/rpm.spec b/rpm.spec index 6b3c91b..2d17c7c 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.18.2 -Release: 23 +Release: 24 Summary: RPM Package Manager License: GPL-2.0-or-later URL: https://rpm.org/ @@ -67,6 +67,7 @@ Patch6043: backport-Fix-FA_TOUCH-ed-files-getting-removed-on-failed-upda.patch Patch9000: Add-digest-list-plugin.patch Patch9001: Add-IMA-digest-list-support.patch Patch9002: Support-sm2p256v1-of-ECDSA-and-sm3-of-hash.patch +Patch9003: rpm-4.18.1-find_lang-detect-Chinese-typos.patch BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel BuildRequires: zlib-devel zstd-devel >= 1.3.8 xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel @@ -352,6 +353,9 @@ make clean %exclude %{_mandir}/man8/rpmspec.8* %changelog +* Fri Apr 04 2025 Funda Wang - 4.18.2-24 +- Block wrongly used words in Chinese translation + * Mon Dec 2 2024 hugel - 4.18.2-23 - sync patches from upstream -- Gitee