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
Open
koKR: add a render-hook layer so direct-SetText / format / tooltip / popup text is translated too#428labrie75 wants to merge 4 commits into
labrie75 wants to merge 4 commits into
Conversation
8.24 Update koKR.lua
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Locale render hook
Optional translation layer appended to the bottom of
Locales/koKR.lua.Core
EllesmereUI_Locale.luaonly translates where a builder callsL(); thishook 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()"96 Items"→"%d Items"→ translated value.FontString:SetText/SetFormattedText/Button:SetText, scopedto EllesmereUI-family frames only.
StaticPopup_Show, one-time login sweep._localeRenderHookso astandalone companion defers.
AMBIG(homonym overrides) and the Upgrade Calculator parse are the onlykoKR-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.luaand changelocal KO = "koKR"toyour code. If both koKR and your file carry it, add this at the top of each so
only the active one installs: