[Bug] Localization Error
Starlynk1 opened this issue ยท 9 comments
Getting this error that appears to be from a spelling error in the file.
Changed line 23 to _index instead of __index
`2x Deathlog/Localization/localization.lua:23: C stack overflow
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
...
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@Deathlog/Localization/localization.lua"]:23: in function <Deathlog/Localization/localization.lua:22>
[string "@MoveAny/libs/db.lua"]:684: in function <MoveAny/libs/db.lua:679>
Locals:
table =
death_alert_default_fall_message = " the fell to
death at lvl in ."
death_alert_default_fire_message = " the has died from fire.
at lvl in ."
death_alert_font = "Fonts\blei00d.TTF"
death_alert_default_slime_message = " the has died from slime.
at lvl in ."
of_word = "of"
death_alert_default_message = " the has been slain
by
I'm just an amateur at this whole coding thing, so I removed the extra _ from the line and no more bugsack errors. Does the localization still work? Not really sure, I use english locale, but maybe I can switch to another language and see. Thanks for checking.
The issue is that MoveAny is going through all the global variables and checking their GetPoint Key (which wouldn't exist) but the localization code in our repo has a default mechanism. Removing the _, effectively removes that mechanism. @jhj0517 is there risk if we remove the default?
@Starlynk1 I tried to test on the English client but could not reproduce the same error.
Can you give me more details on how you fixed the bug by removing the _
?
To reproduce 1) use commit 56058c0 (current master as of posting) and run MoveAny https://www.curseforge.com/wow/addons/moveany
On the same topic @jhj0517 , any issue with changing the localization variable L
to Deathlog_L
? I'm worried about other collisions as well
honestly not sure, I just saw that the _index line on localization.lua line 23 had two underscores. I've not seen that before (again, not a good coder person) so removed what looked to me like 1 too many underscores. That resolved the bugsack error, but not sure if the localization still works since I use english locale.
To reproduce 1) use commit 56058c0 (current master as of posting) and run MoveAny https://www.curseforge.com/wow/addons/moveany
I'll look into it. Thanks.
On the same topic @jhj0517 , any issue with changing the localization variable L to Deathlog_L? I'm worried about other collisions as well
It would definitely be better to use something like Deathlog_L
.
honestly not sure, I just saw that the _index line on localization.lua line 23 had two underscores. I've not seen that before (again, not a good coder person) so removed what looked to me like 1 too many underscores. That resolved the bugsack error, but not sure if the localization still works since I use english locale.
yeah its just some interesting lua syntax for metatables
https://www.lua.org/pil/13.4.1.html