Multilanguage resources translation
itzik.spitzen posted on January 10, 2008 :: 2975 views
This article explains how to create a translated resource file.
Get the latest version of open source according to your target .NET Framework and make sure it compiles.
Open the Gizmox.WebGUI.Forms project and find the C# code file named SR.cs. Then embed the resource file under the existing SR.cs file (as this file's embedded resource - right next to other resource files which exist there).
After compiling, you should make sure that a directory with your culture name (i.e. "fr-CA") is created next to the output dlls and underneath it you will find the localized version of Gizmox.WebGUI.Forms.resources.dll.
Deploying is very simple; you just create a directory with the desired culture name (e.g., fr-CA) under the bin directory, and then copy the localized resource into it.
I hope this will help you out with creating multi-lingual applications using VWG.
Please remember to send us (to support at Visual WebGui) any new languages translated *.resx files so that we
will be able to share with the community.
Thanks,
Itzik Spitzen
I believe the code sample available for download has nothing to do with de article, it's a project named "AutoCompleteSample" and has no resource file in it.
Posted by javierpelaezt on Thursday, January 10, 2008 7:13 AM
Sorry for that, I had a technical difficulty and it appears that the right file was not uploaded correctly the first time.
Posted by itzik.spitzen on Thursday, January 10, 2008 8:08 AM
Hi,
many thanks for your help, but something are not working as I expected.
I created a Visual Web GUI project to test. It worked with the files download in the language pack, for example with de-DE, hl-IL. Tried with the one generated in this code (fr) and other I created (pt-PT), but nothing changed . One think looks strange to me: the name of the output file generated below the obj, debug,fr, the one I used is Gizmox.WebGUI.Forms.resources.resources.dll, and not
Gizmox.WebGUI.Forms.resources.dll.
By the way, I ‘m Portuguese, and I have translated a .resx file (SR.pt-PT.resx) to Portuguese, that I can upload to you. How can I do it?
Posted by mab on Thursday, January 10, 2008 5:37 PM
is it suppose to work when using CTRL+F5?
I did exactly what you said, create a FR directory under the Bin directory, then copy the Gizmox.WebGUI.Forms.resources.dll in it.
In my form load I add : Context.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture("fr-CA")
then I run with CTRL+F5
I show up a messagebox and the button are still in english.
Posted by dubem1 on Friday, January 11, 2008 12:18 PM
Hi,
Have you tried with one of the languages, included in the language pack(de-DE,sv-SE, etc) ?
I tried, with a dateTime Picker Control, and all objects, where translated to the specific language, as expected, but not with the dll of this code (FR), neither with a pt-PT I created, following the steps itzik.spitzen, said.
This is the code I wrote:
public Form1()
{
InitializeComponent();
//this.Context.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
this.Context.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture("de-DE");
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
resources.ApplyResources(this.dateTimePicker1, "dateTimePicker1");
resources.ApplyResources(this, "$this");
}
I really, need a help.
Thanks,
mab
Posted by mab on Saturday, January 12, 2008 7:49 AM
Hi,
In case the culture is fr-CA, the resource should be named SR.fr-CA.resx and so the folder name.
Regards,
Itzik Spitzen
Posted by host on Sunday, January 13, 2008 12:41 AM
I try what you said, not working either.
Can you add to the .zip a project using the "Gizmox.WebGUI.Forms.resources" assembly compiled with the French resx.
Thank you
Posted by dubem1 on Sunday, January 13, 2008 3:43 AM
Hi,
I tried with FR and pt-PT (from a SR.pt-PT.resx, I translated to Portuguese, and sent by E-Mail to Itzik), and it not works.
To check, I tried, with some off the languages included in the Language Pack, in the some project, and everything woks fine.
Best regards,
mab
Posted by mab on Sunday, January 13, 2008 5:49 PM
Any Update on this? Because it's still not working.
Posted by dubem1 on Sunday, January 27, 2008 7:32 PM
i've exactly the same problem. I'm working with the stable version 5.83.3. I tried everything written in this thread, but when i use for example the date timepicker everything is still written in english. my system language of my os is german and everything is set to german. but nothing changes.
the funny thing about is, that when i use the he-IL language everything goes from the left to the right side, but still everything written in english.
After changing the language with "Context.CurrentUICulture = New System.Globalization.CultureInfo("de-DE")" I get "Deutsch/deutsch" when executing the command "MessageBox.Show(Me.Context.CurrentUICulture.DisplayName)" but the callender still shows "son mon tue ..." -> so the language didn't change???.
It would be so nice of you, if someone could write a tutorial (video would be even nicer :)) where you discribe everything needed step by step.
thank you
Posted by rogi1234 on Wednesday, March 05, 2008 10:53 AM
Is there a way to use different resource provide than built-in compiled resources, e.g. use database to store all the translations?
Posted by pavelingenium on Tuesday, April 29, 2008 2:59 AM
I followed all these information that Itzik presented and it works perfectly for Greek language!!
On the Form_Load event, the first command has to be Context.CurrentUICulture = System.Globalization.CultureInfo.CreateSpecificCulture("el-GR")
Posted by nistam on Tuesday, May 27, 2008 12:48 PM
Example project, Pleeeese
Posted by radzimskik on Thursday, June 05, 2008 8:38 AM
if you provide the sample application, it could be great helpful
Posted by klinga2208 on Wednesday, July 16, 2008 5:57 AM
I would also really like some more explanation about this. I tried to follow everything what is written above but didn't understand the first sentence ("Get the latest version of open source according to your target .NET Framework and make sure it compiles. "). What latest version of open source??
Posted by parcol on Tuesday, September 02, 2008 6:44 AM
Hi,
You should get the latest version of public sources from our SVN public branch here:
http://72.55.165.182/svn/Public/ using TortiesSVN tool or any tool (see a quick start here: http://www.visualwebgui.com/Community/Resources/QuickStarts/tabid/365/articleType/ArticleView/articleId/310/Default.aspx).
Alternatively, you can download the sources of the version you are using linked from the left bottom of the download page here: http://www.visualwebgui.com/tabid/110/default.aspx and use it as described in the article.
I hope this helps...
Regards,
Itzik Spitzen
Posted by itzik.spitzen on Tuesday, September 02, 2008 6:54 AM
Dear Itzik,
In the end I was able to create a new resource file for the dutch language (send to admin mailaddress).
I followed the steps as described in the howto and when I set the uiCulture to nl-NL in the web.config I get the localized texts. Only the wait spinner that appears normally on the top right corner of the browser is now in the top left corner of the browser but thats a minor problem.
This brings me to another question. Why does VWG not pick up the regional settings of the client machine I am using which is set to dutch? When I omit the uiCulture setting in the web.config the uiCulture reverts to en-US which I configured as the culture in the web.config.
I attached a screenshot in the mail I sent you to clarify what I mean.
Also when I force the uiCulture to be nl-NL by adding uiCulture="nl-NL" to the globalization tag in the web.config the datetimepicker control does not show the dutch datetime formats but the english ones.
I also have a listview which I feed a datasource with a datetime column which does not show the dutch format.
What am I missing or doing wrong?
Kind regards,
Arco Stolk
Posted by parcol on Tuesday, September 02, 2008 11:34 AM