culture

JavaScript: Format number/currency w/regards to culture like .NET's String.Format()?

喜你入骨 提交于 2019-12-04 11:00:25
This seems like a problem someone would've already solved in the year 2009, but I can't find a decent JavaScript library that will take a number like: 12345.58 And format it correctly based on a specific culture (ie, "nl-nl") or ISO currency code. dojo showed promise, but it doesn't include many cultures by default, and actually wasn't working properly in my tests. I basically want something that is 100% or near-100% equivalent to what .NET does for me, when I run: String.Format([cultureInfo Object], "{0:N}", myValue) ' for numbers and String.Format([cultureInfo Object], "{0:C}", myValue) '

Register custom culture in Windows Azure

懵懂的女人 提交于 2019-12-04 09:02:00
I am currently developing an ASP.NET MVC 4 app for the African market and was hoping to register a custom culture using the steps detailed in the following link http://msdn.microsoft.com/en-gb/library/system.globalization.cultureandregioninfobuilder.register(v=vs.110).aspx . Most of my target countries are not in the pre-installed cultures so it sounds like I need to register these cultures. Problem is, my console app for doing the registration will need admin previlidges to complete the culture registration. I am presuming windows azure does not allow developers admin control of the cloud

Change culture of Silverlight application

梦想的初衷 提交于 2019-12-04 08:02:38
I am working on a Silverlight app at the moment. I have a few datagrids/textblocks where I use standard binding to show values, some of which are dates. e.g. <sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Path=MyCollection}"> <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding Path=Name, Mode=OneWay}" Header="Agent"/> <sdk:DataGridTextColumn Binding="{Binding Path=UpdateTime, Mode=OneWay}" Header="Update Time"/> </sdk:DataGrid.Columns> </sdk:DataGrid> <TextBlock Text="{Binding Path=LastUpdatedTime}"/> This binds fine but the dates are always

Loop through embedded resources of different languages/cultures in C#

ε祈祈猫儿з 提交于 2019-12-04 05:44:24
One level up from this question , what would be the way to store all (and loop through) available resources and associated cultures, to allow user selection of a specific culture? Further explanation: Suppose three resource files: GUILanguage.resx GUILanguage.fr.resx GUILanguage.it.resx I could have a string in each called LanguageName . How would I be able to programmatically loop through the different LanguageName values to list them (in say a list box)? EDIT: WinForms project, embedded resources. Here is a solution I think works for Winforms: // get cultures for a specific resource info

C# WebBrowser Control Globalization

為{幸葍}努か 提交于 2019-12-04 05:22:42
问题 I am making an application in C# using the WebBrowser control. Problem is i am not from an english speaking country and that control seams to send an english language instead of Current Culture. So for example, sites like google will always show up in english instead of portuguese, as it appears in IE, FF, Chrome or Opera. Is there a way to change that control's page request culture to the current system's culture, or any arbitrary culture for that matter? 回答1: I've tried various means to

<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

Displaying proper date format depending on culture

你。 提交于 2019-12-03 21:06:10
问题 I am using a control for a popup calendar date picker. This uses a javascript function, SetText, to set the textbox to the given date. I can't change anything in the calendar control itself but I can override the SetText function. The SetText javascript just takes the TextBox name and the date value in string format and sets the TextBox to the string. The problem: I need to display the date in the format "April 30". Easy to do. Use getMonth() and getDate() where I can parse the information

C# BackgroundWorker's culture

被刻印的时光 ゝ 提交于 2019-12-03 15:12:02
问题 I woudl like to set the culture for my whole application. I tried the following : Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(wantedCulture); Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture(wantedCulture); Application.CurrentCulture = CultureInfo.CreateSpecificCulture(wantedCulture); It works for the current thread, but later on I create and start a background worker thread. When I create the worker, the current thread executes with the

Java equivalent of Invariant Culture

放肆的年华 提交于 2019-12-03 09:33:36
I am converting the following C# code to Java. Is there a Java equivalent to the .NET concept of Invariant Culture? string upper = myString.ToUpperInvariant(); Since the Invariant Culture is really just the US culture, I could just do something like this in Java, but I'm wondering if there is a better way: String upper = myString.toUpperCase(Locale.US); Update: Java 6 introduced Locale.ROOT which is described as: This is regarded as the base locale of all locales, and is used as the language/country neutral locale for the locale sensitive operations. This is probably better than using US, but

Persian Calender in MVC , Asp.net

断了今生、忘了曾经 提交于 2019-12-03 08:20:49
I use a DateTime variable in MVC and I want to show Persian calender for @Html.EditorFor(x=> x.ProductionDate) How can I do it? Ahmad I found the solution 1.Go to www.amib.ir/weblog/?page_id=316 and download the latest version of "AMIB_jsPersianCal" 2.Add "js-persian-cal.min.js" and "js-persian-cal.css" and "pcal.png" to your project you can change the css for specified the Url of PNG file 3.Add the css and js file to your cshtml file <link href="@Url.Content("~/Content/js-persian-cal.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/js-persian-cal.min.js")"><