Question About ftLocalization

9 views
Skip to first unread message

Eiloreen

unread,
Jul 7, 2013, 4:32:52 AM7/7/13
to fantom...@googlegroups.com
Hi Michael I have little question about the ftLocalization class.

The ftObject supports multiline showing text adding the ~n Tag, but in the file where we have our text have any Tag like that
to pass the jump line?

something like

key;EN:Some text in one line [TAG] Text in the next Line.

Thanks and good job.

I actualy calling two o more keys in the ftObject adding the +"~n" to solve this.

Michael Hartlef

unread,
Jul 7, 2013, 8:52:17 AM7/7/13
to fantom...@googlegroups.com
So you have multiline text that needs to be localized, right? Let me think about that.

Michael Hartlef

unread,
Jul 7, 2013, 8:54:05 AM7/7/13
to fantom...@googlegroups.com
Can you provide such a file?

Michael Hartlef

unread,
Jul 7, 2013, 9:07:37 AM7/7/13
to fantom...@googlegroups.com
Ok, I think I got what you need. Sadly this needs a change in the total formatting of the items:

Replace the LoadFromString method with this:


'------------------------------------------

'changes:Changed in v1.52 to support multipline text. The text has to be formated differently

#Rem

'summery:This method loads the localization class via a string

'The format of the string has to be (key%;%LanguageShortCut1%:%Translation1%;%...):

'Play%;%DE%:%Spielen

'Options%;%DE%:%Optionen

'Help%;%DE%:%Hilfe

'MultiLine%;%DE%:%Dieser Text%LF%erscheint in 2 Zeilen

#End

Method LoadFromString:Void(locStr:String)

'Local lines := locStr.Split(String.FromChar(10))

Local lines := locStr.Split("~n")

For Local line:= Eachin lines

If line = "" Then Continue

'Local ct$[] = line.Split(";")

Local ct$[] = line.Split("%;%")

Local keyStr:String = ct[0].ToLower()

For Local i:Int = 2 To ct.Length()

'Local valStr$[] = ct[i-1].Split(":")

Local valStr$[] = ct[i-1].Split("%:%")

Local lang:String = valStr[0].ToLower()

Local value:String = valStr[1]

value = value.Replace("%LF%","~n")

Self.strMap.Set(lang+keyStr,value)

Next

Next

#Rem

For Local item := Eachin Self.strMap

Print item.Key()

Print item.Value()

Next

Print("---------------------")

#End

End






Eiloreen

unread,
Jul 7, 2013, 11:45:22 AM7/7/13
to fantom...@googlegroups.com
Thanks your are the best xDDD

Waiting for your next book xD

Michael Hartlef

unread,
Jul 7, 2013, 12:18:11 PM7/7/13
to fantom...@googlegroups.com
LOL, thanks. I don't think I will write one soon.
Reply all
Reply to author
Forward
0 new messages