string tables & language switch
-
hi CPians, toxcct again. another wish i had for my prog was to have the possibility to switch all the text between French & English. I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names). Questions : 1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ? 2. how can i switch from one language to the other and vice versa ? 3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power
[VisualCalc] -
hi CPians, toxcct again. another wish i had for my prog was to have the possibility to switch all the text between French & English. I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names). Questions : 1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ? 2. how can i switch from one language to the other and vice versa ? 3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power
[VisualCalc]Can't say whether it's the best way of doing it, but I use resource-only dlls. How To Create Localized Resource DLLs for MFC Application You should also search for "satellite dlls" at MSDN, I think there's an example project.
:cool: Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
-
hi CPians, toxcct again. another wish i had for my prog was to have the possibility to switch all the text between French & English. I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names). Questions : 1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ? 2. how can i switch from one language to the other and vice versa ? 3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power
[VisualCalc]In our app we have support for 3 languages (quite a drag and a lot of overhead) We give the same names in the string tables for all three languages. (make 1, copy it and change the text) When we change the language setting of windows our app switches too. Good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
-
In our app we have support for 3 languages (quite a drag and a lot of overhead) We give the same names in the string tables for all three languages. (make 1, copy it and change the text) When we change the language setting of windows our app switches too. Good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
ok but, how to change the language while the application is running ? i have a combobox with 2 entries ("Français" & "English"), and i would like (when a selection change is detected) to alter all the strings from one table to the other associated with the selected language.
TOXCCT >>> GEII power
[VisualCalc] -
ok but, how to change the language while the application is running ? i have a combobox with 2 entries ("Français" & "English"), and i would like (when a selection change is detected) to alter all the strings from one table to the other associated with the selected language.
TOXCCT >>> GEII power
[VisualCalc]In that case I would think ahead. Load your captions dynamically with an xml document. This way you can add languages very easy in the future. You should then still find a solution on what to do when your app changes etc. So maybe not a good track either. I'm not sure it's so easy to what you want, maybe you can trigger the table-change, but I wouldn't know how :sigh:, sorry. good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
-
In that case I would think ahead. Load your captions dynamically with an xml document. This way you can add languages very easy in the future. You should then still find a solution on what to do when your app changes etc. So maybe not a good track either. I'm not sure it's so easy to what you want, maybe you can trigger the table-change, but I wouldn't know how :sigh:, sorry. good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
i cannot do this with string table ressource ?? strange if anybody knows... don't worry, tell me
TOXCCT >>> GEII power
[VisualCalc] -
hi CPians, toxcct again. another wish i had for my prog was to have the possibility to switch all the text between French & English. I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names). Questions : 1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ? 2. how can i switch from one language to the other and vice versa ? 3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power
[VisualCalc]Hi . u can create 2 Dll files with your resources and then use API function to load your resources as u wanted. On different Dll files u can use the same ID for the string. that is mean only change the dll file for specific language. for Example create Eng.dll file for English Version and Frn.dll for France Version. this make your program more esaer to development. Bye. On Earth nothing impossible, while your mind running. Faroqtam
-
hi CPians, toxcct again. another wish i had for my prog was to have the possibility to switch all the text between French & English. I so used the default string table (french) to insert the french strings, and created an US english for the translated strings. all the strings refering to the same thing in both tables had the same IDs (#define names). Questions : 1. Am i right to set the same IDs (#define names) in the string in both tables, or do they only need to have the same value (int) ? 2. how can i switch from one language to the other and vice versa ? 3. Is there a better/simplest way to do this far away from what i am doing now ?
TOXCCT >>> GEII power
[VisualCalc]What I did to solve this problem was put all the strings in a *.ini file (you could also use a *.xml file as suggested by V). By using this method, other people can add as many translations as they want, without you having to recompile your app or any extraneous dlls.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!