|
-
Aug 29th, 2008, 09:23 AM
#1
Thread Starter
Hyperactive Member
[2005] Multi-Language App
I'm currently maintaining an application. The end user has informed me that the application when run in Italy, all text are in Italian language. I was doing some research about it and point to the resx file. When I search the app, I see all the the solution forms with 2 sets of resx file.
Customer.resx
Customer.it-it.resx
How do I compile the project and change the language to Italian in one swoop or do I need to go to each form and change the language property and compile?
TIA
Last edited by ARPRINCE; Aug 29th, 2008 at 09:49 AM.
-
Aug 29th, 2008, 01:17 PM
#2
Re: [2005] Multi-Language App
Here's how resource files work for a multi-language app.
Your app has a "default" language; in this case "English". All information for this language will be stored in .resx files without any other appendix.
Your app also has resx files to describe the "Italian" language (Italy Italian, in case it matters). These are stored in the it-it.resx files.
You don't have to compile your program ANY differently. Just compiling it normally will embed the English resx files into the .exe and all the Italian files will end up in it/application.resources.dll.
When Windows is set for an Italian local, it'll AUTOMATICALLY find and use the Italian resources. for anything else, it'll use English.
Let's say you want to sell the program in Mexico. You need some Mexican Spanish resource files (es-mx). This is easy to do. Make copies of all your English files. Add es-mx between their name and resx: Customer.es-mx.resx
Send them off to a translator who knows what they're doing. When you get them back translated, drop them into your project with the rest, compile, and now your program will automatically support Mexican Spanish.
That's it! Everything is done behind the scenes. I recently had to be put through this experience. After translation, you can click open your forms and change "Language" to the new language and the whole form will change to that language. You can adjust label and text sizes this way graphically when words that used to be 4 letters long are translated into words 23 letters long. Small changes made to the form this way ONLY affect the language you're working in. Switch back to English, and the little label size adjustments you made revert back because even these are also stored in the form's resource files.
-
Aug 29th, 2008, 01:39 PM
#3
Thread Starter
Hyperactive Member
Re: [2005] Multi-Language App
 Originally Posted by Jenner
You don't have to compile your program ANY differently. Just compiling it normally will embed the English resx files into the .exe and all the Italian files will end up in it/application.resources.dll.
Jenner,
Thank you so much for a VERY ENLIGHTENING explanation. A follow-up question is, my directory looked something like below. So that means when I'm done compiling, I will send them MyProgram.exe as well as the MyProgram.resources.dll under the it-IT folder?
Code:
..bin/Release/MyProgram.exe
|
+---en/MyProgram.resources.dll
|
+--it-IT/MyProgram.resources.dll
-
Aug 29th, 2008, 02:01 PM
#4
Re: [2005] Multi-Language App
You send it EXACTLY as it's laid out there. MyProgram.resources.dll has to be in an it-IT/ directory and en/ should be in it's own directory.
If all they need is patch-version and everything is already installed, then just zip up the executable, any sub-directories with their files and any other needed files in bin/Release. When they unpack it, everything should be placed in the correct locations.
Better would be to make a Setup Project and then they run an installer.
-
Sep 2nd, 2008, 08:37 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] Multi-Language App
Hi again. I'm trying to simulate this by creating a new project. In it, I have a form [Form1] and one button. I created in the Form1.it-IT.resx file and looks good when I change the form language property to Italian (Italy). So I switched it back to (Default) and compiled.
I proceeded by creating a SETUP project and installed it on my PC and it created the structure below.
MyNewProject\MyNewProject.exe
|
+---it-IT\MyNewProject.resources.dll
I went to the CONTROL PANEL and change my REGIONAL AND LANGUAGE OPTIONS to Italy. Rebooted and run the program but it is still in English. What triggers the program to change language settings or am I missing something else here?
TIA
-
Sep 2nd, 2008, 09:23 AM
#6
Re: [2005] Multi-Language App
Did you set "Localizable" = True on Form1?
Make a new project.
Make some labels on Form1. Type in some English text.
Form1.Localizable = True
Form1.Language = Italian
Change the text in the Labels to something else (Italian).
Form1.Language = (Default)
---(You should see the form change back to English.)
Compile.
Also, you may need to reboot Windows after a language change like that.
-
Sep 2nd, 2008, 10:52 AM
#7
Thread Starter
Hyperactive Member
Re: [2005] Multi-Language App
Shouldn't there be some CODING on the form when it loads so that it would know that it needs to run a different language?
Code:
Imports System.Globalization
Imports System.Threading
....
-
Sep 2nd, 2008, 11:21 AM
#8
Re: [2005] Multi-Language App
Those are just Imports. They save typing. 
All those do is allow you to type:
Dim c As CultureInfo
rather than:
Dim c As System.Globalization.CultureInfo
Give it a try. Even without Imports System.Globalization you can still do: Dim c As System.Globalization.CultureInfo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|