globalization

How to call EnumSystemLocales in Delphi?

感情迁移 提交于 2019-12-04 02:48:07
i am trying to call EnumSystemLocales in Delphi. For example: { Called for each supported locale. } function LocalesCallback(Name: PChar): BOOL; stdcall; begin OutputDebugString(Name); Result := Bool(1); //True end; procedure TForm1.Button1Click(Sender: TObject); begin EnumSystemLocales(@LocalesCallback, LCID_SUPPORTED); end; The problem is that the callback is only being called once. Note: EnumSystemLocales is returning true, indicating success. The remarks of EnumSystemLocales says that my callback must return true to continue enumerating (or more correctly, must not return false to continue

Localization in ASP.Net core MVC not working - unable to locate resource file

萝らか妹 提交于 2019-12-03 23:56:56
In trying to localize my application, I've followed the steps here: https://docs.asp.net/en/latest/fundamentals/localization.html Here is my code: Startup.cs public List<IRequestCultureProvider> RequestCultureProviders { get; private set; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddLocalization(options => options.ResourcesPath = "Resources"); services.AddMvc() .AddViewLocalization(options => options.ResourcesPath = "Resources") .AddDataAnnotationsLocalization(); services

<system.web> globalization in .net core

梦想与她 提交于 2019-12-03 22:19:49
I have been using the following setting the the web.config of my previous application. <system.web> <globalization culture="en-AU" uiCulture="en-AU" /> </system.web> Now in my new .net core project I don't know how to put this setting in the appsettings.json file. Thanks for your help, Nikolai The localization is configured in the Startup class and can be used throughout the application. The AddLocalization method is used in the ConfigureServices to define the resources and localization. This can then be used in the Configure method. Here, the RequestLocalizationOptions can be defined and is

Externalizing the translation of a WinForms application?

最后都变了- 提交于 2019-12-03 16:29:47
I'm working on an application that will be deployed in a lot of different countries, which of course means different languages. The thing is that I would not translate it myself, nor the other developers. One of the user will translate it and he won't have access to Visual Studio. The question is, how to do that? Is there a tool available to edit resx files and seeing the text in the context of the application? Moreover, is it possible to add a translation file to the already compiled application? Gorgen As food for thought try these links: Are resx files suitable for internationalization .NET

How to display localized date and time information to web users with ASP.NET

孤街醉人 提交于 2019-12-03 13:09:27
I have an ASP.NET application and a UTC time stamp on the server. I want to display the time stamp to the user in the right time zone and using local date/time format . E.g. Jan 2, 2012 14:00:00 UTC should show as 1/2/2012 9:00 AM to a user in New York, United States (UTC -0500) and as 02/01/2012 14:00 to a user in London, UK. This seemingly simple task proved to be surprisingly difficult. MSDN has an article with the same title, but it talks about parsing user input rather than displaying server-side data, so it does not fully apply. Time zone offset is easily determined on the client via

How Do You Write Code That Is Safe for UTF-8?

淺唱寂寞╮ 提交于 2019-12-03 12:25:46
问题 We have a set of applications that were developed for the ASCII character set. Now, we're trying to install it in Iceland, and are running into problems where the Icelandic characters are getting screwed up. We are working through our issues, but I was wondering: Is there a good "guide" out there for writing C++ code that is designed for 8-bit characters and which will work properly when UTF-8 data is given to it? I can't expect everyone to read the whole Unicode standard, but if there is

Should I use DateTime.Now or DateTime.UtcNow in HttpCookie.Expires and HttpCachePolicy.SetExpires?

半城伤御伤魂 提交于 2019-12-03 10:54:39
Should I use DateTime.Now or DateTime.UtcNow in HttpCookie.Expires and HttpCachePolicy.SetExpires ? Cookies are sending 'GMT' time, but I don't know what happen if I send DateTime.Now.AddDays(3) if I would be in GMT+5. Same with Expires HTTP header (sec 14.21) . What should I use? It doesn't matter in this case. Internally, the first thing .SetExpires does is convert your supplied datetime into UTC, before setting it on the cookie. Bear in mind, as long as your datetime consumer uses the DateTime class correctly, then the two are the same - it is just that one is "baselined" to UTC and the

MVC3 globalization: need global filter before model binding

自作多情 提交于 2019-12-03 10:38:26
Currently, I have a global filter called GlobalizationFilter that checks the route values, cookies and browser languages header to determine the correct culture settings for the request: public override void OnActionExecuting(ActionExecutingContext filterContext) { // determine cultureInfo Thread.CurrentThread.CurrentCulture = cultureInfo; Thread.CurrentThread.CurrentUICulture = cultureInfo; } It all works, but the model binding process seems to occur before the global filters, and so the model binder doesn't take the culture settings into account. This leads to problems with interpreting

MVC3 globalization not set for ModelState.Value.Culture

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: 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 ; although it should be 7