We are developing a web app in Spanish which will be translated to English so we are thinking about considering localization as soon as possible. I read a bit about this subject and I see that every ASP.NET control can be localized without any apparent problem
but our app has other places where translation needs to be performed. For example, we are building a class library that will contain all of the database operations (insertion, update, deletion) and, if an error occurs in any of them, a string variable is used
to set the error message which will finally be displayed in a popup window. As you can see, this is not an ASP.NET control but a string variable, and it can take any value depending on the operation performed in the DB. Besides, such a string variable may
also contain the Message of an exception in case one is fired. What are the options to solve an issue like this? Does localization apply to this case?
I know about some software tools that help with localization. Can anybody recommend one?
For the exceptions message, you should just log them and display a friendly message to your user (this friendly message has to be localized)
Is it possible to automate localization of "friendly messages"? Maybe a list of such messages (in different languages) in a database can solve this issue, but I would like to know if there is an alternate method. What I do not want is to translate these
"friendly messages" directly in code such that, if I need a different language, another copy is needed. Maintaining more than one copy of the same project can become a headache.
JORGEMAL
Member
61 Points
212 Posts
Localizing string variables besides ASP.NET controls
Sep 08, 2011 10:29 PM|LINK
We are developing a web app in Spanish which will be translated to English so we are thinking about considering localization as soon as possible. I read a bit about this subject and I see that every ASP.NET control can be localized without any apparent problem but our app has other places where translation needs to be performed. For example, we are building a class library that will contain all of the database operations (insertion, update, deletion) and, if an error occurs in any of them, a string variable is used to set the error message which will finally be displayed in a popup window. As you can see, this is not an ASP.NET control but a string variable, and it can take any value depending on the operation performed in the DB. Besides, such a string variable may also contain the Message of an exception in case one is fired. What are the options to solve an issue like this? Does localization apply to this case?
I know about some software tools that help with localization. Can anybody recommend one?
Respectfully,
Jorge Maldonado
sam_xiii
Contributor
2366 Points
381 Posts
Re: Localizing string variables besides ASP.NET controls
Sep 09, 2011 01:50 PM|LINK
hi
user resources files to store your different translations and use it in your code with the resourcemanager
For the exceptions message, you should just log them and display a friendly message to your user (this friendly message has to be localized)
Exceptions message are for developpers, so the logs should be enough
if you throw your own exceptions, you can localize them too.
hope this helps...
http://www.sambeauvois.be
JORGEMAL
Member
61 Points
212 Posts
Re: Localizing string variables besides ASP.NET controls
Sep 09, 2011 03:26 PM|LINK
Is it possible to automate localization of "friendly messages"? Maybe a list of such messages (in different languages) in a database can solve this issue, but I would like to know if there is an alternate method. What I do not want is to translate these "friendly messages" directly in code such that, if I need a different language, another copy is needed. Maintaining more than one copy of the same project can become a headache.
With respect,
Jorge Maldonado
sam_xiii
Contributor
2366 Points
381 Posts
Re: Localizing string variables besides ASP.NET controls
Sep 12, 2011 06:58 AM|LINK
Hi,
you have to use ressource files, it's the localization way provided by asp.net
http://msdn.microsoft.com/en-us/library/c6zyy3s9.aspx
http://www.sambeauvois.be