<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Localization</title><link>http://forums.asp.net/151.aspx</link><description>Discuss techniques for localizing content for different languages and locales with ASP.NET.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: IResourceProvider.GetObject() - Culture is always Invariant</title><link>http://forums.asp.net/thread/2702661.aspx</link><pubDate>Thu, 23 Oct 2008 16:16:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2702661</guid><dc:creator>bigtower</dc:creator><author>bigtower</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2702661.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=2702661</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Just wrote&amp;nbsp;a simple &amp;quot;hello world&amp;quot; custom provider, following Rick Strahl&amp;#39;s excellent paper. &lt;/p&gt;
&lt;p&gt;However, as in the original post, Getobject() seems to be called twice, once with culture = invariant, and then a second time with culture= nothing, although my page culture and UiCulture are both &amp;quot;es-es&amp;quot;. Why is Getobject&amp;nbsp; called twice and why is the culture argument an incorrect value both times?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;As in Rick Strahl&amp;#39;s code, if culture= nothing then I just use the CurrentUiCulture in Getobject(). This solves the problem, and the final page gets the correct localized string . But the questions still remain.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks a bunch.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: IResourceProvider.GetObject() - Culture is always Invariant</title><link>http://forums.asp.net/thread/1421328.aspx</link><pubDate>Sat, 07 Oct 2006 09:01:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1421328</guid><dc:creator>rstrahl</dc:creator><author>rstrahl</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1421328.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=1421328</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It turns out I had a problem with the code in GetResourceKeys() which I lifted from DefaultImplictResourceProvider(). The code seemed to work but something must have been wrong with the returned keys as GetObject never did get called.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I posted more info on this here:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.west-wind.com/weblog/posts/4726.aspx"&gt;http://www.west-wind.com/weblog/posts/4726.aspx&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;With the solution in the comments.&lt;/p&gt;</description></item><item><title>Re: IResourceProvider.GetObject() - Culture is always Invariant</title><link>http://forums.asp.net/thread/1421283.aspx</link><pubDate>Sat, 07 Oct 2006 07:15:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1421283</guid><dc:creator>vivek_iit</dc:creator><author>vivek_iit</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1421283.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=1421283</wfw:commentRss><description>&lt;p&gt;Hi Rick,&lt;/p&gt;&lt;p&gt;I am not sure but may be thread agility be one of the issues. Is it possible for you to paste some sample trimmed down version of your code here so that I can also try and figure out what&amp;#39;s happening behind the scenes?&lt;/p&gt;&lt;p&gt;Regards,&lt;/p&gt;&lt;p&gt;Vivek&lt;/p&gt;</description></item><item><title>IResourceProvider.GetObject() - Culture is always Invariant</title><link>http://forums.asp.net/thread/1420442.aspx</link><pubDate>Fri, 06 Oct 2006 10:39:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1420442</guid><dc:creator>rstrahl</dc:creator><author>rstrahl</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1420442.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=1420442</wfw:commentRss><description>&lt;p&gt;So I&amp;#39;ve implement a custom ResourceProvider and ResourceManager. It&amp;#39;s actually working correctly, however, I&amp;#39;m a little confused why the the IResourceProvider.GetObject() method always receives an Invariant culture.&lt;/p&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;IResourceProvider&lt;/font&gt;&lt;font size="2"&gt;.GetObject(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; resourceKey, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;CultureInfo&lt;/font&gt;&lt;font size="2"&gt; culture)&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; value = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;this&lt;/font&gt;&lt;font size="2"&gt;.ResourceManager.GetObject(resourceKey,culture);&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;return&lt;/font&gt;&lt;font size="2"&gt; value;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;On a page that has its UICulture set I can see the GetObject method firing twice for each object (looks like once for precompilation and once for the actual page access. But in both cases the culture is Invariant even though the page&amp;#39;s culture is specific to the user.&lt;/p&gt;&lt;p&gt;It all works anyway - so it looks like the ResourceManager implementation manages to handle the Resource Fallback&amp;nbsp;automatically using the CurrentUICulture instead of the Invariant Culture passed in. Which strikes me as really odd. If I ask the resource manager for the Invariant culture - it should give me that, but instead it&amp;#39;s returning the currentUI culture if there&amp;#39;s an entry for it.&lt;/p&gt;&lt;p&gt;What the heck is going&amp;nbsp;on here?&lt;/p&gt;&lt;p&gt;I have no code that retrieves this data on its own - I simply have a ResourceManager and ResourceReader implementation that provides a ResourceSet and this obviously works since otherwise the data is being fed properly.The resource reader and manager are managing all of this, but what&amp;#39;s the point of the culture parameter if the culture is not actually passed?&lt;/p&gt;&lt;p&gt;+++ Rick --&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>