HarryCutts / Consolid8

A World of Warcraft add-on for filtering and summarising voluminous chat messages
0 stars 0 forks source link

Locale format strings with parameter index specifiers break regex converter #1

Open HarryCutts opened 9 years ago

HarryCutts commented 9 years ago

WoWInterface user Baine reports:

got this error while skilling:

Message: Interface\AddOns\Consolid8\Consolid8.lua:158: invalid capture index
Time: 01/23/15 19:51:38
Count: 3
Stack: [C]: in function `match'
Interface\AddOns\Consolid8\Consolid8.lua:158: in function `filterFunc'
Interface\FrameXML\ChatFrame.lua:2916: in function `ChatFrame_MessageEventHandler'
Interface\FrameXML\ChatFrame.lua:2700: in function `ChatFrame_OnEvent'
[string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1>

Locals: (*temporary) = "Eure Fertigkeit 'Lederverarbeitung' hat sich auf 700 erhöht."
(*temporary) = "Eure Fertigkeit '%1$s' hat sich auf %2$d erhöht."

the string "Eure Fertigkeit 'Lederverarbeitung' hat sich auf 700 erhöht." is the usual message about a skill being raised, don't know the english equivalent right now

From Baine's comment, it appears that CreateHybridPattern is not recognising the placeholders in the format string because they have parameter index specifiers (%1$s rather that %s).

HarryCutts commented 9 years ago

Commit 26fd1d2 on branch locale-fix attempts to solve this issue, but has not yet been tested in WoW.