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 

Generated resource IDs invalid?

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



Joined: 16 Nov 2010
Posts: 27

PostPosted: Wed Dec 15, 2010 3:34 pm    Post subject: Generated resource IDs invalid? Reply with quote

I just found that the generated resource IDs might have a dot char '.'. This generates a warning in VS2010:
The resource name 'XXXX.Text' is not a valid identifier.

Shouldn't rather a underscore char '_' be used on generating resource IDs??

Thanks
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Dec 15, 2010 9:46 pm    Post subject: Reply with quote

Resx keys containing dots (".") are perfectly legal. This warning is only generated if you have changed the Custom Tool property for the resx to "ResXFileCodeGenerator" to generate a class wrapper for the resources. Since the ResxExtension doesn't doesn't use class wrappers Globalizer.NET was not designed to facilitate their use (by avoiding using dots in keys). Interestingly the ResXFileCodeGenerator actually copes with dots in key names and just converts them automatically to underscores. So it seems that maybe this warning you get when opening the resources in the visual studio editor is obsolete. You can quite happily ignore the warning.

We maybe able to provide an option in a future release to enable the naming convention for WPF resources to be changed - but as this would break existing code we can't simply change the default naming convention that Globalizer uses.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Dierk Droth



Joined: 16 Nov 2010
Posts: 27

PostPosted: Thu Dec 16, 2010 6:26 am    Post subject: Reply with quote

Thanks for looking into.

I agree, having an option to strictly generate '_' and no '.' would be the way to go.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Jul 22, 2011 3:53 am    Post subject: Reply with quote

Version 3 of Globalizer has now been released and includes a "Use compliant resource names" option in the XAML Settings. If checked then Globalizer will generate resource names with underscores instead of "."s to allow the ResxFileCodeGenerator to be used without warnings on resx files created by Globalizer. By default this option is checked for new Workspaces but unchecked for Workspaces created used Version 2 (so that the behaviour doesn't change unless you explicitly want it to.

See the Release Announcement for more details.
_________________
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