Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Translated spelling is not idiomatic in some languages #14800

Closed
panlatent opened this issue Apr 12, 2024 · 3 comments
Closed

[5.x]: Translated spelling is not idiomatic in some languages #14800

panlatent opened this issue Apr 12, 2024 · 3 comments
Labels

Comments

@panlatent
Copy link
Contributor

What happened?

Description

Translated spelling is not idiomatic in some languages.

In Chinese (zh), people are used to using Arabic numerals instead of spelling format 2, which represents the quantity, is not translated (extra, it should not be translated as "二", it should be "两"). Craft uses the following code:

Craft::t('app', '{count, spellout} {count, plural, =1{plugin} other{plugins}}', [
    'count' => $count,
]);

Steps to reproduce

Expected behavior

2 => 2

Actual behavior

2 => 二

Craft CMS version

5.0

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@panlatent panlatent added the bug label Apr 12, 2024
@brandonkelly
Copy link
Member

@panlatent The translation for that message can be found in src/translations/zh/app.php. Can you please submit a PR with the corrected translation?

@panlatent
Copy link
Contributor Author

@brandonkelly I will submit a PR next. The problem is not as simple as I thought. Changing {count, spellout} to {count} will cause the message to be inconsistent with the translation: In the Chinese environment, Intl will complain about plural and throw an exception, causing a fallback to the original translation.

@panlatent
Copy link
Contributor Author

PR #14810
Finish. Cannot write {var} {var xxx}.
yiisoft/yii2#11767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants