logo
down
shadow

ASP.NET MVC: Localization issues (wrong resx file for culture)


ASP.NET MVC: Localization issues (wrong resx file for culture)

By : user3854064
Date : October 28 2020, 08:00 PM
To fix this issue Do you have a Neutral Resources Language specified anywhere? If it is set to "nl" or "nl-NL", any request for a resource that is not found will eventually end up fetching the "nl" resource. Since you do not have a Strings.en-US.resx or Strings.en.resx, setting CurrentUICulture to "en-US" would make the system use the neutral resources language.
code :


Share : facebook icon twitter icon
.resx file (culture-specific) with singleton pattern?

.resx file (culture-specific) with singleton pattern?


By : Michele Bottarelli
Date : March 29 2020, 07:55 AM
To fix the issue you can do I found a fairly straight forward approach for internationalization in ASP.NET MVC3 that I thought may give you a different angle to consider / compare your current approach with.
http://afana.me/post/aspnet-mvc-internationalization.aspx
Windows forms localization using *.resx and Common.resx

Windows forms localization using *.resx and Common.resx


By : chishirikiseimi
Date : March 29 2020, 07:55 AM
I wish did fix the issue. From my experience I can say:
You will be better of to create one locatization resx file for all the forms. Assign all localizable strings manually (I did that in constructor). Store each string for each form in different localizable property, like Form1_OkButtonText, Form2_OkButtonText.
MVC5 Localization with culture in route - issues with having an Area

MVC5 Localization with culture in route - issues with having an Area


By : user2594139
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , I had exaclty the same problem following this internationalization post and solved it by adding area = AreaName as a parameter of the default area route and area = "" as a parameter of the default route:
Area route configuration:
code :
    public override void RegisterArea(AreaRegistrationContext context) 
    {
        context.MapRoute(
            "myarea_default",
            "{culture}/myarea/{controller}/{action}/{id}",
            new { action = "Index", culture = string.Empty, area = AreaName, id = UrlParameter.Optional }
        );
    }
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        //routing to include culture
        routes.MapRoute(
            name: "DefaultWithCulture",
            url: "{culture}/{controller}/{action}/{id}",
            defaults: new { culture = string.Empty, controller = "Home", action = "Index", area = "", id = UrlParameter.Optional }
        );
    }
How to get a RESX string by passing culture, not using thread culture

How to get a RESX string by passing culture, not using thread culture


By : user3447632
Date : March 29 2020, 07:55 AM
it helps some times I think I have now figured this out via a Helper method.
1) Add your RESX files and set them to have 'public' access modifier
code :
public static class Lang
{        
    public static string GetGlobalString(string key, string language)
    {
        CultureInfo ci = new CultureInfo(language);
        ResourceManager rm = new ResourceManager(typeof(MyNamespace.ResourceClass)));
        return rm.GetString(key, ci);
    }
}
@Lang.GetGlobalString("String1", "de-DE")
@Lang.GetGlobalString("String1", "en-GB")
Localization alternative to Resx file

Localization alternative to Resx file


By : Chris Day
Date : March 29 2020, 07:55 AM
hope this fix your issue One reason for relying on established approaches instead of implementing your own format is translation. It really depends on how your resources are translated: if it is done by volunteers with a technical background who don't mind working in a plain text editor, then you are free to come up with your own resource format. If on the other hand you send out your resources to professional translators who are not very technical and who prefer to work in a translation environment with integrated terminology management, translation memory, spelling and quality checks etc. it is quite likely that this environment will not be able to handle your homemade resource format.
Since I already mentioned professional translation environments: some of these tools rely on IDs to figure out which strings are old and which are new. If you use the approach that the text is the ID every fixed typo in your source language means that you create a new string that needs to be translated - and paid for. If the translator sees that the source text for a string has changed he can have a look at the change, notice that a typo has been fixed, decide that the translation is still OK and sign the string off, without extra translation cost.
Related Posts Related Posts :
  • How to use Selenium Grid with C#?
  • What is the best way to download files via HTTP using .NET?
  • How to get files from a device using USB
  • Given a user's SID, how do I get their userPrincipalName?
  • NHibernate mapping in Asp.Net using MySql
  • Why do some cookies have a '.' before the domain?
  • C# SqlDataReader = null?
  • InvalidCastException for two Objects of the same type
  • "The parameters dictionary contains a null entry for parameter" - How to fix?
  • Font family name from font file
  • What is the best way to generate KML files in C#?
  • How can I receive mail using .NET?
  • How to send raw data over a network?
  • meaning of '+='
  • Object reference not set to an instance of an object #5
  • C# Create "wireframe"/3D "map"
  • How to change size of database
  • Serialization problem
  • Using unmanaged code from managed code
  • Are there any bindings between .NET and TK
  • error with linq join
  • VB.NET equivalent to C# var keyword
  • Accessing object properties from string representations
  • Inheritance issue
  • C# timer won't tick
  • How to retrieve items from a database c#
  • Sending mail using SmtpClient in .net
  • Tag problem c# listbox
  • How to know if the Form App open or not c#
  • C# XPath id() not working?
  • Load PDF from Memory ASP.Net
  • C# ListView with a ProgressBar
  • Getting the right WPF dispatcher in a thread
  • How to create Pivot table using C#?
  • how to download a file from remote server using asp.net
  • Binding files in C#?
  • Copy one object to another
  • How to post on Google Buzz?
  • Generic <T> how cast?
  • Set global hotkeys using C#
  • Change the key being pressed with C#
  • Uploading Large Files
  • How do I get the duration of a video file using C#?
  • how to create instance for a generic type in c#
  • Drag and drop rectangle in C#
  • RSA Encryption C#
  • Title=
  • What is meant by Web Services?
  • The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via
  • Check if server exists
  • time interval in c#
  • Extracting a sub-string in C#
  • C# - Programmatically Log-off and Log-on a user
  • c# array vs generic list
  • TCPClient in C# (Error)
  • How can I know if a file has been changed in .NET C#?
  • New to C# and trying to use a global variable
  • Convert RGB color to CMYK?
  • Tesseract.NET in C#
  • Is it possible to Update Sharepoint List Without "ID"?
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk