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 

Localization & Visual Inheritance

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





PostPosted: Thu Nov 01, 2007 12:23 pm    Post subject: Localization & Visual Inheritance Reply with quote

Hi,

I’m having troubles with some resources when using localization and Visual Inheritance.

If I Localize them on the Inherited form to a new Language, those strings get overwritten by the original value in the BaseForm.
If I Localize them on the BaseForm, the Localized values do not persist in the Inherited form.

How do I solve this?

TIA,

Michael
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Nov 01, 2007 10:25 pm    Post subject: Reply with quote

If you have buttons etc on the base form you should localize them on the base form. If you override the text (or other properties) in a derived form then you will need to localize the overridden properties in the derived form. This is the same as for the standard .NET localization mechanism (ie using Globalizer.NET shouldn't make any difference here)

I've just checked this with one of our VB test projects that uses visual inheritance and it seems to be working as expected.

Are you doing binary localization or source code localization? If you are still having an issue with this maybe you could put together a small sample project that demonstrates the problem and email it to support@infralution.com. This helps a lot in tracking down issues.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Nov 06, 2007 12:28 am    Post subject: Reply with quote

Thanks for the sample project - it allowed us to quickly identify your issue. The problem is that you are setting the CurrentUICulture in the derived form Form_Load event. But by this stage the resources for both the base form and the derived form have already been loaded (they are loaded in the designer InitializeComponent method).

If you are going to use a form as the startup object then you need to set the CurrentUICulture before the form (or any of its base forms) call InitializeComponent. Unfortunately VB.NET hides what is going on here. Each form class has a implicit parameterless constructor that calls InitializeComponent. The form constructors are called in order (base constructor first). So you would need to set the CurrentUICulture in the constructor of the base form. You could do this by adding an explicit Sub New eg

Code:
Public Class Form1
    Public Sub New()
        System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("NL")
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
    End Sub
End Class


Probably a better idea however is to click the View Application Events button in the project properties and override the MyApplication.OnStartup method to set the CurrentUICulture. This is called before the Startup form is created.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Michael
Guest





PostPosted: Fri Nov 09, 2007 11:05 am    Post subject: Reply with quote

Thanks!
Back to top
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