From 2e2485ee0635a05ce2b1bf14249f5a234d8de0f7 Mon Sep 17 00:00:00 2001 From: zhangshaoning Date: Thu, 4 Sep 2025 14:02:06 +0800 Subject: [PATCH] add chinese translation --- 0001-add-chinese-translation.patch | 43 ++++++++++++++++++++++++++++++ coreutils.spec | 18 ++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-add-chinese-translation.patch diff --git a/0001-add-chinese-translation.patch b/0001-add-chinese-translation.patch new file mode 100644 index 0000000..445790a --- /dev/null +++ b/0001-add-chinese-translation.patch @@ -0,0 +1,43 @@ +From 37a0e277e601511dee71447128bd62c33ca8c0d4 Mon Sep 17 00:00:00 2001 +From: zhangshaoning +Date: Thu, 4 Sep 2025 13:59:16 +0800 +Subject: [PATCH] add chinese translation + +--- + po/zh_CN.po | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/po/zh_CN.po b/po/zh_CN.po +index 8c8ba0b..fba67b4 100644 +--- a/po/zh_CN.po ++++ b/po/zh_CN.po +@@ -5044,22 +5044,22 @@ msgstr "无法找到 ID 为 %s 的用户的名称" + #: src/id.c:358 + #, c-format + msgid "uid=%s" +-msgstr "uid=%s" ++msgstr "用户id=%s" + + #: src/id.c:363 + #, c-format + msgid " gid=%s" +-msgstr " gid=%s" ++msgstr " 组id=%s" + + #: src/id.c:370 + #, c-format + msgid " euid=%s" +-msgstr " euid=%s" ++msgstr " 有效用户id=%s" + + #: src/id.c:378 + #, c-format + msgid " egid=%s" +-msgstr " egid=%s" ++msgstr " 有效组id=%s" + + #: src/id.c:406 + msgid " groups=" +-- +2.18.2 + diff --git a/coreutils.spec b/coreutils.spec index 20b2dbc..2c51551 100644 --- a/coreutils.spec +++ b/coreutils.spec @@ -1,6 +1,6 @@ Name: coreutils Version: 9.4 -Release: 19 +Release: 20 License: GPLv3+ Summary: A set of basic GNU tools commonly used in shell scripts Url: https://www.gnu.org/software/coreutils/ @@ -109,6 +109,7 @@ Patch94: backport-ls-fix-crash-on-systems-with-SELinux-but-without-xat.patch Patch95: backport-ls-fix-crash-of-ls-Z-.-on-OpenBSD-s-dev-wd0a-disk.patch Patch9001: coreutils-9.0-sw.patch +Patch9002: 0001-add-chinese-translation.patch Conflicts: filesystem < 3 # To avoid clobbering installs @@ -197,6 +198,18 @@ ln -v ../lib/parse-datetime.{c,y} . %install (cd separate && make DESTDIR=$RPM_BUILD_ROOT install) +# 删除 po 目录下已有的 .gmo 文件,确保不会被安装 +rm -f po/*.gmo + +# 进入 po 目录并手动编译 .po → .mo +cd po +for po_file in *.po; do + lang="${po_file%.po}" + msgfmt "$po_file" -o "${lang}.mo" + install -d "${RPM_BUILD_ROOT}%{_datadir}/locale/${lang}/LC_MESSAGES" + install -m 0644 "${lang}.mo" "${RPM_BUILD_ROOT}%{_datadir}/locale/${lang}/LC_MESSAGES/coreutils.mo" +done +cd .. # chroot was in /usr/sbin : mkdir -p $RPM_BUILD_ROOT/{%{_bindir},%{_sbindir}} @@ -251,6 +264,9 @@ fi %{_mandir}/man*/* %changelog +* Thu Sep 04 2025 zhangshaoning - 9.4-20 +- add chinese translation + * Thu Aug 21 2025 yanglongkang - 9.4-19 - sync patches from community -- Gitee