culture

Should i use ISO 3166 country codes (US) or culture codes (en-US) ?

ISO 3166 has a list of 2 character country codes such as US, UK, FR. A shopping cart I've used has both these codes and also the culture codes such as en-US or en-UK. For a separate project I thought that the longer code is more useful because it at the very least tells me the language used by that country. But i cant seem to find an a...

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

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'...

How to change Culture?

Hi! Sorry my very poor english ... I'm using asp.net control toolkit to do a calendar on asp.net mvc, and it works fine! But it is in english format date. How can i change to pt-BR culture? I read lot of sites, but i couldn't implement on my project. Anyone could put a link to show me a valid implementation about culture? And why put...

Override culture when using GetGlobalResourceObject or GetLocalResourceObject in ASP.NET

I've implemented localization in this ASP.NET project using resource files and that's working as expected. But there is one situation where I have to display the whole page in one language and then a section of it in some other language based on the selection from a dropdown list. From what I can see, the GetGlobalResourceObject() and G...

Choosing routing.yml based on user culture?

In my Symfony application I would like to choose the routing.yml based on the current user's culture; 'en' => routing.en.yml 'no' => routing.no.yml and so forth. Any suggestion to how this can be done? Edit: I am not trying to do i18n this way - I use Symfony's built-in methods for that. I simply want "static" urls to reflect the us...

Localized tables and Entity Framework

Hi all, I have a scenario where I need to localized values of objects in my database. Let's say you have an application that can create animals, if the user is english the value of the "Name" property of an animal would be entered as "Cat" in the UI whereas it would be entered as "Chat" in french. The animal culture table would contai...

Culture problem reading formatted decimal values

Hi, I have an console application (that also is run as a service when deployed). I'm reading values that originates from a text file. The problem is that I can't get the decimal values to work properly. They are formatted in a "swedish way", like this 3,4 which in "english" formatting is 3.4. When I use: Decimal.TryParse(value, Numbe...

.NET How to compare two Strings that represent filenames ignoring case correctly

Given that (at least on NTFS) the filesystem on Windows is case insensitive, I would like to compare String fileA to String fileB as such: fileA.Equals(fileB, StringComparison.CurrentCultureIgnoreCase) The question then becomes which culture I should use, does the default current (ui?) culture suffice? I can't seem to find any BCL met...

Saving DateTime object on UK Dev Server vs US Live Server

I have a site that saves a date in my model to the database. After launching my site I realised that the server has US regional settings so I had to make sure that all date's on the public site were formatted in the UK format. However now when I go to my 'Create' page and choose a date and click save I get the error The value '22/11/20...

Culture-conversion in C# with DateTime

I'm having trouble getting my ASPX-App to work on the productive server. As my local environment is german but the server is english and my whole code didn't provide culture-support, I'm currently implementing that throughout the script. As you might think, as I'm writing this in here, it doesn't quite work the way I want it to. The Ap...

date format in asp.net versus in console application

I'm deploying a .NET applications to another machine. in console application, the value of DateTime.Today.ToLongDateString(); is 10 December 2009 while in web application the value is 23 ذو الحجة 1430 < equivalent in higri calendar How does the web application get the culture from, and why is it different than the console a...

GetGlobalResourceObject or Resources.Resource - what's better?

Hello, I have an application that is multilingual. I'm using the out-of-the-box .Net features for this. Each language has its own file in the App_GlobalResources (see iamge below) In the code behind what is better? GetGlobalResourceObject("LocalizedText", "ErrorOccured") Resources.LocalizedText.ErrorOccured The 2nd one uses less cod...

Is it possible to get Character after "Shift" has been pressed, without pressing shift?

Is it possible to get the Character if "Shift" was Pressed, ie. if i press "1" I get the "1" character, but if I hold down "Shift" it becomes "!" - all without the quotes of course. I want to to something like this programatically. There was a method where you could just add to the ASCII code however this option is not suitable as it won...

Is 'culture' (eg. es-MX, en-US) meant to localize website -content- or -appearance-?

Hi, is the concept culture (as with .NET CultureInfo) to be used solely in localizing appearance of a website (language, date- and numberformatting etc.), or can it be used for localizing website content (location-bound newsmessages, contactdetails etc..)? I need to build a website which supports both multiple-languages as localized co...

ASP.NET MVC output cache for multinenant application, vary by hostname and culture

I have a multitenant application in ASP.NET MVC. The instance of the application that will be served is function of the hostname alone (something along the lines of stackexchange, I suppose). Each instance of the application might have a different culture setting (even "auto", to read the browser's language and try to use it), and will ...

NHibernate number format problem - where do I set the culture?!

LATER EDIT : It was me :( It was a non-nullable column left unfilled. Sorry to everyone I confused.. I am having issues with an INSERT statement generated by NHibernate because it formats the decimal numbers using the regional settings. The generated statement goes something like : exec sp_executesql N'INSERT INTO [TableName] ( Co...

Display correct currency dependent on browser culture

Hi My website will target UK and US markets, and i need to display a different price/currency for both markets - what is the best way around this? 1) a simple drop down box asking users preference? 2) Using culture class in asp .net to auto detect eg System.Threading.Thread.CurrentThread.CurrentUICulture ...or is there another better ...

Is it possible to make a date datatype accept 13 as a month and 30 for all months?

I am in Ethiopia and we have 13 months. 12 of them with 30 days each and 13th month with 5 or 6 days. I want to sort my data by date using the BindingSource sort method. But to do that, I need to set my date field a date data type. When I set the DataType to date, I can't enter some values like 13 for the month value and 30 for day value...

Culture Issue with ASP.NET used on Shopping Cart

I'm developing a shopping cart, and part of the functionality is to select your currency. I have a drop down list, and when the selected index changes I've written some code to find the culture code (such as en-GB or en-US) and then change the culture of the current session. In addition, using the exchange rates given it changes the pri...

Calculate week number within month.

Possible Duplicate: Calculate week of month in .NET I need to calculate the week number of a given Date within a month. The reason I embolden month is that all the examples (on here and elsehwere) I come across are based on yearly. Basically, I want to see what week number 14/2/2010 comes in (dd/MM/yyyy format). Given a starti...