Skip to content

koKR: add a render-hook layer so direct-SetText / format / tooltip / popup text is translated too#428

Open
labrie75 wants to merge 4 commits into
EllesmereGaming:mainfrom
labrie75:labrie75-patch-5
Open

koKR: add a render-hook layer so direct-SetText / format / tooltip / popup text is translated too#428
labrie75 wants to merge 4 commits into
EllesmereGaming:mainfrom
labrie75:labrie75-patch-5

Conversation

@labrie75

Copy link
Copy Markdown
Contributor

Locale render hook

Optional translation layer appended to the bottom of Locales/koKR.lua.
Core EllesmereUI_Locale.lua only translates where a builder calls L(); this
hook also covers direct :SetText, format strings, tooltips and EUI popups.
Inert unless the locale is active. The core engine is not modified.

What it adds over L()

  • Format-key re-matching: "96 Items""%d Items" → translated value.
  • Recursive colour / paren / comma-list wrapping.
  • Hooks on FontString:SetText / SetFormattedText / Button:SetText, scoped
    to EllesmereUI-family frames only.
  • Tooltip line-pool scan, EUI StaticPopup_Show, one-time login sweep.
  • 12.0 secret-value / protected-frame guards; sets _localeRenderHook so a
    standalone companion defers.

AMBIG (homonym overrides) and the Upgrade Calculator parse are the only
koKR-tuned parts.

Upgrade Calculator parse

The Upgrade Calculator reads the item's "Upgrade Level: /"
tooltip line to get the track and rank. On a localized client that line is
translated, so the English parse fails. This hook reads the localized line and
maps the track name back to its English key via the catalog. No-op on English
or on a catalog miss.

Reusing for another language

Copy the block into your Locales/xxXX.lua and change local KO = "koKR" to
your code. If both koKR and your file carry it, add this at the top of each so
only the active one installs:

if EllesmereUI.LOCALE ~= "frFR" then return end

labrie75 added 4 commits June 21, 2026 11:07
8.24 Update koKR.lua
…popup text is translated too

# Locale render hook

Optional translation layer appended to the bottom of `Locales/koKR.lua`.
Core `EllesmereUI_Locale.lua` only translates where a builder calls `L()`; this
hook also covers direct `:SetText`, format strings, tooltips and EUI popups.
Inert unless the locale is active. The core engine is **not** modified.

## What it adds over `L()`

- Format-key re-matching: `"96 Items"` → `"%d Items"` → translated value.
- Recursive colour / paren / comma-list wrapping.
- Hooks on `FontString:SetText` / `SetFormattedText` / `Button:SetText`, scoped
  to EllesmereUI-family frames only.
- Tooltip line-pool scan, EUI `StaticPopup_Show`, one-time login sweep.
- 12.0 secret-value / protected-frame guards; sets `_localeRenderHook` so a
  standalone companion defers.

`AMBIG` (homonym overrides) and the Upgrade Calculator parse are the only
koKR-tuned parts.

### Upgrade Calculator parse

The Upgrade Calculator reads the item's "Upgrade Level: <track> <r>/<max>"
tooltip line to get the track and rank. On a localized client that line is
translated, so the English parse fails. This hook reads the localized line and
maps the track name back to its English key via the catalog. No-op on English
or on a catalog miss.

## Reusing for another language

Copy the block into your `Locales/xxXX.lua` and change `local KO = "koKR"` to
your code. If both koKR and your file carry it, add this at the top of each so
only the active one installs:

```lua
if EllesmereUI.LOCALE ~= "frFR" then return end
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.

1 participant