Android Question Map Text File

Yvon Steinthal

Active Member
Licensed User
Longtime User
Hello,

I am currently translating my app between french and english. I have decided to make a MAP type to store the key in english and the value in french using File.ReadMap from text file.

It works when there are no spaces such as: Local=Localisation

However if i do : No client=Pas de client

My map looks like this: No=client=Pas de client

Help?

Y.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

udg

Expert
Licensed User
Longtime User
Hi,
it depends on how the Properties file format is defined in java.
"The key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped '=', ':', or white space character other than a line terminator. All of these key termination characters may be included in the key by escaping them with a preceding backslash character; for example,
\:\=
would be the two-character key ":="


So, in your case, I guess you should use "No\ client" for the key.

udg
 
Upvote 0

Yvon Steinthal

Active Member
Licensed User
Longtime User
Thanks guys i will check udg's solution as the xml way won't work for my b4i app, trying to save time as im developping an app in b4a and b4i at the same time...
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
Thanks guys i will check udg's solution as the xml way won't work for my b4i app, trying to save time as im developping an app in b4a and b4i at the same time...

I' m doing it too. To facilitate the creation of maps file I used excel.

Something like that:

(Col1) key:-----------(col2) en_us-----------(Col3) es_es
helloworld-------------Hello World!------------Hola Mundo!

And I created a macro vb to export the keys and texts.

Simple but it works.
 
Upvote 0
Top