globalization

MVC3 globalization not set for ModelState.Value.Culture

霸气de小男生 提交于 2019-12-08 04:11:03
问题 i have set culture in Action Filer as Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); where culture = {fr-be} =>French Belgium. FYI, this action filter sets the culture on user choice. in one of myAction user is entering Date in format [dd/mm/yyyy] => 26/7/2011. Action is as follows public ActionResult RequestVacation(VacationRequest model) { if(ModelState.IsValid) { .... when i dubug the code model.VacationDate contains 01/01/0001 ;

Get current culture using just formula for localization purpose

北城以北 提交于 2019-12-08 02:34:31
问题 Is there a way how to determine current system culture using a formula in Excel wihout using any VBA code ? I imagine something simple like this: IF(CULTURE="sk-SK","Prehľad","Overview") or also something like this would do for me: IF(CURRENCYSIGN="€","Prehľad","Overview") I am looking for a simple way to globalize XLSX file without any additional resources or files needed. 回答1: No, there is no way to get system language settings without VBA. There is simply no built-in function for this. But

How to refresh localized attributes in PropertyGrid

余生颓废 提交于 2019-12-07 16:29:08
问题 I have problem with my localized attributes such as: public class LocalizedDisplayNameAttribute : DisplayNameAttribute { public LocalizedDisplayNameAttribute(string resourceId) : base(GetMessageFromResource(resourceId)) { } private static string GetMessageFromResource(string resourceId) { var propertyInfo = typeof(Lockit).GetProperty(resourceId, BindingFlags.Static | BindingFlags.Public); return (string)propertyInfo.GetValue(null, null); } } When I'm using properties with this attribute it's

HttpContext.GetGlobalResourceObject always returns null

和自甴很熟 提交于 2019-12-07 12:03:38
问题 I created two files in the App_GlobalResources folder: SiteResources.en-US.resx SiteResources.sp-SP.resx Both contain a value for "SiteTitleSeparator". Here is what I am trying to do (The following line always returns null): string sep = (string)GetGlobalResourceObject("SiteResources", "SiteTitle"); Note, that the Culture property on the page is set. Answers in both VB and C# will be welcomed. 回答1: I changed the name of SiteResources.en-US.resx to SiteResources.resx and now everything works

Generating Resx files for MVC

吃可爱长大的小学妹 提交于 2019-12-07 08:49:20
问题 We use resx files for globalization, along with database lookups for things that can be configured (such as tab names, which can be different by product) by our CS staff, and thus aren't known at design-time. I created a custom tool that reads resx files and intelligently dumps the key/value pairs into a relational database (matching values so we don't have duplicates). This has been a big help to our business - we don't have to send each resx for translation (and pay for duplicate

Xml Schemas and Date Times

梦想的初衷 提交于 2019-12-07 03:24:27
I'm beginning a new project which involves heavy xml and schema use accross multiple platforms (windows, windows mobile, Iphone, Ipad, and more which are yet to be discovered!). This xml platform has to be able to exchange date times from all over the world as our product is currently being implemented in Australia as well as in Canada and USA. Date times are generally the one "type" that causes the most issues between different platforms and languages. Should I trust the built in date type? or should I break down each date into it's subsections, e.g. elements or attributes for hours, mins,

Best place to set CurrentCulture for multilingual ASP.NET WebAPI applications

北慕城南 提交于 2019-12-07 01:05:54
问题 based on this question (Best place to set CurrentCulture for multilingual ASP.NET MVC web applications) I'm looking for a global way to do the same for ASP.NET WebAPI. My current implementation for ASP.NET MVC looks like this: public class MvcApplication : System.Web.HttpApplication { protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig

Best way for multi-language sites virtual Directories

。_饼干妹妹 提交于 2019-12-06 22:07:28
I have a site that will ultimately support 4 languages and 2 countries (US & Canada, English and Spanish) I'm wondering what's the best way to set up the directory structure? Right now, I have a root site called site.com: This will take you to a page where you choose your country and language. Ideally, I want to have the directory like so: site.com/ca/en/ (Canada English) site.com/ca/fr/ (Canada French) site.com/us/en/ (US English) site.com/us/es/ (US Spanish) But that will mean I will be putting a "ca" and a "us" virtual directory and language virtual directories inside that. IS that good

Is it possible to force the currency for an MVC3 field with DataType as DataType.Currency

感情迁移 提交于 2019-12-06 21:36:44
问题 I'm writing an MVC3 application that reads in a bunch of monetary data from a database. The issue I have is that these amounts are all in different currencies. If I set the type of a field like this: [DataType(DataType.Currency)] public Amount{ get; set;} I get the decimal places and a currency symbol, which looks nice, but it defaults to the user's local currency. A US user sees $423.29 whereas a GB user sees £423.29 . I can override the currency by using a <globalization culture="{something

Translating a Visual Studio project

筅森魡賤 提交于 2019-12-06 14:19:41
问题 I have a big project written in my native language (hun) in c# with Visual Studio 2012. I'd like to translate it to english. Of course if I get a text in hungarian, I can translate it, so the point is not about how to translate a text, but how to make the whole translation easier. I don't need the software to change the language while runtime, it is also ok if I get a different project with a different language. One way is go go through the whole project and change all the labels, but that's