Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: The release version doesn't include locales #1

Open
maqjav opened this issue May 31, 2023 · 9 comments
Open

[BUG]: The release version doesn't include locales #1

maqjav opened this issue May 31, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@maqjav
Copy link

maqjav commented May 31, 2023

WoW client

WoW Retail

What happened?

Hello!
I downloaded the ZIP released in github and curseforge, and the latest version doesn't include localizations, the LUA file is empty.

do
	local L = lib.countryLocalizedNames;
	if LOCALE_deDE then

	elseif LOCALE_esES then

	elseif LOCALE_esMX then

	elseif LOCALE_frFR then

	elseif LOCALE_itIT then

	elseif LOCALE_koKR then

	elseif (LOCALE_ptBR or LOCALE_ptPT) then

	elseif LOCALE_ruRU then

	elseif LOCALE_zhCN then

	elseif LOCALE_zhTW then

	end
end

Cheers.

Lua Error Message?

No response

Other addons?

No response

@maqjav maqjav added the bug Something isn't working label May 31, 2023
@hizuro
Copy link
Member

hizuro commented Jun 1, 2023

That depends on the localization page on curseforge.
113 Entries and 0% translated into other languages.

:-/

@maqjav
Copy link
Author

maqjav commented Jun 1, 2023

Maybe it doesn't use the english values by default?
I'm getting a report of someone playing in french that is getting this error:

6x ...RareScanner/ExternalLibs/LibTime-1.0-35/LibTime-1.0.lua:94: attempt to index field 'countryLocalizedNames' (a nil value)
[string "@RareScanner/ExternalLibs/LibTime-1.0-35/LibTime-1.0.lua"]:94: in function `?'
[string "@RareScanner/ExternalLibs/LibTime-1.0-35/LibTime-1.0.lua"]:127: in function <...RareScanner/ExternalLibs/LibTime-1.0/LibTime-1.0.lua:125>
[string "=[C]"]: ?

He says that replacing the library included in my addon with the library included in Broker_Everything, that apparently includes all the traslations, fixes the issue.

You can read the whole thread here.

Cheers.

@hizuro
Copy link
Member

hizuro commented Jun 1, 2023

I see the problem in event execution. The code around line 94 should only be executed one time. I don't know why event VARIABLES_LOADED is trigger multible. I move the part to PLAYER_LOGIN and remove the "lib.countryLocalizedNames = nil". That should avoid the error.

I see no reason to copy&paste the version from Broker_Everything. It does not contains localized county names too. Or do you have another source of Broker_Everything? Offical sources are Github, Curseforge, WoWInterface and Wago.io.

Some years ago i've found modified versions on korean websites with completed korean localization and added it to my version of Broker_Everything. ;-)

@maqjav
Copy link
Author

maqjav commented Jun 2, 2023

Hello!
Great! I will give it a shot.

The version of Broker_Everything published in Curseforge includes translations in german, french, russian, korean and chinesse (it's missing spanish, italian and portuguese). And the idea of replacing my version with that one is because the user that plays in french that reported the error confirms that with those strings it works.

My addon doesn't use those translations at all, but I assume that like the game is loading my version (because RareScanner comes after Broker), the user might be getting the error because Broker_Everything probably requires them.

Cheers

@maqjav
Copy link
Author

maqjav commented Jun 2, 2023

I haven't developed a library before so I'm not sure how they instantiate, but maybe like this user has 2 addons that includes the library, is it possible that each addon triggers that event?, once with Broker_Everything, and once with RareScanner, finding the nil table in my case because Broker_Everything set it to nil before.

Your change should work anyway ;)

@hizuro
Copy link
Member

hizuro commented Jun 2, 2023

Oh 🤦 Now i've saw it. But that was the wrong localization entries. The lib in Broker_Everything has localization entries from Broker_Everything and not from LibTime.

I still have to change that. :-/

hizuro added a commit that referenced this issue Jun 2, 2023
@maqjav
Copy link
Author

maqjav commented Jun 3, 2023

Apparently the version r36 is still crashing.

This is the new log:

2x ...RareScanner/ExternalLibs/LibTime-1.0-36/LibTime-1.0.lua:98: attempt to index field 'countryLocalizedNames' (a nil value)
[string "@RareScanner/ExternalLibs/LibTime-1.0-36/LibTime-1.0.lua"]:98: in function `?'
[string "@RareScanner/ExternalLibs/LibTime-1.0-36/LibTime-1.0.lua"]:127: in function <...RareScanner/ExternalLibs/LibTime-1.0/LibTime-1.0.lua:125>
[string "=[C]"]: ?

I don't know if maybe these users have several addons with the same library and something is messed up.

@maqjav
Copy link
Author

maqjav commented Jun 3, 2023

I could reproduce the error installing Broker_Everything 4.5.10 and RareScanner (and loading the game in spanish).
I guess that the old code in Broker_Everything is still setting countryLocalizedNames to nil, so you have to take into account that if other addons are using the same library, the problem will show up.

In the meantime I'm going to add a fix to the library in my addon so I can release a working version, otherwise users are going to be very mad ;)

EDIT: I attached my fix, but I'm sure you can do it better (LibTime-1.0.lua.zip) ;)
I also added the spanish translations to your site so you can add them if you want.

@hizuro
Copy link
Member

hizuro commented Jun 4, 2023

Broker_Everything get the new version with next update. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants