improved-stacker icon indicating copy to clipboard operation
improved-stacker copied to clipboard

Localization errors when language isnt found

Open wrefgtzweve opened this issue 2 years ago • 4 comments

Getting these serverside

addons/improved-stacker/lua/improvedstacker/localify.lua:157: Invalid language provided ('es-es')
   1.  unknown - [C]:-1
    2.  error - [C]:-1
     3.  L - addons/improved-stacker/lua/improvedstacker/localify.lua:157
      4.  LeftClick - addons/improved-stacker/lua/weapons/gmod_tool/stools/stacker_improved.lua:704
       5.  unknown - gamemodes/sandbox/entities/weapons/gmod_tool/shared.lua:226

Also happens for https://github.com/Mista-Tea/improved-weight, not sure if i should create a duplicate issue for it.

wrefgtzweve avatar Feb 28 '23 14:02 wrefgtzweve

Hey there, @Mista-Tea

It seems like according to Gmod specks the Spanish language is not coded es but instead es-es, which differs than the localization key of the library: https://wiki.facepunch.com/gmod/Addon_Localization

Pull request that attempts to fix this: https://github.com/Mista-Tea/improved-stacker/pull/45

Maybe it is better to use a properties file. I've wrote a detailed tutorial in the wiki link provided. ( Currently used in TA for gmod_language )

dvdvideo1234 avatar Feb 28 '23 17:02 dvdvideo1234

Here is an example for English: stacker_improved.txt

dvdvideo1234 avatar Mar 01 '23 07:03 dvdvideo1234

Sorry for the delay! I will try to look at this soon. I think I had fixed it in Improved Weight's version of Localify, or maybe the Localify repo itself, but haven't updated the hardcoded copies in stacker.

Mista-Tea avatar Mar 03 '23 23:03 Mista-Tea

Shouldn't be better to register the library as a sub module then assuming will be easier? With that way the copy will always get updated. They just stay as a pointer to another repo. I will be using it for my wire wrapper module ;)

https://github.blog/2016-02-01-working-with-submodules/

Looks like that ( folder named rock @ #HASH ):

image

dvdvideo1234 avatar Mar 06 '23 09:03 dvdvideo1234