Multilanguage Programming 
Author Message
 Multilanguage Programming

Hi,

Can somebody tell me why we always have to recompile our program when
we change something in our resource file ? We also have to recompile the
resource
file ?

Does somebody have a better way to deal with multilanguage programs ?
Is there a better way then using resource files ?

Many thanks,
Karel



Sat, 16 Sep 2000 03:00:00 GMT  
 Multilanguage Programming


Quote:
>Hi,

>Can somebody tell me why we always have to recompile our program when
>we change something in our resource file ? We also have to recompile the
>resource
>file ?

>Does somebody have a better way to deal with multilanguage programs ?
>Is there a better way then using resource files ?

Hello,

the better way for multilanguage programs seems to be not using VB.
Rember the poor support of different locales in VB, Format writes a
decimal point or a comma, but Val only accepts a point independent
from the used locale. But CDbl or CSngl accept a decimal point or a
comma depending on the locale.

VC has functions like setlocale or getlocale. If this functions are
used, the same program may use points or commas depending on locale
without recompilation.

I am experimenting on how to use the formating functions for input and
output available within VC with a VB program. It is not easy, but I
had some partial success. The problem is the support of different
types and different numbers of parameters to that functions.

But that was all about the different number and date and time formats.
The other problems is different strings for your menus, labels etc. in
all supported languages.

If you have all strings needed by your program in your resources files
and for all suported languages, you may write a self adapting program.
At start it should checked the system setting for language and refer
to the proper section of the resource file. You have to organize your
resource with a certain offset for all languages. For instance 1 to
100 are US english strings, 101 to 200 are UK english strings, 201 to
300 french, 301 to 400 fl?misch, 401 to 500 wallonisch, 501 to 600
deutsch.
I have an example of such a program from a good german book about VB.

Good luck and by.

Uwe
Uwe Hercksen

For EMail response, please use:
User: hercksen
sub-domain: zew
domain: uni-erlangen
country: de
--------------------------------------------------
Elektronikwerkstatt Uni. Erlangen
Cauerstr. 5
D91058 Erlangen



Sat, 16 Sep 2000 03:00:00 GMT  
 Multilanguage Programming

I suppose you have already solved the questions about date and number
formatting, etc.

After beeing using VB resource files I have created my own resource file
system. The way VB manages resources has various problems:

VB compiles resources within the EXE file, so if you want a program in 45
languages you must create 45 EXE files (which could fit on a CD-ROM, but
don't forget the compiling time).

VB is limited to about 32000 text resources in a project.

By the other hand, VB lets you use non-text resources, like bitmaps, etc.

In my experience, the most important are text resources. What I recommend
you is to create a MS-Access database with all the text resources, with
records like:
ResourceNumber,LanguageID,ResourceText
And make a little program in VB that edits and compiles theese resources in
a binary file "open for binary". One file per language. This binary file
should have a header table of resources, like:
    File position    Contents
    1-4                   Offset of beginning of resource No 1
    5-6                   Length of resource No 1
    7-10                 Offset of beginning of resource No 2
    11-14               Length of resource No 2

Consider:
- This resource system will allow more than 32000 resources for an EXE
(resource number is a long)
- If you do it right and put ALL your literals (menu captions included) in
the resource file, you will only need to distribute an EXE and one resource
file for language.
- With a well-designed resource reading routine, the performance is very
similar to the VB resource system.
- Other things you may discover...

Hope this help you. I know this is only an outline, but I'm not permitted to
tell more details.

Jose Luis.


Quote:
>Hi,

>Can somebody tell me why we always have to recompile our program when
>we change something in our resource file ? We also have to recompile the
>resource
>file ?

>Does somebody have a better way to deal with multilanguage programs ?
>Is there a better way then using resource files ?

>Many thanks,
>Karel



Sat, 16 Sep 2000 03:00:00 GMT  
 Multilanguage Programming

Do you not have to recompile your program when you correct a spelling error
on a label or fix a bug??? You just treat it like any other fix.

Incidently, a couple of people who responded seemed to imply you need a
different resource file file for each language and/or make a separate EXE
for each. That's not true. You just add an extra column in the file for each
language.

I find the whole process amazingly simple, practical and efficient for large
applications.

Mark Lewis
"There are always alternatives"
Corporate Consultants
www.ccxpress.com
<e-mail replies are trashed without being seen>

Quote:
>Hi,

>Can somebody tell me why we always have to recompile our program when
>we change something in our resource file ? We also have to recompile the
>resource
>file ?

>Does somebody have a better way to deal with multilanguage programs ?
>Is there a better way then using resource files ?

>Many thanks,
>Karel



Sat, 16 Sep 2000 03:00:00 GMT  
 Multilanguage Programming

Quote:

> Incidently, a couple of people who responded seemed to imply you need a
> different resource file file for each language and/or make a separate EXE
> for each. That's not true. You just add an extra column in the file for
each
> language.

> I find the whole process amazingly simple, practical and efficient for
large
> applications.

there is one more way: use dll-like structures so as to only change
appropriate dll's


Sun, 17 Sep 2000 03:00:00 GMT  
 Multilanguage Programming

I cracked the same problem but did it without a database. I have a simple
textfile for each language and it contains basically a list of resource-ids
and the accompanying text. At the start of my program I read the entire file
to memory and when I need a text I binary-search on my internal array (the
resource-ids are sorted). It gives me much better performance than accessing
a database, and less overhead. All my forms have a public FormInit-procedure
implemented, and by doing this I have ability to change the language
runtime.

Regards,
Wilco

Jose Luis Pe?a heeft geschreven in bericht ...

Quote:
>I suppose you have already solved the questions about date and number
>formatting, etc.

>After beeing using VB resource files I have created my own resource file
>system. The way VB manages resources has various problems:

>VB compiles resources within the EXE file, so if you want a program in 45
>languages you must create 45 EXE files (which could fit on a CD-ROM, but
>don't forget the compiling time).

>VB is limited to about 32000 text resources in a project.

>By the other hand, VB lets you use non-text resources, like bitmaps, etc.

>In my experience, the most important are text resources. What I recommend
>you is to create a MS-Access database with all the text resources, with
>records like:
>ResourceNumber,LanguageID,ResourceText
>And make a little program in VB that edits and compiles theese resources in
>a binary file "open for binary". One file per language. This binary file
>should have a header table of resources, like:
>    File position    Contents
>    1-4                   Offset of beginning of resource No 1
>    5-6                   Length of resource No 1
>    7-10                 Offset of beginning of resource No 2
>    11-14               Length of resource No 2

>Consider:
>- This resource system will allow more than 32000 resources for an EXE
>(resource number is a long)
>- If you do it right and put ALL your literals (menu captions included) in
>the resource file, you will only need to distribute an EXE and one resource
>file for language.
>- With a well-designed resource reading routine, the performance is very
>similar to the VB resource system.
>- Other things you may discover...

>Hope this help you. I know this is only an outline, but I'm not permitted
to
>tell more details.

>Jose Luis.


>>Hi,

>>Can somebody tell me why we always have to recompile our program when
>>we change something in our resource file ? We also have to recompile the
>>resource
>>file ?

>>Does somebody have a better way to deal with multilanguage programs ?
>>Is there a better way then using resource files ?

>>Many thanks,
>>Karel



Sun, 17 Sep 2000 03:00:00 GMT  
 Multilanguage Programming

I use a database in access

so the customer is able to make some changes

for  VB4 16 bits   I use Access 2.0



Quote:
> Hi,

> Can somebody tell me why we always have to recompile our program when
> we change something in our resource file ? We also have to recompile the
> resource
> file ?

> Does somebody have a better way to deal with multilanguage programs ?
> Is there a better way then using resource files ?

> Many thanks,
> Karel



Tue, 26 Sep 2000 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Multilanguage program

2. Multilanguage Programming

3. Multilanguage Programming

4. Multilanguage Programming

5. Multilanguage Programming

6. Multilanguage Programming

7. Testers for multilanguage learning program wanted!

8. AutoCorrection multilanguage

9. Multilanguage macros

10. Bug? Arabic Font size in Word (Office MultiLanguage)

11. Easy way to make a multilanguage version

12. Multilanguage

 

 
Powered by phpBB® Forum Software