2.5.0: locale-correct fonts, a test suite, and four more translations - #15
Conversation
Fixes a silent data-loss bug found by the new tests: removing a stat from a
section did not stick. Config's sanitize() treated a section's stat list as a
fixed-length array -- the rule that repairs a garbled {r,g,b,a} colour -- so any
section the user had shortened was "repaired" back to the default membership on
the next Activate, which is every login. No error, nothing on screen to explain
it. Colour arrays are now identified by holding numbers; a variable-length list
of names keeps the length the user gave it.
Fonts. The addon named Fonts\FRIZQT__.TTF in eleven places. That file exists on
the Korean and Chinese clients but carries Latin glyphs only, so it loads,
reports success, and draws empty boxes -- there is nothing to catch. Media:UIFont()
now resolves the client's own font, a "Game Default" choice exposes that in the
options, and Media:Fetch substitutes it for any Latin-only face a preset or
profile names. This is what blocked ruRU/koKR/zhCN/zhTW in 2.4.0.
Translations. Russian, Korean, Simplified Chinese and Traditional Chinese, all
complete against the 520-key set; the six existing locales backfilled to 100%.
zhTW is written out rather than converted from zhCN -- Versatility is 臨機應變
against 全能, Crit 爆擊 against 暴擊 -- since a character-level conversion would
read fine and be wrong in the words a user is looking for. None reviewed by a
native speaker; every file says so and points at the issue tracker.
Tests. tests/ loads the addon under a stubbed client and calls the pure logic
directly: priority parsing, the $token templates and their secret-value
guarantees, the profile schema, the v1 migration, sanitizing a corrupt profile,
import/export, the footer, the bindings, and every preset. 171 tests, no
dependencies -- harness.lua is the framework and CI already installs Lua. The
preset check matters most: a preset key that no longer matches the schema is
written into the profile, read by nobody, and silently does less than it claims.
Features:
- Key bindings for toggle, lock, options, next profile and the gear audit
- /sp debug: one copyable box with everything a bug report needs, and no
character or realm name in it
- Attack power, spell power, health, mana and Brewmaster stagger, all off by
default
- $per, the combat rating cost of 1% -- divided by the rating bonus rather than
the displayed value, so crit's base does not understate it
- Gear durability and repair cost in the footer
- Anchor point and X/Y position controls, kept in sync with dragging
- A Colorblind Safe preset on the Okabe-Ito palette, not relying on colour alone
- A what's-new notice, printed once per version, silent on a fresh install
- The priority box accepts the abbreviations the panel itself displays and the
client's own stat names, and no longer tokenizes on ASCII letters only
docs/MULTI-PANEL.md measures a second panel rather than guessing at it: 135
references to a file-local frame, 111 of 122 option bindings to re-scope, and a
saved-variables migration. Not implemented; the note has a four-stage plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d082d2cc1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not seen then | ||
| db.lastSeenVersion = current | ||
| return |
There was a problem hiding this comment.
Preserve the prior version for the first upgrade notice
On the first 2.5.0 login, every existing 2.4.x installation also lacks global.lastSeenVersion, because this field did not exist before this commit. This branch therefore treats all upgrading users as fresh installs, stamps 2.5.0, and suppresses the only 2.5.0 highlights permanently; the notice cannot work until a later release. Capture whether the saved database already existed, or seed a previous addon version during initialization, before using a missing stamp to identify fresh installs.
Useful? React with 👍 / 👎.
| local function normalizeWord(word) | ||
| return (word:lower():gsub("[%s%p]", "")) |
There was a problem hiding this comment.
Case-fold localized aliases without bytewise string.lower
On the new ruRU client, Lua 5.1's byte-oriented string.lower does not lowercase UTF-8 Cyrillic, so aliases registered as Искусность, Крит, etc. do not match normally typed lowercase forms such as искусность > крит. The parser consequently rejects an otherwise valid localized priority despite claiming case-insensitive support; use a Unicode-aware fold or register normalized lowercase locale variants explicitly.
Useful? React with 👍 / 👎.
Why
2.4.0 shipped six translations and documented why four more could not follow:
the addon named
Fonts\FRIZQT__.TTFin eleven places, and that file carriesLatin glyphs only on the Korean and Chinese clients. It loads, reports success,
and draws empty boxes — there is no error to catch. This removes that blocker
and adds the four languages.
Along the way the new test suite found a real bug.
The bug
Removing a stat from a section did not stick.
sanitize()inConfig.luatreated a section's stat list as a fixed-length array — the rule that exists to
repair a garbled
{r,g,b,a}colour — so any section the user had shortened was"repaired" back to the default membership on the next
Config:Activate, whichis every login. Silent: no error, and nothing on screen to say the setting had
been reverted.
Colour arrays are now identified by holding numbers. A variable-length list of
names keeps the length the user gave it, and only the element type is enforced.
Regression tests in
tests/spec_profiles.lua.What's in it
Fonts and translations
Media:UIFont()resolves the client's own font; a Game Default choiceexposes that in the options and is the new default and fallback
Media:Fetchsubstitutes it for any Latin-only face a preset or profilenames on a non-Latin client, and the font dropdown says which those are
All ten at 520/520 keys
zhTWis written out rather than converted fromzhCN— Versatility is臨機應變 against 全能, Crit 爆擊 against 暴擊, Leech 汲取 against 吸血
Tests —
tests/, 171 of them, no dependencies, new CI jobtests/wow_stub.lua) and calls thepure logic directly
$tokentemplates and their secret-valueguarantees, the profile schema, the v1 migration, sanitizing a corrupt
profile, import/export, the footer, the bindings, and every preset
the defaults schema is written into the profile, read by nobody, and silently
does less than it claims. All 22 are checked on every push
Features
/sp debug— one copyable box with everything a bug report needs. Carries nocharacter or realm name; the usual destination is a public tracker
$per— combat rating per 1%, divided by the rating bonus so crit's basedoes not understate it, and so it does not change with the total/bonus setting
puts Crit in red and Mastery in green — the two hues red-green colour
blindness cannot separate — and every other preset inherits it
Mast/Vers(which the panel itself displays)and the client's own stat names, and no longer tokenizes on ASCII only
Not in it
docs/MULTI-PANEL.mdmeasures a second panel rather than guessing: 135references to a file-local
frame, 111 of 122 option bindings to re-scope,and a
DB_VERSION2→3 saved-variables migration. The note has a four-stageplan where stages 1–3 are refactors covered by the new tests.
Tested
lua tests/run.lua— 171 passtools/locale-lint.ps1— clean, ten locales at 100%workflow's verify job will pass
Not tested in game. None of this has been loaded in the client. The parts I
would want eyes on first are the new frames in
Diagnostics.lua(the copy box)and the durability sampling in the footer — everything else is either covered by
the suite or a text change.