baabaa_nl
asked on
Topic: VB.Net: Write multi-culture code.
Hi Experts,
I developed an application using an US and UK culture computer, and deployed it on a computer that had European culture such as Dutch, and my application did not work properly as intended. I found the reason for the cause and that was because, I was using decimal point '.' for the currency rather than the comma ',', which is used by the European culture. I was then given a solution by an expert on Experts Exchange to use the CultureInfo.CurrentCulture .NumberFor mat.number decimalsep arator. And since then it worked without any problem.
But I want to make sure that the code I write is always a multi culture application. How can I do that. Because the application I develop will be used by many users which will have different languages installed on the computer with different keyboard layouts. So is there a way or method that I should follow that when I write a code once in VB.Net and it will work as intended on other cultured computers without me writing separate codes for each and every culture that will be used by the user.
I also faced a similar problem in Access and Excel using the same above application(the application uses the database to fill the datagridview and for the user to add and manipulate the database of income and outgoing funds).
In Access database I had an issue with dates(the user is only able to access the Access database by using the VB.Net application), i.e. when user entered the date 5/9/2012, the Access stored the date as 9th May 2012, because the Access was in US. So to solve that, I had to change the number of the month with the name. At first I used the .ToString("MMMM") to convert the number of the month to the name of the month, so that it would be sent to the database as 5/May/2012, but when I did this on a European culture computer and tried to send the date to the Access database, it threw an error, because the May was sent 'Mei'(the May month in Dutch) and Access could not recognize the Dutch name of the month. So I wrote a custom method that converts the number of the month to the name(names of the month in English) and then passed it to the Access. But is there any way that I could do that in a multi culture way, i.e. send the month in a multi culture way that any language of Access can recognize it. Because I am developing this application using an US Access, but on the deployment location, the users will most probably using a Dutch version of Access Database. So there is a possibility that the date my cause problems on the Dutch version of the Access.
Hope I was clear with my question.
Thanks in advance.
I developed an application using an US and UK culture computer, and deployed it on a computer that had European culture such as Dutch, and my application did not work properly as intended. I found the reason for the cause and that was because, I was using decimal point '.' for the currency rather than the comma ',', which is used by the European culture. I was then given a solution by an expert on Experts Exchange to use the CultureInfo.CurrentCulture
But I want to make sure that the code I write is always a multi culture application. How can I do that. Because the application I develop will be used by many users which will have different languages installed on the computer with different keyboard layouts. So is there a way or method that I should follow that when I write a code once in VB.Net and it will work as intended on other cultured computers without me writing separate codes for each and every culture that will be used by the user.
I also faced a similar problem in Access and Excel using the same above application(the application uses the database to fill the datagridview and for the user to add and manipulate the database of income and outgoing funds).
In Access database I had an issue with dates(the user is only able to access the Access database by using the VB.Net application), i.e. when user entered the date 5/9/2012, the Access stored the date as 9th May 2012, because the Access was in US. So to solve that, I had to change the number of the month with the name. At first I used the .ToString("MMMM") to convert the number of the month to the name of the month, so that it would be sent to the database as 5/May/2012, but when I did this on a European culture computer and tried to send the date to the Access database, it threw an error, because the May was sent 'Mei'(the May month in Dutch) and Access could not recognize the Dutch name of the month. So I wrote a custom method that converts the number of the month to the name(names of the month in English) and then passed it to the Access. But is there any way that I could do that in a multi culture way, i.e. send the month in a multi culture way that any language of Access can recognize it. Because I am developing this application using an US Access, but on the deployment location, the users will most probably using a Dutch version of Access Database. So there is a possibility that the date my cause problems on the Dutch version of the Access.
Hope I was clear with my question.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Also are there any website or links that shows the places and areas where multi culture code should be used to make sure that the application works on a multi culture platform.
Thanks in advance.