open-power / petitboot

GNU General Public License v2.0
205 stars 56 forks source link

language translation fix #76

Closed lili-lilili closed 3 years ago

lili-lilili commented 3 years ago

I build a pnor base on op-build-v2p3, and find some chinese translation is not correct:

file:po/zh_CN.po msgid "BMC golden side:" msgstr "BMC 金色一侧:" ----> I modify it to "BMC 备用侧",and create a patch.

After rebuild the pnor with the patch, I find it not work. What should I do to make my changes work?

klauskiwi commented 3 years ago

Can you attach your patch and also what exactly is not working? (i.e., is it not reflecting the change or is it breaking somewhere, with outputs etc?)

lili-lilili commented 3 years ago

Here is the patch:

diff --git a/po/zh_CN.po b/po/zh_CN.po index 736876b..870fa21 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -590,7 +590,7 @@ msgid "BMC current side:" msgstr "BMC 当前侧:"

msgid "BMC golden side:" -msgstr "BMC 金色一侧:" +msgstr "BMC 备用侧:"

msgid "Storage devices" msgstr "存储设备"

lili-lilili commented 3 years ago

I found that the problem is that the zh_CN.po file is not automatically compiled during the PNOR compilation process. If I manually execute the cmd "msgfmt --output-file=zh_CN.gmo zh_CN.po" , this change will take effect. So, is my operation improper? Or is it designed like this?

klauskiwi commented 3 years ago

On op-build, since we started using release tarballs for petitboot instead of a raw git repo, the .po translation files are pre-built and included in the tarball. Once the translation corrections are accepted and a new Petitboot tarball is released, this should not be a problem.

But if you want to use op-build to test this change (with a build-time patch to petitboot) you'll need to modify the petitboot.mk file in this way:

diff --git a/openpower/package/petitboot/petitboot.mk b/openpower/package/petitboot/petitboot.mk
index d4e95a8a..d3251c7e 100644
--- a/openpower/package/petitboot/petitboot.mk
+++ b/openpower/package/petitboot/petitboot.mk
@@ -10,6 +10,8 @@ PETITBOOT_SITE ?= https://github.com/open-power/petitboot/releases/download/$(PE
 PETITBOOT_DEPENDENCIES = ncurses udev host-bison host-flex lvm2
 PETITBOOT_LICENSE = GPLv2
 PETITBOOT_LICENSE_FILES = COPYING
+PETITBOOT_AUTORECONF = YES
+PETITBOOT_GETTEXTIZE  = YES

 PETITBOOT_CONF_OPTS += --with-ncurses --without-twin-x11 --without-twin-fbdev \
              --localstatedir=/var \
@@ -33,6 +35,11 @@ ifeq ($(BR2_PACKAGE_NCURSES_WCHAR),y)
 PETITBOOT_CONF_OPTS += --with-ncursesw MENU_LIB=-lmenuw FORM_LIB=-lformw
 endif

+define PETITBOOT_PRE_BUILD
+       $(MAKE) -C $(@D)/po update-po
+endef
+
+
 define PETITBOOT_POST_INSTALL
        $(INSTALL) -D -m 0755 $(@D)/utils/bb-kexec-reboot \
                $(TARGET_DIR)/usr/libexec/petitboot
@@ -76,6 +83,7 @@ define PETITBOOT_POST_INSTALL_DTB
                $(TARGET_DIR)/etc/petitboot/boot.d/
 endef

+PETITBOOT_PRE_BUILD_HOOKS += PETITBOOT_PRE_BUILD
 PETITBOOT_POST_INSTALL_TARGET_HOOKS += PETITBOOT_POST_INSTALL

 ifeq ($(BR2_PACKAGE_DTC),y)
lili-lilili commented 3 years ago

thanks

klauskiwi commented 3 years ago

Please create a PR with the fixed translation. Thanks

lili-lilili commented 3 years ago

klaus,Let me confirm again: Does "golden side" mean that this is a backup side?

klauskiwi commented 3 years ago

Lili,

golden in this context means "assured", "known-to-work" and yes, it's the backup side in case the current side is bad.

However, looking at all the other translations, it appears that they retain the 'golden' terminology instead of using 'backup' or 'spare' as you seem to indicate - so I'm not sure it's appropriate to change that term, as we may have documentation (in IBM or elsewhere) referring to that term as 'golden' as well.

lili-lilili commented 3 years ago

kalus, In chinese, "金色" is not "known-to-work", and it just only represents one color. In addition, this in AMI BMC is translated as a "备用"(backup). I think the "备用" is a better terminology. If the customer sees the word “备用”, they will immediately think that if the current side has a problem, the “备用” side will replace the current side to work.

So,let me create a pull request, and you can discuss with other colleagues at IBM whether this translation is better?

https://github.com/open-power/petitboot/pull/77