MVC Validation: Same project, different languages: why? - asp.net-mvc

When I start my MVC application and try to sumbit a form with an empty field than validation is fired and the following message appears (german):
Das Feld "Telefon" ist erforderlich.
If i do the same on my bosses computer, the message is
The Telefon field is required.
I checked if out windows settings for region and language are different, but they are the same? What else could be the reason?
EDIT
Solution is to install 'Microsoft .NET Framework 4 Extended DEU Language Pack' (or your perferred language) and to add the culture information in Views/web.config in the <system.web>-Part:
<globalization culture="de-DE" uiCulture="de-DE"/>

On your computer you probably installed the German localized version of the .NET Framework so all error messages are coming from the localized satellite assemblies. Phil Haack blogged about localizing validation messages.

In most browsers you can specify your preferred languages. These can be different from your windows settings.

Check the Accepted-language request header.

Related

MVC CultureInfo language-code needed for Hmong

I am working on a MVC project that will have its pages in English, Spanish, and Hmong using CultureInfo. I am unsure what language code I should use for the Hmong translations. I haven't found anything related to it other than other than hmn(ISO 639-2 Code). Should I use this or something else?
You may find Hmong to be a few different culture codes. Our plant workers use a dashboard we wrote and their version of spoken Hmong most closely resembled vi-VN . So that is the culture code we use when our Hmong workers switch their displays to their translated language.

Allowing user to enter French,Spanish and Korean language in content of Umbraco input Control

We are using Umbraco web application in English language. We need to add
French,Spanish and Korean language in our application where we should be allow user to type and add content in French,Spanish and Korean language.
Question : How we can allow user to input content in French,Spanish and Korean language . Note* : Default language of system is English.
Please help me to get out of this.
Thanks in advance.
Currently Umbraco doesn't have built in language variants - so the classic way to do it is to create language specific "sites" as described here: https://our.umbraco.com/documentation/tutorials/multilanguage-setup/
A different solution could be to use the Vorto package. Vorto wraps itself around your existing datatypes, allowing you to put in an extra "layer" so every property can have different values/settings for each language in your site.
There's a link to it here - with instructions on how to get started using it:
https://our.umbraco.com/packages/backoffice-extensions/vorto/

Localising ASP.NET MVC JQuery Validation on Azure

I am developing a website to support both Arabic and English. Now, when on the development I only need to use DisplayAttribute to localize field names and set the thread to the appropriate culture, and then ASP.NET generates a localized error message using my DispalyAttribute names.
However, when deploying on Azure, and when I switch to Arabic, everything is localized correctly but error messages. In which the names are localized but the error itself is in English.
I could use ErrorMessageResourceType explicitly, but would like to know where is the discrepancy.
Note: I set thread culture at Application_BeginRequest of Global.asax.
I made a little hack to know where the issue is. I created my own ValidationAttribute which basically reports current culture name instead of the error message. It turned out that the culture is properly set, and that it seems Azure version of DataAnnotationResources might not include Arabic.

MVC validation messages - localization?

I have a problem. On main server and localhost are the exacly the same files.
But in localhost I have messages in my home language, like
Pole Email jest wymagane.
And on main server I have:
The Email field is required.
As I said, files are exacly the same.
How to resolve it?
Do you happen to have
<globalization enableClientBasedCulture="true" uiCulture="auto" culture="auto">...</globalization>
in your web.config? This would automatically switch the culture of the site to suit the language passed via the browser request i.e. Accept-Language.
If you want to force the language from the server just set enableClientBasedCulture to false.
I had the same problem, the solution for me was to install the correspondant language package in the server (https://support.microsoft.com/en-us/help/14236/language-packs). Inmediatly after that, the validation messages started appearing in the desired language.

Swap English to Spanish in ValidationMessageFor Method Dynamicaly

My Models / data silos are in a different class library which contain data annotation - Required, Max Length and some custom validation. This all works great in English however is there a way to swap the English validation message for the Spanish using a global resource file contained in the web project. The class library is used both on the web site and other components so I cannot be assured that the resource file will be in the same project.
Assuming you are talking about a .Net MVC application, I suggest you have a look at this blog post about internationalization in MVC3:
http://afana.me/post/aspnet-mvc-internationalization.aspx
For a project I am currently working on, we decided to place the resource-files in a separate project, so that we could keep all the resource-strings in one place, and then simply referring to the language-project from any other project that needs multi-lingual support.

Resources