Home > DeveloperSection > Forums > Localizing-ASP-NET-MVC3
jayprakash sharma
jayprakash sharma

Total Post:117

Points:821
Posted on    September-28-2013 4:11 AM

 ASP.NET MVC ASP.NET MVC 
Ratings:


 1 Reply(s)
 770  View(s)
Rate this:
I'm creating a Localizing application ASP NET MVC3 but the problem is that when i add Resource.resx file in root folder access modifier is disabled so helping for enable access modifier this is code my LanguageResources.Designer.cs file
namespace Resources {
using System;      [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "10.0.0.0")]
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
        internal class LanguageResources {
 
            private static global::System.Resources.ResourceManager resourceMan;
 
            private static global::System.Globalization.CultureInfo resourceCulture;
 
            [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
            internal LanguageResources() {
            }
 
            /// <summary>
            ///   Returns the cached ResourceManager instance used by this class.
            /// </summary>
            [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
            internal static global::System.Resources.ResourceManager ResourceManager {
                get {
                    if (object.ReferenceEquals(resourceMan, null)) {
                        global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Resources.LanguageResources", global::System.Reflection.Assembly.Load("App_GlobalResources"));
                        resourceMan = temp;
                    }
                    return resourceMan;
                }
            }
 
            [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
            internal static global::System.Globalization.CultureInfo Culture {
                get {
                    return resourceCulture;
                }
                set {
                    resourceCulture = value;
                }
            }
 
            /// <summary>
            ///   Looks up a localized string similar to Hii this my site.
            /// </summary>
            internal static string welcome {
                get {
                    return ResourceManager.GetString("welcome", resourceCulture);
                }
            }
        }
    }

and i'm also add globalization in web.config file

<system.web>
<globalization uiCulture="auto" culture="auto"/>
</system.web> 

 



Pravesh Singh
Pravesh Singh

Total Post:101

Points:709
Posted on    September-28-2013 6:43 AM

Hey Jay!

I would suggest you to put the resource files in a separate class library and also you have to set theCustom Tool type of the resource file to PublicResXFileCodeGenerator.


Don't want to miss updates? Please click the below button!

Follow MindStick