How to change language of interface during runtime? 
Author Message
 How to change language of interface during runtime?

Hello,

Let m_s1, m_s2 etc be texts for labels for controls.

if(lang == Eng)    {
m_s1 = "Hello";
m_s2 = "Bye";
...

Quote:
}

else if(lang == Fr)    {
m_s1 = "Bonjour";
m_s2 = "Adieu";
...
Quote:
}

else if(lang == De)    {
m_s1 = "Guten Tag";
m_s2 = "Auf wiedersehen";
...
Quote:
} //and so on.

UpdateData(FALSE);

Cheers




Fri, 04 Jul 2003 05:20:48 GMT  
 How to change language of interface during runtime?

Quote:

>Hello,

>Let m_s1, m_s2 etc be texts for labels for controls.

>if(lang == Eng)    {
>m_s1 = "Hello";
>m_s2 = "Bye";
>...
>}
>else if(lang == Fr)    {
>m_s1 = "Bonjour";
>m_s2 = "Adieu";
>...
>}
>else if(lang == De)    {
>m_s1 = "Guten Tag";
>m_s2 = "Auf wiedersehen";
>...
>} //and so on.
>UpdateData(FALSE);

>Cheers

This is an incredibly stupid way to do it - very bad advice indeed.
You are filling up the application with conditional tests with the
attendant problems of code bloat and the possibility of introducing
bugs in the tests.

Use a resource dll

Eddie



Fri, 04 Jul 2003 08:07:53 GMT  
 How to change language of interface during runtime?
Relax, resourceful boy. Just shut tight your big mouth and watch out.

Cheers


Quote:
> This is an incredibly stupid way to do it - very bad advice indeed.
> You are filling up the application with conditional tests with the
> attendant problems of code bloat and the possibility of introducing
> bugs in the tests.

> Use a resource dll

> Eddie



Fri, 04 Jul 2003 23:09:06 GMT  
 How to change language of interface during runtime?
I tryed without using dll but just my resources.
It is not possible. Microsoft says it is, under Windows 2000 (NT5 or above),
using SetThreadLocal,  but it doesn't seem to work.
If you want to change language of interface during runtime you need a
resource dll that contains your text.
Then you just have to tell Windows to use it instead of your internal exe
resource.

Enjoy



Fri, 04 Jul 2003 23:41:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Change mdi background during runtime

2. value of struct member changes during runtime

3. adodc - changing the filter during runtime is possible?

4. Changing a Dialog's CAPTION during runtime

5. How To change a LTEXT Resource during runtime?

6. Best way to change text attributes during runtime?

7. adodc: changing filter during runtime is possible?

8. Q Menu item change during runtime (2)

9. Q: How can I change menu items during runtime

10. Changing Tab Order during runtime

11. How To change a LTEXT Resource during runtime?

12. Changing Font in CButton during runtime

 

 
Powered by phpBB® Forum Software