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

[Localization] localize reward gain with hard-coded numBerries(item count) in ME. #4379

Merged
merged 16 commits into from
Sep 25, 2024

Conversation

EnochG1
Copy link
Contributor

@EnochG1 EnochG1 commented Sep 22, 2024

What are the changes the user will see?

English : No changes
Some languages : Not to see awkward reward message (with count).

Why am I making these changes?

There's an issue with the script displaying awkwardly when multiple items are obtained during the ME events in some languages (specifically for Korean, Chinese, and Japanese).
It's grammatically correct to use a measure word when referring to items with count.
image

2 itemName is grammatically weird in Korean, Chinese, Japanese.

In Korean, it should be "2개의 {{itemname}}" or "{{itemname}} 2개"
In Chinese, it should be "2个{{itemname}}" or "{{itemname}}2个"
In Japanese, it should be "2個の{{itemname}}" or "{{itemname}}2個"

What are the changes from a developer perspective?

  • Add new i18n key rewardGainCount instead of rewardGain.
  • change files which uses rewardGain with hard-coded number.
berries-abound-encounter.ts
trash-to-treasure-encounter.ts
  • Translate them for each languages.

Screenshots/Videos

EN

image

KO

image

Zh_CN

image

Zh_TW

image

JA

image

How to test the changes?

Manually with overrides.ts

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@flx-sta flx-sta added Localization Provides or updates translation efforts P3 Bug Non gameplay affecting bug. typos, graphical issues, or other minor incorrect interactions. labels Sep 23, 2024
@EnochG1 EnochG1 marked this pull request as ready for review September 23, 2024 03:03
@EnochG1 EnochG1 requested review from a team as code owners September 23, 2024 03:03
returntoice
returntoice previously approved these changes Sep 23, 2024
Copy link
Contributor

@returntoice returntoice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WAY better

Chapybara-jp
Chapybara-jp previously approved these changes Sep 23, 2024
Adri1
Adri1 previously approved these changes Sep 23, 2024
Copy link
Contributor

@40chyan 40chyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra spaces are not included in ZH

src/locales/zh_CN/battle.json Outdated Show resolved Hide resolved
src/locales/zh_TW/battle.json Outdated Show resolved Hide resolved
EnochG1 and others added 2 commits September 24, 2024 08:28
Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>
Co-authored-by: Yonmaru40 <47717431+40chyan@users.noreply.github.com>
@EnochG1 EnochG1 dismissed stale reviews from returntoice and Adri1 via 77650cc September 25, 2024 03:56
Adri1
Adri1 previously approved these changes Sep 25, 2024
Chapybara-jp
Chapybara-jp previously approved these changes Sep 25, 2024
SangaraSorama
SangaraSorama previously approved these changes Sep 25, 2024
Copy link
Collaborator

@flx-sta flx-sta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use the {{count}} interpolation instead (and also pass it in the code).

Why?

The count interpolation supports the Plurals feature of i18next. So if in the future the text needs to adjust acording to it being 1/2/3 ... items you can achieve that via passing count.

Check the link for more information.

src/locales/en/battle.json Outdated Show resolved Hide resolved
src/locales/de/battle.json Show resolved Hide resolved
src/locales/en/battle.json Show resolved Hide resolved
src/locales/es/battle.json Show resolved Hide resolved
src/locales/fr/battle.json Show resolved Hide resolved
src/locales/it/battle.json Show resolved Hide resolved
src/locales/ja/battle.json Show resolved Hide resolved
src/locales/ko/battle.json Show resolved Hide resolved
src/locales/pt_BR/battle.json Show resolved Hide resolved
src/locales/zh_CN/battle.json Show resolved Hide resolved
src/locales/zh_TW/battle.json Show resolved Hide resolved
Co-authored-by: ImperialSympathizer <110984302+ben-lear@users.noreply.github.com>
flx-sta
flx-sta previously approved these changes Sep 25, 2024
@EnochG1
Copy link
Contributor Author

EnochG1 commented Sep 25, 2024

FYI,
some modifiers' name are already plural(like berries, leftovers) so in this PR I won't handle i18next's plurals
(test results in EN)
image
image
image

@CodeTappert CodeTappert merged commit 83c18af into pagefaultgames:beta Sep 25, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Localization Provides or updates translation efforts P3 Bug Non gameplay affecting bug. typos, graphical issues, or other minor incorrect interactions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants