Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How do I localize hard coded strings?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Globalizer FAQ
View previous topic :: View next topic  
Author Message
Infralution



Joined: 28 Feb 2005
Posts: 4879

PostPosted: Thu May 26, 2011 8:50 am    Post subject: How do I localize hard coded strings? Reply with quote

How do I localize strings in my code like:

Code:
Dim strMsg as String = "Remember to save before entering more text!"
MessageBox.Show(strMsg)


Globalizer scans .NET resources it doesn’t scan strings that are just defined in code like this. What you need to do is to first convert them to into resource strings. You add the string to the Project resources then change your code to refer to the resource eg

Code:
MessageBox.Show(My.Resources.SaveMsg)


This is standard practice for localizing .NET apps. Fortunately there are some tools that make changing existing code to use resources easier. A free “Resource Refactoring Tool” is available from Microsoft for VS2005, VS2008 and VS2010 that allows you to right click on a string in code and move it into a resource.

You can download the tool for VS 2008 here and for VS 2010 here
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Infralution Support Forum Index -> Globalizer FAQ All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group