t-mart / ItemVersion

ItemVersion adds information to your tooltip about when an item was added to World of Warcraft.
https://www.curseforge.com/wow/addons/itemversion
GNU General Public License v3.0
9 stars 8 forks source link

ItemVersion: Missing entry for 'World of Warcraft' .. Again .. And again .. #52

Closed Hollicsh closed 1 year ago

Hollicsh commented 1 year ago

What is your client flavor? (Retail, Wrath, or Classic)

Retail (10.0.2.46879)

What version of ItemVersion do you have installed?

2022.48.1

What platform are you playing on? (Windows, Mac, or Linux)

Windows

What is the bug? And, what should happen instead?

Missing entry for 'World of Warcraft'

Steps To Reproduce

  1. I go into the game world.
  2. Immediately I see this error.

Additional context

1x AceLocale-3.0-6: ItemVersion: Missing entry for 'World of Warcraft' [string "@ItemVersion/Tooltip.lua"]:57: in function <ItemVersion/Tooltip.lua:42>

[string "@ItemVersion/Options.lua"]:25: in function <ItemVersion/Options.lua:9> [string "@ItemVersion/Options.lua"]:239: in function <ItemVersion/Options.lua:68> [string "@ItemVersion/Options.lua"]:258: in function `New' [string "@ItemVersion/Init.lua"]:13: in function <ItemVersion/Init.lua:7>

[string "@ElvUI_Libraries/Core/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:66: in function <...UI_Libraries/Core/Ace3/AceAddon-3.0/AceAddon-3.0.lua:61> [string "@ElvUI_Libraries/Core/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:494: in function `InitializeAddon' [string "@ElvUI_Libraries/Core/Ace3/AceAddon-3.0-13/AceAddon-3.0.lua"]:619: in function <...UI_Libraries/Core/Ace3/AceAddon-3.0/AceAddon-3.0.lua:611>

t-mart commented 1 year ago

Hey @Hollicsh,

I think you may be using some out of date files because this string World of Warcraft has not been present in the code since 1f1601e58a66143a2ff7e339f9f4fd4dda4be990 in August.

Maybe you have old development files around?

Hollicsh commented 1 year ago

Hey ! Old addon files or the game itself ? If addon, then I completely deleted all folders and partitions and installed the addon from scratch.

t-mart commented 1 year ago

Ah, ok, I understand what's happening. Sorry!

Bug

The bug is that the code on these lines is erroneously performing two translations/locale lookups.

On those lines, we say:

expacName = L[expac.shortName]

But, expac.shortName is already translated:

  [1] = { canonName = L["Classic"], shortName = L["Classic"] },
  [2] = { canonName = L["The Burning Crusade"], shortName = L["TBC"] },
  [3] = { canonName = L["Wrath of the Lich King"], shortName = L["WotLK"] },
  -- and so on ...

And, for some of the expac's, we use a translation like:

L["Classic"] = EXPANSION_NAME0
L["The Burning Crusade"] = EXPANSION_NAME1
L["Wrath of the Lich King"] = EXPANSION_NAME2

(The uppercased constants come from the GlobalStrings files, and offer translations for every locale. For example, here's English's and Russian's).

This boils down to, for example:

-- as in code
L[expac.shortName]
-- but, this is actually a double translate
L[L["Classic"]]
-- which is the same as
L[EXPANSION_NAME0]
-- which, for Russian, is the same as
L["World of Warcraft"]

This fails because we have not written a translation for the already-translated string, "World of Warcraft".

Fix

All we need to do is not double translate:

- expacName = L[expac.shortName]
+ expacName = expac.shortName

I will fix this now and cut a new release within an hour.

t-mart commented 1 year ago

Try this release: https://www.curseforge.com/wow/addons/itemversion/files/4166697