WoW BlueTracker Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
Poster: Rel at 9/26/2005 9:05:45 AM PDT
Subject: XML request: Dynamically generated filenames.
   Okay, the subject is a bit misleading, but there wasn't much I could do with the available space :-(

What I'm trying to do is split my string localisation across multiple files: one file per locale.

Predictably, I'd like to be able to load the file up as follows:

<Script file="'MyMod_Strings_' .. strtoupper (GetLocale ()) .. '.lua'"/>


Then have the localisation strings defined in files called:

MyMod_Strings_USEN.lua

MyMod_Strings_FRFR.lua
MyMod_Strings_DEDE.lua


And so on. Obviously only one of those files is going to get loaded into memory - preferably the one that corresponds to our current locale :-P

This is basically to avoid loading every single localisation string for every single locale into memory at once, considering only a fraction of them are going to actually get used...

Now perhaps the dynamic string isn't the best way to go about it (or maybe it's just not possible, to rework the XML parser to the extent nessecary to allow it). Maybe we could have something like:

<Script file-locale="MyMod_Strings_$L.lua"/>


Just a thought.

Possibly the only real hurdle would be figuring out a way to designate a default locale file to load when the desired one doesn't exist.

---------

How about this:

File list:
MyMod_Strings.lua

MyMod_Strings-deDE.lua
MyMod_Strings-zhTW.lua


XML:
<Script file="MyMod_Strings.lua" loadbylocale="true"/>


Say you're French. The "loadbylocale" bit automatically attempts to concatenate the string "-frFR" to the filename, and thus WoW tries to load the file "MyMod_Strings-frFR.lua" - but that file doesn't exist. So instead, it defaults back to standard behaviour for a <Script file=""/> block and tries to load the file "MyMod_Strings.lua", which should obviously be there).

Thoughts? Suggestions? Rotten tomatoes?
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=228103&p=#post228103
 
Poster: slouken at 9/26/2005 8:57:11 PM PDT
Subject: Re: XML request: Dynamically generated filena
   And just so you know, there _is_ a garbage collection pass done after everything loads.
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=228103&p=#post228817
Poster: slouken at 9/26/2005 9:00:47 PM PDT
Subject: Re: XML request: Dynamically generated filena
   I don't believe so (to minimize framerate hit)
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=228103&p=#post228819

View all recent official Blue Posts

WoW Blue Tracker: Archiving World of Warcraft Blue Posts
since March 2005
Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
 

Why Ads?