<?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: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3406926.aspx</link><pubDate>Tue, 15 Sep 2009 20:33:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3406926</guid><dc:creator>geomar</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3406926.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3406926</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Check out Pro ASP.NET MVC Framework By APress.&lt;/p&gt;
&lt;p&gt;1) Create App_GlobalResources folder at the root of your application&lt;/p&gt;
&lt;p&gt;2) Place resx file(s) in the App_GlobalResources folder.&lt;/p&gt;
&lt;p&gt;3) Set BuildAction for each .resx file to EmbeddedResource&lt;/p&gt;
&lt;p&gt;4) The .resx file generates a .cs file.&amp;nbsp;&amp;nbsp;Open the .cs file. &amp;nbsp;You will see that each of the error messages is represented as a property within the .cs file.&amp;nbsp; Change the scope&amp;nbsp;of each&amp;nbsp;property from internal to public.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;(If you place the .resx file(s) into a separate class library project, the UI for .resx will provide a dropdown list to set the properties to public.&amp;nbsp;In this case, you will not have to open&lt;/em&gt; &lt;em&gt;the .cs generated files, neither will you need the App_GlobalResources folder. This dropdown list is disabled when the .resx file resides in the web application.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;5) In web.config under &amp;lt;system.web&amp;gt; enter&amp;nbsp;the following: &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;globalization enableClientBasedCulture=&amp;quot;true&amp;quot; culture=&amp;quot;auto&amp;quot; uiCulture=&amp;quot;auto&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3283056.aspx</link><pubDate>Thu, 09 Jul 2009 08:51:43 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3283056</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3283056.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3283056</wfw:commentRss><description>&lt;p&gt;I needed to add the following entry under &amp;lt;server.web&amp;gt; in the web.config of my mvc app ...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;globalization enableClientBasedCulture=&amp;quot;true&amp;quot; culture=&amp;quot;auto&amp;quot; uiCulture=&amp;quot;auto&amp;quot; /&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Now the data annotations are finally appearing localised &lt;img src="http://forums.asp.net/tiny_mce/jscripts/tiny_mce/plugins/emotions/img/smiley-smile.gif" alt="Smile" title="Smile" border="0" /&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3263603.aspx</link><pubDate>Mon, 29 Jun 2009 08:28:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3263603</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3263603.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3263603</wfw:commentRss><description>&lt;p&gt;How do I get localised (localized) content to appear. If I want french, german, spanish etc to be displayed instead of the english version?&lt;/p&gt;&lt;p&gt;Any ideas?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3259911.aspx</link><pubDate>Fri, 26 Jun 2009 11:07:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3259911</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3259911.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3259911</wfw:commentRss><description>&lt;p&gt;I looked into this some more and it turns out the in the designer of the resources file one must set the &amp;#39;Access Modifier&amp;#39; to &amp;#39;Public&amp;#39; to create the .designer.cs file.&lt;/p&gt;&lt;p&gt;Also in the properties of the .resx file, set the &amp;#39;Build Action&amp;#39; to &amp;#39;Embedded Resource&amp;#39;.&lt;/p&gt;&lt;p&gt;You should now be able to use the &amp;#39;typeof()&amp;#39; method against your resource type.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3255072.aspx</link><pubDate>Wed, 24 Jun 2009 11:09:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3255072</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3255072.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3255072</wfw:commentRss><description>&lt;p&gt;This only worked for me when I converted the .resx into a .cs file. This seems a very awkward solution so I might stick with the web forms approach to localisation and resource files.&lt;/p&gt;&lt;p&gt;Am I missing something with the resource files and having to convert them to .cs files?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3230139.aspx</link><pubDate>Sat, 13 Jun 2009 06:08:03 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3230139</guid><dc:creator>anonymouswrites</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3230139.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3230139</wfw:commentRss><description>&lt;p&gt;I am having my MyResource.resx directly under the model folder but not in side the App_LocalResources. If you want to use your resource values in view then you need to put your Resources in App_LocalRescorces.&lt;/p&gt;
&lt;p&gt;hope this helps&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3225587.aspx</link><pubDate>Thu, 11 Jun 2009 13:03:14 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3225587</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3225587.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3225587</wfw:commentRss><description>&lt;p&gt;Thanks anonymouswrites, I get the &amp;quot;FullNameRequired&amp;quot; bit and understand the &amp;quot;MyResource&amp;quot; bit also, but I&amp;#39;m getting a &amp;quot;&amp;#39;MyResource&amp;#39; could not be found&amp;quot; compile error.&lt;/p&gt;&lt;p&gt;The MyResource.resx file is contained within the &amp;#39;App_LocalResources&amp;#39; folder now under the Model folder where my Data Models are.&lt;/p&gt;&lt;p&gt;I&amp;#39;m struggling to understand how you can reference the resource in a typeof(). Sorry about this as I&amp;#39;m sure it&amp;#39;s very straighforward.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3225506.aspx</link><pubDate>Thu, 11 Jun 2009 12:30:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3225506</guid><dc:creator>anonymouswrites</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3225506.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3225506</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I am having my resource files in the place where I have my model.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;[Required(ErrorMessageResourceName= &lt;span class="st"&gt;&amp;quot;FullNameRequired&amp;quot;&lt;/span&gt;, ErrorMessageResourceType = &lt;span class="kwd"&gt;typeof&lt;/span&gt;(MyResource)]&lt;/pre&gt;&lt;pre class="coloredcode"&gt;As per the example the &lt;b&gt;FullNameRequired &lt;/b&gt;is the key for the  Resource that has error message for validation. and MyResource is the name of my resource file &amp;quot;MyResource.resx&amp;quot;.  &lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3223064.aspx</link><pubDate>Wed, 10 Jun 2009 14:10:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3223064</guid><dc:creator>bmoyno</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3223064.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3223064</wfw:commentRss><description>&lt;p&gt;Hi anonymouswrites,&lt;/p&gt;&lt;p&gt;Could you pass on a bit of advice about using ErrorMessageResourceName and ErrorMessageResourceType with resource files. I am using an MVC app and we are setting the data annotations in the Data Model. Should the resource file (in a App_LocalResources folder) be at the Data Model or where the View is contained?&lt;/p&gt;&lt;p&gt;Also, could you give a concrete example of&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;pre class="coloredcode"&gt;[Required(ErrorMessageResourceName= &lt;span class="st"&gt;&amp;quot;FullNameRequired&amp;quot;&lt;/span&gt;, ErrorMessageResourceType = &lt;span class="kwd"&gt;typeof&lt;/span&gt;(MyResource)]&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;For example, what do &amp;quot;FullNameRequired&amp;quot; and &amp;quot;MyResource&amp;quot; stand for ... just a little confusing looking in.&lt;br /&gt;&lt;/pre&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3189511.aspx</link><pubDate>Wed, 27 May 2009 05:00:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3189511</guid><dc:creator>anonymouswrites</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3189511.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3189511</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks &lt;strong&gt;Nai-Dong Jin&lt;/strong&gt; for your reply.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I am not getting any error or expection. The error message is not displayed, if I specipfy the name and type of the resource file. But if I use the ErrorMessage attribute it works.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3189356.aspx</link><pubDate>Wed, 27 May 2009 02:58:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3189356</guid><dc:creator>Nai-Dong Jin - MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3189356.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3189356</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;From your description, it seems that you get the error when you use ErrorMessageResourceName attribute, right?&lt;/p&gt;
&lt;p&gt;As you didn&amp;#39;t provide the error details, I just list some general error causes related to that attribute for you to refer.&lt;/p&gt;
&lt;p&gt;This property specifies the error message resource that is associated with a validation control. You can use this property to specify a resource file that contains localizable error messages. &lt;/p&gt;
&lt;p&gt;Note the exception type:&lt;/p&gt;
&lt;p&gt;InvalidOperationException : If the ValidationAttribute is already in explicit mode or if you set the property multiple times. &lt;br /&gt;&amp;nbsp;&lt;br /&gt;ArgumentException :&amp;nbsp;If the value of error message is nullNothingnullptra null reference (Nothing in Visual Basic). &lt;/p&gt;
&lt;p&gt;Thanks.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Localization in System.Data.ComponentModel.DataAnnotations</title><link>http://forums.asp.net/thread/3185482.aspx</link><pubDate>Mon, 25 May 2009 09:53:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3185482</guid><dc:creator>anonymouswrites</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3185482.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=151&amp;PostID=3185482</wfw:commentRss><description>&lt;p&gt;I am having some issues with localization in System.Data.ComponentModel.DataAnnotations&lt;/p&gt;&lt;p&gt;&amp;nbsp;If I set the error message as string it works. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;[Required(ErrorMessage = &lt;span class="st"&gt;&amp;quot;Name is required.&amp;quot;&lt;/span&gt;)]&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;&lt;span class="kwd"&gt;public string&lt;/span&gt; FullName{ &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; }&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;p&gt;but if i set error message as resource it doesnot work.&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;[Required(ErrorMessageResourceName= &lt;span class="st"&gt;&amp;quot;FullNameRequired&amp;quot;&lt;/span&gt;, ErrorMessageResourceType = &lt;span class="kwd"&gt;typeof&lt;/span&gt;(MyResource)]&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;&lt;span class="kwd"&gt;public string&lt;/span&gt; FullName{ &lt;span class="kwd"&gt;get&lt;/span&gt;; &lt;span class="kwd"&gt;set&lt;/span&gt;; } &lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;any suggestions??? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>