ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   For users of $(language).lua (https://www.esoui.com/forums/showthread.php?t=2219)

Ayantir 09/10/14 04:04 AM

For users of $(language).lua
 
Hello,

Little trick for Addon authors who use this trick to localize your strings. Cause some gamers have made a russian translation for the game, some addons won't load if in your manifest you try to load $(language).lua

the reason is because $(language).lua = "ru" and you don't have a ru.lua in your addon.

You could add a ru.lua with english strings as exemple. but a nice trick is to put in your manifest :

Code:

path/lang/en.lua
path/lang/$(language).lua

And your addon is now safe from russian / turkish / spanish / italian / brazilian / whatever country hackers

Seerah 09/10/14 06:17 PM

Just to clarify, the reason is because the en.lua file will load with the English translations. If a different localization is present instead, it will either a) load the appropriate file and override the English strings, or b) not load a Lua file at all, leaving the English strings in memory.

Halja 09/11/14 12:37 PM

You are not limited to just string lists. It is choosing what lua file(s) to load. You can have more than one too. It is just doing a string concatenation for the file name before loading.

So, you can use that as part of an incremental rollout step and merge into main when full language support is ready. Or maybe you just want some special feature loaded for a specific language. Using the language variable is a way so the lua code only load for it. This may be fringe cases for most but your suggestion could break the add-on in a different way than just because the end-user is running a ZOS unsupported language. If they want hack to another language, than they can modify the add-on’s manifest manually. :D
--Halja


All times are GMT -6. The time now is 09:59 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI