feat(addons): zhCN localization for ClassicAPI_DebugTools and 6 missing globals fix (#141)

* feat(debugtools): add zhCN localization for ClassicAPI_DebugTools

* fix(locales): add 6 missing global strings to zhCN

* feat(debugtools): clean up slash command dispatch and add help subcommand

* fix(debugtools): use %s instead of %d in PROFILER_CALLS_FORMAT

ns.Count() always returns a string (either a formatted number or '-'),
never a number. Feeding it to %d causes format() to throw. Change the
locale template to %s so both '-', '1,234', etc. render correctly.

* fix(debugtools): repair regressions from the localization pass

- XML labels: 1.12's Button/FontString loader passes the text attribute
  verbatim to FrameScript_GetText (0x703BF0), which reads the global of
  exactly that name and falls back to the raw value. Nothing strips
  "$...$", so text="$TI_SHOW$" rendered as literal "$TI_SHOW$". Use the
  bare global name, as stock FrameXML does.
- Tabs: ns.AddTab(name, label) keeps a fixed English key for ns.ShowIn
  and a separate localized button label. Keying tabs by the translated
  name made ShowIn("Globals") return nil and error on a zhCN client.
- Frames tab state: restore visible / "shown, parent hidden" / hidden.
  The inverted branch reported a shown frame under a hidden parent as
  hidden and made the third state unreachable.
- /profiler: unknown or incomplete subcommands print the usage again
  instead of doing nothing.
- Deep Tracking / CPU Profiling buttons: split the label from ON/OFF so
  the state keeps its accent / grey colour.
- Restore the gap between owner and CPU time in the frame-stack and
  Frames-tab tooltips, and the leading space of " (replaced)".
- zhCN: ADDON_OPTIONS titles the shared Interface Options panel and the
  game-menu button, not ClassicAPI's own settings; revert to 插件设置.

---------

Co-authored-by: jilinge <jilinge@users.noreply.github.com>
Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
This commit is contained in:
jilinge
2026-11-13 10:33:01 -06:00
committed by GitHub
co-authored by jilinge Brues
parent d689aab94c
commit 8e721237f6
17 changed files with 584 additions and 159 deletions
@@ -213,7 +213,7 @@ function TableInspectorMixin:InspectTable(focusedTable, title)
self.focusedTable = focusedTable;
if not focusedTable then
self:ClearData();
self.TitleButton.Text:SetText("No Table Selected");
self.TitleButton.Text:SetText(TI_NO_TABLE_SELECTED);
return;
end
@@ -230,9 +230,9 @@ function TableInspectorMixin:InspectTable(focusedTable, title)
if not title then
if focusedTable.GetDebugName then
title = "Frame Attributes - "..focusedTable:GetDebugName();
title = TI_FRAME_ATTRIBUTES..focusedTable:GetDebugName();
else
title = "Table Attributes";
title = TI_TABLE_ATTRIBUTES;
end
end