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 

Duplicate Context Names and Keys

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



Joined: 04 Jan 2010
Posts: 15

PostPosted: Wed Jan 13, 2010 10:22 am    Post subject: Duplicate Context Names and Keys Reply with quote

Somehow, I have managed to mangle my project. Many items are displaying the incorrect text. I have no idea why.

I recently tried deleting the problem items and re-adding them. When I did, I noticed duplicate names in the recently added items as well.

Here is a screenshot.




Please advise.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jan 13, 2010 10:25 pm    Post subject: Reply with quote

Quote:
Somehow, I have managed to mangle my project. Many items are displaying the incorrect text. I have no idea why.


Do you mean you Visual Studio project? Is the invariant (English) text displaying incorrectly when you open the form in Visual Studio? Do you think this was related to something you did in Globalizer.NET?

Quote:
I recently tried deleting the problem items and re-adding them. When I did, I noticed duplicate names in the recently added items as well.


I think that these duplicate items are probably coming from separate targets (forms/windows) - since Globalizer.NET does not allow duplicate keys for a single target. I'm assuming therefore that you have the Workspace selected in the Workspace Explorer window and so you are seeing all translations for all targets.

If you right click on the column headers and select Show/Hide Columns then you can display the Target column. This will enable you to see which target the translations are associated with. Alternatively you can select a translation and use the Translation->Select Parent Target to select the target in the Workspace explorer.

My guess is that you have inadvertantly created a copy of your window in your project and so Globalizer.NET has created a target for the copy.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
bvillersjr



Joined: 04 Jan 2010
Posts: 15

PostPosted: Mon Jan 18, 2010 2:56 am    Post subject: Reply with quote

I'm sorry for the delay in my replly. It has been very hgectic here lately. You are right, the screenshot above displays normal behavior, and does not properly represent the issue that I am having.

My issue is a little more difficult to define. I have multiple Xceed Grids on the same form. I dont recall whether or not I created the Grid my copying and pasting or not. At this time, both grids have different names. I have even gone so far as to remove the resources from each grid's title and set them to a manual string. I then re-scanned and can see the changes. Somehow, I continue to have titles from Grid A showing up on Grid B, etc..

I have written far too much code to go back to my pre-Globalizer backup.

Are there any known ways that I could have caused these resource titles to show up on the wrong grid? There appears to some type of auto-numbering mechanism that is getting confused. It would be great if the grids title was used in thje name of it's resources. I think that this would probably straighten things up, or at least make my error more obvious.

I will contuinue to look for more detail so that I can offer you more clear information.
_________________
Regards,


Berney Villers Jr.
SimXperience.com
http://www.SimXperience.com
Back to top
View user's profile Send private message Visit poster's website
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 18, 2010 11:03 pm    Post subject: Reply with quote

We have done some more testing using the Xceed datagrid and think we have uncovered the source of your problems. The cause seems to be a subtle interaction of two different issues when scanning XAML and converting it to use the Resx Extension. Normally Globalizer.NET uses the Name property of an XML element to determine the Resx key. For instance if the Name of a button element was "MyButton" then the resx key for the content property would be "MyButton_Content". However if there is no Name property set for an element then Globalizer.NET will try to construct a unique name for the resx key based on the type of the element. In this case it would be "Button_Content1.

Unfortunately there appears to be a bug in the second case which means that if after scanning a window you later add a new element of the same type BEFORE existing elements then Globalizer.NET does not correctly increment the automatically generated name when converting the newly added element to use the resx extension. This means that the resource key it generates for the new element will be the same as an existing resource key and it will overwrite the existing resource in the resource file. The problem doesn't occur if elements are added after existing elements.

We will a get a fix out for this as soon as possible (early next week).

The workaround for most elements is to ensure that you define a Name property for each new XAML element that will be localized. Then Globalizer.NET will not have to generate a unique name using the incrementing number. Unfortunately the Xceed column does not support the Name property. It does support the x:Name property but this is not recognised by Globalizer.NET.

Until we get the fix out you can do one of the following:

1. Delete the Resx file (in Visual Studio) then delete the Resx extension properties from the XAML and set the column titles to the proper strings then rescan and convert the window using Globalizer.NET. If your column titles have got really messed up then this might be the simplest way to get things back in order.

2. Manually add the Resx extension key for your column title properties and the corresponding resource in the resx file (you can expand the Window in Visual Studio and then open the resx file).
_________________
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 Jan 26, 2010 3:09 am    Post subject: Reply with quote

Version 2.1.0 of Globalizer.NET has now been released and includes the fix for this issue. Version 2.1.0 also will recognise the x:Name property (if used) and use it when generating Resx Key names. You can download it from our downloads page (www.infralution.com/downloads.html).
_________________
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