P
Phil Tomson
I'm developing a GUI app using Ruby and FLTK. One of the requirements
that's come up lately is that this app should be 'localizable'. I'm trying
to figure out approaches for doing this as I design the app.
The approach I'm thinking of is to have some seperate file, maybe in XML,
that would contain all of the text which is used for things like button
labels, output messages, etc. Then to support different languages all the
customer would have to do is include a different language specific file.
These files might look something like:
<ButtonLabels>
<Next>
"Next->"
</Next>
<Cancel>
"Cancel"
</Cancel>
<Back>
"<-Back"
</Back>
<Login>
"Login"
</Login>
<Register>
"Register"
</Register>
</ButtonLabels>
<ErrorMessages>
<LoginFailed>
"Could not log into the server! Please check your proxy configuration"
</LoginFailed>
</ErrorMessages>
So, if they wanted to make a Japanese version of the app, they would
replace each of the strings above with their Japanese counterparts.
While it seems a bit heavy, I'm thinking an XML approach would be good for
a couple of reasons:
1) this localization will probably be taking place long after I'm gone
(this is a contract job) and XML is widely known and understood.
2) it's easy to extract data from it using REXML
Does this seem like a reasonable approach?
Has anyone used alternate approaches?
Phil
that's come up lately is that this app should be 'localizable'. I'm trying
to figure out approaches for doing this as I design the app.
The approach I'm thinking of is to have some seperate file, maybe in XML,
that would contain all of the text which is used for things like button
labels, output messages, etc. Then to support different languages all the
customer would have to do is include a different language specific file.
These files might look something like:
<ButtonLabels>
<Next>
"Next->"
</Next>
<Cancel>
"Cancel"
</Cancel>
<Back>
"<-Back"
</Back>
<Login>
"Login"
</Login>
<Register>
"Register"
</Register>
</ButtonLabels>
<ErrorMessages>
<LoginFailed>
"Could not log into the server! Please check your proxy configuration"
</LoginFailed>
</ErrorMessages>
So, if they wanted to make a Japanese version of the app, they would
replace each of the strings above with their Japanese counterparts.
While it seems a bit heavy, I'm thinking an XML approach would be good for
a couple of reasons:
1) this localization will probably be taking place long after I'm gone
(this is a contract job) and XML is widely known and understood.
2) it's easy to extract data from it using REXML
Does this seem like a reasonable approach?
Has anyone used alternate approaches?
Phil