Thread Tools Display Modes
09/10/14, 04:04 AM   #1
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
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
  Reply With Quote
09/10/14, 06:17 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 648
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.
  Reply With Quote
09/11/14, 12:37 PM   #3
Halja
 
Halja's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 111
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.
--Halja
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » For users of $(language).lua

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off