The simplest way without external libraries:
//strings.h
enum { LANG_EN_EN, LANG_EN_AU }; enum { STRING_HELLO, STRING_DO_SOMETHING, STRING_GOODBYE };
//strings.c
char* en_gb[] = {"Well, Hello","Please do something","Goodbye"}; char* en_au[] = {"Morning, Cobber","do somin'","See Ya"}; char** languages[MAX_LANGUAGES] = {en_gb,en_au};
This will give you what you want. Obviously, you could read the lines from the file. I.e.
//en_au.lang
STRING_HELLO,"Morning, CObber" STRING_DO_SOMETHING,"do somin'" STRING_GOODBYE,"See Ya"
But you will need a list of line names to match the line names. i.e.
//parse_strings.c
struct PARSE_STRINGS { char* string_name; int string_id; } PARSE_STRINGS[] = {{"STRING_HELLO",STRING_HELLO}, {"STRING_DO_SOMETHING",STRING_DO_SOMETHING}, {"STRING_GOODBYE",STRING_GOODBYE}};
The above should be a little easier in C ++, since you could use the enum classes for the toString () method (or whatever it may be - can't be bothered with finding it).
All you have to do is analyze the language files.
Hope this helps.
PS: and to access the lines:
languages[current_language][STRING_HELLO]
PPS: apologies for half the answer C ++ C ++.