[2005] Globalizing Application
I have been given the task to globalize a current asp.net 2.0 application. The app should display text, numbers, currency, etc. in the native language of the country the user is logged in to (chosen during login process).
Is there a site or book that anyone knows of that explains this process step-by-step. I've done some searching on-line, but still haven't found a resource that explains it to me step by step.
Any help would be greatly appreciated.
Re: [2005] Globalizing Application
Oh come now, I know someone has implemented multi-language support into an application before.
I thought for sure mendhak would have weighed in by now (hopes calling him out will get him to respond).
Re: [2005] Globalizing Application
I have. There isn't a step by step way to do this because there's always the assumption that you are starting a new application with localization in mind. You will need to use resx files to store your strings and ensure that when you perform string/date/numeric/date conversions that you always use CultureInfo or specify a culture.
For this purpose, there are two articles for you to read which you may have read already (in which case you'll need to read again and apply to your application)
http://support.microsoft.com/kb/917414
http://msdn.microsoft.com/en-us/libr...6f(VS.80).aspx
Re: [2005] Globalizing Application
mendhak saves the day.... was trying to locate those articles earlier but couldnt for some reason :)
Re: [2005] Globalizing Application
I found a pretty good video for this on asp.net. But it's on my work PC. Most of the cool translation stuff he does, such as displaying culture specific calendars and currency isn't even done with resource files. Visual Studio 2005, or .NET 2.0 has some pretty powerful built-in language conversion.
But anywho, I followed the steps in the video, and the little "localized" app worked fine. However, when I tried to apply the methods to the current app, the language never changed.
Could it have something to do with the Ajax?
Re: [2005] Globalizing Application
personally not sure...but the frog master can help :p
maybe this will point you in the right direction in regards to ajax?
http://www.asp.net/Ajax/Documentatio...Resources.aspx
Re: [2005] Globalizing Application
You're talking about the CurrentCulture format providers which in turn determine calendars and currencies and strings and all that. But we don't know what you did in your application so we can't really tell what's wrong. How did you determine or set the current culture?
Re: [2005] Globalizing Application
This is the video I used.
I didn't use any resource files. If you notice, in the later part of the video, he uses the CurrentCulture class to change the way the calendar and currency format looks.
If you don't want to watch the video, I have the code I used (and tried to use in my actual app) on my work PC, and I'll post it tomorrow.
Re: [2005] Globalizing Application
This is the code I'm using from the video.
Code:
Protected Overrides Sub InitializeCulture()
Dim lang As String = Request("Language1")
If lang IsNot Nothing Or lang <> "" Then
Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang)
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(lang)
End If
End Sub
"Language1" is a drop-down list on the main page. When somebody chooses a language, the value (i.e. en-US) is passed to this procedure and the culture is set.
The problem with my main application is that even if this procedure is called, the text on the page does not change languages, which is why I was questioning if it was the Ajax causing the problem.
Re: [2005] Globalizing Application
Probably, because when you postback with AJAX if there is no 'Language1' value being sent via POST or GET, then it just won't change at all and will remain the same. Place a breakpoint on that method to see what happens everytime you do an AJAX postback.