View Single Post
06-24-15, 11:59 AM   #8
rowaasr13
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: Jun 2007
Posts: 27
Originally Posted by Seerah View Post
Or (if you really really want separate files per locale) you can put in a return at the top of the file. So, even if it loads the file, it won't compile the code unless it's the correct locale.

Lua Code:
  1. if GetLocale() ~= "enUS" then
  2.      return
  3. end
Err... no. It certainly WILL compile entire file - chunks are always read and compiled completely and returned to reader and only THEN reader runs resulting code, performs check and bails out of it with return. So the only thing you're saving is object/function/closures instantiation and any run time that might be spent on any heavy loops if you have some bulk processing in your locale files.
  Reply With Quote