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 

Custom messages are not picked up

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
prayag



Joined: 04 Sep 2009
Posts: 4

PostPosted: Tue Sep 08, 2009 10:39 am    Post subject: Custom messages are not picked up Reply with quote

Hi!

Our team is currently evaluating Globelizer.NET (Developer Edition) software evaluation copy.

The issue is when we try to convert an entire solution the msgbox strings & exception strings are not being scanned by Sisulizer could you please help in providing us a solution for the same.

==========================

Example Provided below:

1) MsgBox("Problem in reading")



2)Dim R As String = String.Empty

Catch ex As MalformedLineException R = (ex.Message &

"not valid skip")
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Sep 08, 2009 10:53 pm    Post subject: Reply with quote

That is because the standard way of localizing these type of strings is to add the strings to the application resources and then use the resource eg

1. MsgBox(My.Resources.ProblemReadingMsg)

2.
Code:
Dim R As String = String.Empty
Catch ex As MalformedLineException
R = String.Format(My.Resources.ExceptionMsg, ex.Message)
' where ExceptionMsg is defined in resources as "{0} not valid skip"


Note that in the second case it is usually better to use string.Format with a placeholder for the message rather than concatenating the strings directly - because in other languages the text may occur in a different order.

Microsoft provide a refactoring tool that assists with changing from hard coded text to resources. You can download it here

Once you have added your programmatic strings to the application resources then Globalizer.NET will scan them.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bdejong



Joined: 23 Sep 2009
Posts: 16

PostPosted: Wed Sep 23, 2009 1:37 pm    Post subject: Reply with quote

I have to also comment on this issue. While Globalizer does a great job at the controls and the preview of the form, it should also pull out the embedded strings in the source code and generate the resource files for them.

This would be a great feature and is common in other solutions. Is this possible???
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Sep 23, 2009 11:29 pm    Post subject: Reply with quote

This is something we could look at. It may be beneficial for users who are starting to localize an application that was not built with localization in mind. Just automatically converting all strings to resources may not be the way to go however. Some strings are not localizable and shouldn't be in resources. Other strings will probably need refactoring to be suitable for localization. For instance developers who aren't conscious of localization will often write something like:

Code:
string error = "There are " + n.ToString() + " instances running";


Where as this really should be refactored as:

Code:
string error = string.Format("There are {0} instances running", n);


to be suitable for localizing (since different languages have different structures).

This means that the process of preparing your project for localization really involves examining each string. You can do this using Visual Studios Find facility to locate each string and then using the Microsoft resource refactoring tool to convert the strings to resources as you go.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support 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