Ini file groups and items

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Eva.Isotalo
Posts: 6
Joined: Sat Jun 13, 2015 4:21 pm

Ini file groups and items

Post by Eva.Isotalo » Sun Jul 05, 2015 4:42 pm

I'm used from another program environment to use ini files which are very convenient for my needs. The 'groups' and 'items' are easily accessible.
I can't find any info about how to use ini files and groups and items in LiveCode besides the "read from file" and similar.

If unclear, this is what I mean about groups and items:
[NameFld]
SE = "Namn"
EN = "Name"
FI = "Nimi"
----------------
For example, one simply specify the group and "call" the item number and you will have the content of that item. And because it is an external file it is easy to add and change text/languages/etc.

There is an addon from 2009 called iniEngine should I use this with the latest LC (7.0.3, build 10026)?

Any suggestions and advice much appreciated.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Ini file groups and items

Post by jacque » Mon Jul 06, 2015 6:00 pm

Typically language translations are stored as custom property sets of a stack. You can either store the property sets permanently, or read in a file when the stack opens and populate the property set with the contents of the file when the app opens. Then the correct property set is used to loop through all menus and object labels and set them to the user's language.

The only automatic way to do it is to use LC's "profiles" option. This requires some setup during development but allows you to set the correct language (or any other options) easily after that. However, profiles are a permanent part of the stack and don't typically use external text files, though there is probably a way to script that. I don't use profiles, so I have no experience with them.

I don't know of any other methods.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply