public void Create_LoadsNeutralEvenWithSpecificCultureSetOnThread() { Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("nl"); var resource = factory.Create( new ResourceDescriptor(null, "key", "Castle.MonoRail.Framework.Tests.Resources.Language", "neutral", "Castle.MonoRail.Framework.Tests"), typeof(DefaultResourceFactoryTestCase).Assembly); Assert.IsNotNull(resource); var lang = resource.GetString("language"); Assert.AreEqual("english", lang); }
protected void AddResource(string name, string resourceName, Assembly asm) { IResourceFactory resourceFactory = new DefaultResourceFactory(); var descriptor = new ResourceDescriptor( null, name, resourceName, null, null); var resource = resourceFactory.Create( descriptor, asm); ControllerContext.Resources.Add(name, resource); }
protected void AddResource(string name, string resourceName, Assembly asm) { IResourceFactory resourceFactory = new DefaultResourceFactory(); ResourceDescriptor descriptor = new ResourceDescriptor( null, name, resourceName, null, null); IResource resource = resourceFactory.Create( descriptor, asm); ControllerContext.Resources.Add(name, resource); }