Bug 442572 - Chinese l10n problem in check printing
Summary: Chinese l10n problem in check printing
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: translation (show other bugs)
Version: git (master)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-17 03:27 UTC by wordlessecho
Modified: 2021-10-04 09:12 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wordlessecho 2021-09-17 03:27:34 UTC
In Chinese:
- Small numbers is 1 to 9.
- Does not need tens number.
- Every numbers of digits could be a scale numbers. Such as 10, 100, 1000…up to hundred million. (more rules after hundred million)

Examples:
Arabic numerals -> Chinese Simplified -> Chinese (on cheques) -> Word-to-word translation
12 -> 十二 -> 拾贰 -> ten two
1212 -> 一千两百一十二 -> 壹仟贰佰壹拾贰 -> one thousand two hundred one ten two
12000 -> 一万二 -> 壹万贰 -> one (ten thousand) two
210000 -> 二十一万 -> 贰拾壹万 -> two ten one (ten thousand)
Comment 1 wordlessecho 2021-09-17 08:06:09 UTC
https://invent.kde.org/office/kmymoney/-/blob/2257a1e2f9837fa23b3ac4550fb422307cada5a6/kmymoney/plugins/checkprinting/numbertowords.cpp#L14

In Chinese:
- smallNumbers should be 0 to 9.
- Does not have "tens".
- Numbers are grouped by four instead of three in English.
- Any number ending with a zero could be a scaleNumber. Such as 10, 100, 1000…up to hundred million. (more rules after hundred million)

Examples:
Arabic numerals -> Chinese Simplified -> Chinese (when written on cheques) -> Word-for-word translation
Note: 万 = Wan (ten thousand)
12 -> 十二 -> 拾贰 -> ten two
1212 -> 一千两百一十二 -> 壹仟贰佰壹拾贰 -> one thousand two hundred one ten two
12000 -> 一万二 -> 壹万贰 -> one Wan two
210000 -> 二十一万 -> 贰拾壹万 -> two ten one Wan
Comment 2 Shinjo Park 2021-09-17 10:10:43 UTC
We had a similar problem in Korean too, so that's why this exist: https://invent.kde.org/office/kmymoney/-/blob/2257a1e2f9837fa23b3ac4550fb422307cada5a6/kmymoney/plugins/checkprinting/numbertowords.cpp#L79 Instead of coding numerals for every language, it is possible to write a Javascript logic for translating them. The JS function should take numbers as input and should produce a proper translation.

See also: https://techbase.kde.org/Localization/Concepts/Transcript and bug 420321
Comment 3 Alvin Wong 2021-10-04 08:58:00 UTC
I believe the numbering rules between Chinese, Japanese and Korean are quite similar, but there may be some subtle differences with the handling of zeros and ones.

Side note: In Hong Kong it is rather common for us to write cheques with the amount in English, so I would hope that KMyMoney will not force the use of Chinese numbers when the interface language is set to Chinese Traditional (zh_TW). (But to clarify, I don't use KMyMoney so I may be missing some context.)
Comment 4 Shinjo Park 2021-10-04 09:12:26 UTC
(In reply to Alvin Wong from comment #3)
> I believe the numbering rules between Chinese, Japanese and Korean are quite
> similar, but there may be some subtle differences with the handling of zeros
> and ones.

True, we don't explicitly mention zero and one in colloquial speech but ones are expllicitly mentioned in financial speech in Korean. That's why I only suppress zeroes at https://websvn.kde.org/trunk/l10n-kf5/ko/scripts/kmymoney/kmymoney.js?view=markup (line 19 to 28) and explicitly include ones.

> Side note: In Hong Kong it is rather common for us to write cheques with the
> amount in English, so I would hope that KMyMoney will not force the use of
> Chinese numbers when the interface language is set to Chinese Traditional
> (zh_TW). (But to clarify, I don't use KMyMoney so I may be missing some
> context.)

That's another good point... Do we support issuing cheques in different language from the current $LANG?