Home | Gallery | Forum | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com Forum
OS2 World.Com Online Discussion Forum.
Index / WebSite Information / Comments, Suggestions & Questions
author message
Supporting languages in applications
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
Kim
Team member
in staff

View this member's profileSearch all posts from this memberSend an email to this memberhttp://www.haverblad.se
posts: 2128
since: 10 Dec, 2000
1. Supporting languages in applications
Reply to this topic with quote Modify your message
Post your comments and questions about this article !!!

Check the article here.

Date: 05 May, 2004 on 22:28
Radek
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 121
since: 17 Jul, 2003
2. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
IMO, the cleanest solution is using language specific DLLs. Creating a "pure resource" DLL is extremely simple under OS/2, therefore, let us create a DLL, which contains only strings needed for displaying messages (button texts, etc.) in the particular language. The app will link the needed DLL and get the needed strings by means of their IDs.
Advantages:
1. Adding a support for a new language equals to creating a new language DLL. No need to patch the app. No "german versions" etc.
2. It's even possible to change the language "on fly" when the app is running.
Disadvantages:
1. It needs a strong self control from the programmer EACH text, including the simplest one, must be taken from the DLL.
Date: 06 May, 2004 on 11:14
Chris W.
Premium member
in spoc

View this member's profileSearch all posts from this memberSend an email to this memberhttp://www.os2world.com/cdwriting
posts: 24
since: 14 May, 2002
3. Re:Supporting languages in applications
Reply to this topic with quote Modify your message

Radek (06 May, 2004 11:14):
IMO, the cleanest solution is using language specific DLLs. Creating a "pure resource" DLL is extremely simple under OS/2, therefore, let us create a DLL, which contains only strings needed for displaying messages (button texts, etc.) in the particular language. The app will link the needed DLL and get the needed strings by means of their IDs.

Keep in mind that strings are limited to 256 bytes length.

Regards Chris

Date: 07 May, 2004 on 09:37
Bernhard Schornak
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://schornak.bei.t-online.de
posts: 4
since: 21 Jun, 2002
4. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
Hi all!


Have a look at this:

http://st-open.de/prog/pgms/st5xx/index.htm

(use the SourceDoc link to get detailed information).

Maybe we had the same thoughts about simplifying some time (and resource) consuming stuff? The ST-system offers a database engine (entirely written in assembler) with 7 data types (byte, word, dword, qword, fixed length data and two string formats). Theoretical limitations are 2e32 Fields with up to 32 SubFields, each Field can be up to 4GB in size. The physical limitation is the size of the memory you can allocate, because a Field must be loaded into RAM before it can be used (speeds up access, also neccessary for garbage collection).

Languages can simply be implemented by exchanging Fields with strings in different languages or using SubFields (would allow to store 32 different languages and select them "on the fly").

The entire system library (~200 functions, incl. memory management, etc.) is 52.736 bytes in size, you only have to link it with your application (size will shrink, it includes two versions of the database engine at the moment).

Porting isn't a big challenge, there are few OS or compiler dependent calls (I use wrappers for most of my calls).


Greetings from Augsburg

Bernhard Schornak

Date: 16 May, 2004 on 14:59
Kim
Team member
in staff

View this member's profileSearch all posts from this memberSend an email to this memberhttp://www.haverblad.se
posts: 2128
since: 10 Dec, 2000
5. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
Open question here, but I know that there earlier was thoughts about creating tools to build a lib with the basic translation needed for utilities and tools. Did that just stay as thoughts or was there anything done?
Date: 18 May, 2004 on 08:36
Jan-Erik
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://www.xn--lrka-loa.com
posts: 27
since: 15 May, 2003
6. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
Another aspect of multi language support is to look at the translation part and we can hopefully find a solution that can help both the programmer AND the translator.

I can hopefully handle the words and text, but may have problems to set up all those different compilers and tools required. There are just as many different "solutions" to handle the translation now as there are developers/programmers.

e.g. I'd like to translate eCS to my language... start counting from there.

I'd also would like to see a solution for e.g. Help-files and documentation etc. too while you're at it

Slightly off topic but...
For me as a "translator", it would be most convenient to either use a text-file or a database preferrably as (dbf) and either hand over the work to the developer to adopt/convert it to fit his/her needs or just use it as it is. A common standard would be appreciated by me.

There are times when I just want to write a tool that can handle translations so I don't have to bother with format etc. and other times when UNL http://www.undl.org/ look interesting.

UNL: Universal Networking Language
Sender "enconvert" a text (e.g. English) into logical expressions that the reciever "deconvert" into his/her own language (e.g. German). The project started in 1997 and they expected it to finish by 2005 for the major languages, but they are a bit behind schedule at the moment as it seems.

---
//Jan-Erik

Date: 03 Jun, 2004 on 16:57
ecs1
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 5
since: 07 Jul, 2004
7. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
Sounds like a good idea. Now where can I find MSGC and sprintmsg?
Date: 07 Jul, 2004 on 17:50
ecs1
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 5
since: 07 Jul, 2004
8. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
Found it. It's here:

ftp://hobbes.nmsu.edu/pub/os2/dev/util/msgc.zip

Date: 12 Jul, 2004 on 17:40
Nathan
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this member
posts: 1
since: 08 Feb, 2005
9. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
I write GetYourNews posted on HOBBES. I put all strings in a resource file. I've had no problem finding people on the internet to translate the resource file for me. Ask and ye shall receive.

The very first thing the program does is check the environment for the language. Then, I load the specific resource file. If no resource file is loaded, WinLoadString defaults to the resource file compiled in(English). Right now it supports German, Italian, Spanish and soon Portuguese. If anyone else wants to do a translation for me, all I have to do is send them the resource and then they send me one back translated.

It is done... no fuss or mess. You can even do dialogs the same way.

Nathan Woodruff

Date: 08 Feb, 2005 on 23:37
Cornelis B.
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://home.datacomm.ch/cbockem
posts: 4
since: 07 Feb, 2005
10. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
I also switched to using ressource dlls a while ago for my astronomy software. Main advantage: It is easily supported by system functions and if you want you can include other ressources than just strings (but I only use strings at the moment). In theory you could even translate to DBCS languages that way.

However, the last published release of my astronomy stuff (see http://home.datacomm.ch/cbockem) still uses MSG files. At that time I considered generating them "easiser" than generating ressource dlls - which I realize is not true. Anyway there are also advantages with these MSG files: You can define strings like

"Error occurred while reading file %1 for data input"

and the %1 will be replaced by the appropriate system function call with the file name (you provide). This is handy in many cases, so I wrote my own set of functions handling that also for ressource strings (together with loading the correct dll which is not that simple as it looks like: first search the explicit settings in the project INI file, then the environment variable LANG, then see whether a DLL exists or not, and if not try to find an english language DLL, and if even that is missing issue a "default error message" and terminate).

I am sure every programmer working with the one or other language support system would write its own set of functions for that purpose! Otherwise it still gets too complicated.

Date: 09 Feb, 2005 on 09:11
aaronlawrence
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://aaronlawrence.fastmail.fm/
posts: 8
since: 09 Feb, 2005
11. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
When I was making NewView multi-lingual, I decided on the following goals:

a) Load languages at runtime, reasonably fast
b) Be human editable, so that people can contribute without
any tools required or even contacting the author
c) Be able to update an existing language file with missing
items to avoid manual tracking of which strings have
been translated
d) Minimal specific code

b and c are to encourage open source contributions, and are the parts that influenced me to do something different.

For example, building a resource DLL is not something that the average user would even think about, without quite a bit of hand-holding - and they also have to try and find a compiler, linker and resource compiler.

So I built my own method, which uses plain text files, as you can see in the newview and ae distributions. This means any person can create a translation without needing to contact me at all or get any new tools.

Basically I just map a name to a string. I don't have substitution; this is certainly a weakness but nobody has really complained yet (probably because I don't composite many strings, being a GUI).

Some programmers would have a heart attack at the thought of doing string comparisons to look up translations, but it doesn't add any noticeable delays for a few UI lookups. Anyway it has a binary tree search.

I was aided considerably by the runtime type information stored by Sibyl. This lets me load up most of the UI automatically from the names of controls stored internally. Of course you can do this with resource files, but not with changing language at runtime AFAIK.

The update of existing files is pretty much a unique feature, like a built in diff. I couldn't bear the thought of manually telling translators the modifications in each version. This is possibly overkill, but it works now

Basically it has served me well enough and people have contributed many translations without too much fuss.

Date: 09 Feb, 2005 on 16:25
aaronlawrence
Normal member
in user

View this member's profileSearch all posts from this memberSend an email to this memberhttp://aaronlawrence.fastmail.fm/
posts: 8
since: 09 Feb, 2005
12. Re:Supporting languages in applications
Reply to this topic with quote Modify your message
last updated at 09 Feb, 2005 16:34 (1 times)
If you want more details, see
http://aaronlawrence.fastmail.fm/Design.txt
(look for the section "Multi-lingual Support")

and here is an example language file
http://aaronlawrence.fastmail.fm/newview_de.lng.txt

Another downside is the duplication of e.g. OK buttons...

Date: 09 Feb, 2005 on 16:33
Supporting languages in applications
Post a new topic Reply to this Topic Printable Version of this Topic Forward this Topic to your Friend Topic Commands (for administrator or moderators only)
All times are CET+1. < Prev. | P. 1 | Next >
Go to:
 

Powered by UltraBoard 2000 Standard Edition,
Copyright © UltraScripts.com, Inc. 1999-2000.
Home | Gallery | Forums | Services | Webmail | Archive | Links | Contact Us | About Us
OS2 World.Com 2000-2004