[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: String access & metamethods
- From: "Eric Tetz" <erictetz@...>
- Date: Thu, 13 Dec 2007 08:37:07 -0800
On Dec 13, 2007 6:35 AM, Brett Kugler <firstname.lastname@example.org> wrote:
> First I have stringent memory limits I must stay within. My concern with
> creating new variables for each string would be that my heap burden would
> grow significantly.
If that's a concern then you don't want to have every translation in
memory at the same time, as all the schemes we've been playing around
with have done.
The real KISS approach is just to load a file like:
if language == "German" then
DidNotWork = "Operasie het nie geslaag nie"
NoAnswer = "Antwoord nie gefind nie"
elseif language == "Martian" then
DidNotWork = "Pqfsbtjf!ifu!ojf!hftmbbh!ojf"
NoAnswer = "Bouxppse!ojf!hfgjoe!ojf"
else -- default to English
DidNotWork = "Operation did not succeed"
NoAnswer = "No answer found"
language = "German"
Then you have *one* set of text and some relatively short identifier
names loaded in memory.