May 21, 2010 at 10:32 AM
Edited May 21, 2010 at 12:20 PM
I've make a build against newest Castle Validator and wired everything up in my MVC project as always. After launching app in VS2010 i'v checked bin directory and desired Castle.Components.Validator.dll was in place with satellite assemblies in subdirectories.
I tried to change current UI culture but nothing work and only default/neutral culture messages are showing. It seems to ResourceManager involved in CachedValidationRegistry that should show all satellite assemblies has some troubles. I make it work by manually
loading specified satellite assembly from file placed in /LANG/ dir but it is ResourceManager default functionality to do this job.
Do I have to make any special steps to get it work?
Simple code test from Global.axax Begin Request method
Thread.CurrentThread.CurrentUICulture = new CultureInfo( "pl" );
Thread.CurrentThread.CurrentCulture = new CultureInfo( "pl-PL" );
var alibs = AppDomain.CurrentDomain.GetAssemblies();
main assembly plus satellite assemblies are in this list (PublicKeyToken for culture assemblies is null, culture property is set with languages)
var resourceManager = new ResourceManager( "Castle.Components.Validator.Messages", typeof( ValidatorRunner ).Assembly );
var resourceString = resourceManager.GetString( "same_as_invalid" );
resource string is always from neutral culture - English language