refactor: convert locale keys to standard AceLocale format#144
Conversation
Reverts the UPPER_SNAKE_CASE locale key convention introduced in bdc09db back to standard AceLocale format where the English text serves as the key. - enUS.lua: L["English text"] = true (201 keys, down from 202 due to FONT/HEADER_FONT collision collapse) - deDE.lua: L["English text"] = "German translation" - All 15 code files updated to reference English text keys - .luacheckrc: re-enable linting on locale files with max_line_length = false
📝 WalkthroughWalkthroughThis pull request refactors localization key patterns across the DragonToast addon. Constant-style keys (e.g., Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~28 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
DragonToast/Display/ToastFrame.lua (2)
285-289: Stale doc comment references old key.Line 287 references
L["YOU"]but the implementation usesL["You"].📝 Suggested fix
-- Shows or hides the looter label on a reward toast according to configuration. -- If `db.display.showLooter` is false the looter label is hidden; otherwise the label --- is set to the localized "YOU" text, colored with `SELF_LOOTER_COLOR`, and shown. +-- is set to the localized "You" text, colored with `SELF_LOOTER_COLOR`, and shown.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@DragonToast/Display/ToastFrame.lua` around lines 285 - 289, Update the stale doc comment to match the implementation: change the referenced localization key from L["YOU"] to L["You"] (or state that the looter label uses L["You"]) and ensure the comment references the `looter` FontString and `db.display.showLooter` behavior used in the toast handling function that shows/hides the looter label.
301-304: Stale doc comment references old key.Line 303 references
L["YOU"]but the implementation now usesL["You"].📝 Suggested fix
-- Update the toast's looter label according to configuration and loot data. -- Shows or hides the looter text; when the looter is the player displays --- `L["YOU"]` with the self looter color, otherwise displays the looter's +-- `L["You"]` with the self looter color, otherwise displays the looter's -- name with a muted color.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@DragonToast/Display/ToastFrame.lua` around lines 301 - 304, The doc comment above the looter label update is stale: it references L["YOU"] but the code now uses L["You"]; update the comment text to mention L["You"] (or remove the specific key reference) so the comment matches the implementation in the looter label logic that uses L["You"] and the self looter color.DragonToast/Listeners/MailListener_Shared.lua (1)
44-47: Stale doc comment references old locale keys.The function documentation still references
L["AUCTION_WON"],L["AUCTION_SALE"],L["FORMAT_MAIL_FROM"], andL["MAIL"]but the implementation now usesL["Auction Won"],L["Auction Sale"],L["Mail - %s"], andL["Mail"].📝 Suggested doc update
-- Shared helpers -- Return a localized label describing the source of the mail at the given inbox index. -- `@param` index The inbox mail index to inspect. --- `@return` A localized string: `L["AUCTION_WON"]` for buyer invoices, --- `L["AUCTION_SALE"]` for seller invoices, a formatted --- `L["FORMAT_MAIL_FROM"]` with the sender when present, or --- `L["MAIL"]` as a fallback. +-- `@return` A localized string: `L["Auction Won"]` for buyer invoices, +-- `L["Auction Sale"]` for seller invoices, a formatted +-- `L["Mail - %s"]` with the sender when present, or +-- `L["Mail"]` as a fallback.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@DragonToast/Listeners/MailListener_Shared.lua` around lines 44 - 47, Update the stale doc comment that describes the return value to match the current localization keys used in the implementation: replace references to L["AUCTION_WON"], L["AUCTION_SALE"], L["FORMAT_MAIL_FROM"], and L["MAIL"] with L["Auction Won"], L["Auction Sale"], L["Mail - %s"], and L["Mail"] respectively so the documented return values align with the actual strings used by the function in MailListener_Shared.lua.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@DragonToast/Display/ToastFrame.lua`:
- Around line 285-289: Update the stale doc comment to match the implementation:
change the referenced localization key from L["YOU"] to L["You"] (or state that
the looter label uses L["You"]) and ensure the comment references the `looter`
FontString and `db.display.showLooter` behavior used in the toast handling
function that shows/hides the looter label.
- Around line 301-304: The doc comment above the looter label update is stale:
it references L["YOU"] but the code now uses L["You"]; update the comment text
to mention L["You"] (or remove the specific key reference) so the comment
matches the implementation in the looter label logic that uses L["You"] and the
self looter color.
In `@DragonToast/Listeners/MailListener_Shared.lua`:
- Around line 44-47: Update the stale doc comment that describes the return
value to match the current localization keys used in the implementation: replace
references to L["AUCTION_WON"], L["AUCTION_SALE"], L["FORMAT_MAIL_FROM"], and
L["MAIL"] with L["Auction Won"], L["Auction Sale"], L["Mail - %s"], and
L["Mail"] respectively so the documented return values align with the actual
strings used by the function in MailListener_Shared.lua.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0f940c3e-18e8-4299-a14d-1e466618a701
📒 Files selected for processing (18)
.luacheckrcDragonToast/Core/Init.luaDragonToast/Display/TestToasts.luaDragonToast/Display/ToastFrame.luaDragonToast/Display/ToastManager.luaDragonToast/Listeners/HonorListener_Shared.luaDragonToast/Listeners/MailListener_Shared.luaDragonToast/Listeners/MessageBridge.luaDragonToast/Listeners/ReputationListener_Shared.luaDragonToast/Listeners/XPListener.luaDragonToast/Locales/deDE.luaDragonToast/Locales/enUS.luaDragonToast_Options/Tabs/AnimationTab.luaDragonToast_Options/Tabs/AppearanceTab.luaDragonToast_Options/Tabs/DisplayTab.luaDragonToast_Options/Tabs/FiltersTab.luaDragonToast_Options/Tabs/GeneralTab.luaDragonToast_Options/Tabs/ProfilesTab.lua
Summary
Reverts the UPPER_SNAKE_CASE locale key convention (from
bdc09db) back to standard AceLocale format where English text serves as the key (L["English text"] = true). This aligns with the broader addon ecosystem and unblocks PR #143 (zhCN translations).Changes
L["Font"])L["SNAKE_KEY"]references updated toL["English text"]max_line_length = falseoverrideTesting
luacheck .passes with 0 warnings, 0 errors/dt test,/dt config, verify all option labels render correctlySummary by CodeRabbit