Skip to content

feat: pick Korean particles to match the name - #356

Merged
chattymin merged 2 commits into
chattymin:mainfrom
heli-os:feat/korean-particles
Sep 25, 2026
Merged

chattymin merged 2 commits into
chattymin:mainfrom
heli-os:feat/korean-particles

Conversation

@heli-os

@heli-os heli-os commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Korean copy writes both particle forms after a Pokémon name ("알에서 유니란이(가) 나왔어요!", "듀란(으)로 진화했어요!") because the name comes from PokéAPI at runtime. This PR picks the particle from the name's final syllable instead, without adding a dependency.

  • Add KoreanParticle (subject 이/가, object 을/를, direction 으로/로) in Core/KoreanParticle.swift. It reads the coda of the final Hangul syllable (U+AC00–U+D7A3); a ㄹ coda takes "로", as in "희귀 알로".
  • When the name does not end in a Hangul syllable, for example Unown's "안농 [A]" or a "fix: coalesce overlapping usage refreshes and harden companion-state decoding #123" placeholder before names load, it keeps today's combined form ("이(가)"). A combined form is always correct, while a guessed reading of Latin letters or digits could be wrong.
  • Use it in the six Korean strings that wrote both forms: statusEvolved, notifEvolveBody, notifHatchBody, notifShinyHatchBody, and eggConfirm (two spots). Other languages are unchanged.
  • Add KoreanParticle.swift to the logic core in scripts/test-gate.sh (as feat: propose collecting all 28 Unown forms #288 did for UnownForm.swift).

Why no library: the package has no external dependencies today, and the check is a few lines of Unicode arithmetic.

Update: after #351 merged, I merged main into this branch. The shiny hatch line keeps #351's odds and now also picks the particle.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

UI changes

No files under Sources/PokeTokenBar/UI/ change. Korean notification, status line, and shop confirmation copy change:

Before After
알에서 유니란이(가) 나왔어요! 알에서 유니란이 나왔어요!
이로치 뚜벅쵸이(가) 태어났어요! (1/48) 이로치 뚜벅쵸가 태어났어요! (1/48)
듀란(으)로 진화했어요! 듀란으로 진화했어요!
란쿨루스(으)로 진화했어요! 란쿨루스로 진화했어요!
레트라을(를) 놓아주고 희귀 알(으)로 바꿀까요? 레트라를 놓아주고 희귀 알로 바꿀까요?
알에서 안농 [A]이(가) 나왔어요! unchanged (name does not end in Hangul)

Checklist

  • swift build and swift test pass locally: swift build passes locally. This machine has only Command Line Tools (no XCTest), so the full suite ran in CI instead. After merging main: 1341 tests, 0 failures, coverage gate passed with KoreanParticle.swift at 100% (run).
  • PR title and description are written in English
  • UI changes are described above (before/after — images optional)
  • No copyrighted assets, secrets, or private tooling references are committed (see CONTRIBUTING)
  • Tests were added or updated for this change

Tests: KoreanParticleTests covers each particle with and without a coda, ㄹ with "로", non-Hangul endings (Unown letter, #123, Latin, empty), the six Korean strings end to end, and that English and Japanese copy is unchanged. LocalizationInterpolationTests still passes because its sentinel is non-Hangul and keeps the combined form.

🤖 Generated with Claude Code

heli-os and others added 2 commits September 25, 2026 10:42
Korean copy wrote both particle forms after runtime Pokémon names
("유니란이(가)", "듀란(으)로") because the name is not known when the
string is translated. Pick the particle from the final syllable's coda
instead, with ㄹ taking "로".

- Add KoreanParticle (subject 이/가, object 을/를, direction 으로/로).
  Names that do not end in a Hangul syllable, such as Unown's "[A]" or a
  "chattymin#123" placeholder, keep the combined form.
- Use it in the six Korean strings that wrote both forms. Other
  languages are unchanged.
- Add the helper to the coverage gate's logic core.

No new dependency: es-hangul is JavaScript, and the check is a few lines
of Unicode arithmetic.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Resolve the notifShinyHatchBody conflict with chattymin#351: keep the odds parameter and pick the Korean particle.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chattymin
chattymin merged commit 746d838 into chattymin:main Sep 25, 2026
2 checks passed
@chattymin

Copy link
Copy Markdown
Owner

Thank you for your contribution!

@heli-os
heli-os deleted the feat/korean-particles branch September 25, 2026 02:30
Strongorange added a commit to Strongorange/PokeTokenBar-windows that referenced this pull request Oct 20, 2026
Port macOS chattymin#356 (KoreanParticle.swift): hatch, shiny hatch, evolve,
level-up status, egg confirm and mint feedback now append the particle
matching the name's batchim (을/를, 이/가, 으로/로, with ㄹ-coda taking
로) instead of the parenthesized dual forms. Non-Hangul endings (Unown
markers, pre-load 'chattymin#123', Latin names) keep the dual form — a wrong
particle is worse than a parenthetical.

Also fixes the mint feedback passing the raw enum name ('Jolly') instead
of the localized nature, which would have kept '(으)로' visible in
Korean copy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants