How would you refactor these two classes to abstract out the similarities? An abstract class? Simple inheritance? What would the refactored class(es) look like?
public class LanguageCode
{
/// <summary>
/// Get the lowercase two-character ISO 639-1 language code.
/// </summary>
public readonly string Value;
public L...
In .NET there is the CultureInfo class in the System.Globalization namespace. It has two similar properties both returning values of the CultureInfo type: CurrentCulture and CurrentUICulture.
What is the difference between them?
Which one should I use when and why?
...
Using C#, when a user types a text in a normal textbox, how can you see the Hebrew equivalent of that text?
I want to use this feature on a data entry form, when the secretary puts in the customer name using English characters to have it converted automatically in another textbox to the hebrew representation.
Maybe something with Cultu...
Hi,
My application is currently displaying negative numbers as -1. The users have changed the requirements (just for a change!) and now we will have to display the numbers as (1).
Can I enable that for the whole application say changing the web.config or even the app's CultureInfo ? Is there any side effect of doing that since we have l...
I am using a client application which connects to a remote Database in US. there are some datetime ambiguities that comes up in the result like if date is 14 Jan in database its returned as 13 Jan.
What I would like to know If I Set the CurrentCultureInfo of my Client equal to my Servers will that solve the issue.
If this can be done....
Afternoon people!
I'm trying to implement a list of counties on my Compact Framework (Mobile) application.
I can do this easily in the full .Net framework with CultureInfo.GetCultures(..etc). However, the CF seems to be missing this feature?
Is there any way I can return a list of countries (and regions if possible) that I can populat...
I am getting to the last stage of my rope (a more scalable version of String) implementation. Obviously, I want all operations to give the same result as the operations on Strings whenever possible.
Doing this for ordinal operations is pretty simple, but I am worried about implementing culture-sensitive operations correctly. Especially...
Is there a way of setting culture for a whole application? All current threads and new threads?
We have the name of the culture stored in a database, and when our application starts, we do
CultureInfo ci = new CultureInfo(theCultureString);
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
But, of...
Hi,
I am designing a localized web app. I am leaning on auto-detect browser language setting. But I notice a number of respectable sites asking the user to select a language. Is there any usability issue you know of (from actual experiences out there) with just auto-detecting user language?
Thanks.
...
I'm designing a multilingual application using .resx files.
I have a few files like GlobalStrings.resx, GlobalStrings.es.resx, GlobalStrings.en.resx, etc.
When I want to use this, I just need to set Thread.CurrentThread.CurrentCulture.
The problem:
I have a combobox with all the available languages, but I'm loading this manually:
comb...
I've written a asp.net app and one of my postback routines simply saves user submitted form data to a sql 2005 db. All runs great on my development machine but when I deploy to the live site I'm getting invalid dates from my parse date checker.
Basically it is expecting an american date format on the live machine but this is not what I...
In the US, you use a "." as the separator, but in Germany you use a ",". I'm trying to test whether my logic is smart enough to handle either one but I seem to be failing to put my Windows 2000 machine into German mode.
I went to Control Panel, Regional Options, and changed "Your locale" to "Germany". I then restarted both IIS and SQ...
This is driving me crazy. I have the following string in a ASP.NET 2.0 WebForm Page
string s = "0.009";
Simple enough. Now, if my culture is Spanish - which is "es-ES" - and I try to convert the string to Double, I do the following:
double d = Double.Parse(s, new CultureInfo("es-ES"));
what I'd expect is 0,009. Instead, I get 9. I ...
Hi,
I am using an infragistics webgrid and need to format a currency string. For this I need a string containing a pattern such as "$ ### ###,00" and I would like this to come out of my current CultureInfo. How can I do this?
Do I need to compose it manually from the info in:
CultureInfo.CreateSpecificCulture(myLanguageId).NumberFormat...
What is best practice for the scenario listed below?
We have an application which we would like to support multiple currencies. The software will respect the users locale and regional settings to dictate the correct number format, i.e. $10,000.00 or 10.000,00₴ etc.
We would however like to be able to format different numbers based upon...
I am using XSL transform on XML. Some part of transform are dependent on current locale. Is there any way to find the current locale from within XSL?
For example, the user-visible serialization of a floating point number can vary between locales ("1.0" in English is "1,0" in German), and my transform needs to take differences like these...
I have a WCF service running that needs to parse some data. It turns out that data (points, sizes) gets converted differently in different CultureInfo's and the parsing is spread out in a lot of classes and methods. Since all the parsing is done without passing any CultureInfo the success of the parsing is dependant of the threads cultur...
Hi
I am trying to sort some Japanese shop names using the "aiueo" order
Does anyone know if there is an algorithm to do this
I have written a comparer as follows but I believe the ja-jp culture uses the Unicode sort
internal class JewellerComparer : IComparer<string>
{
private readonly string _culture;
public Jew...
Hi,
Is there any way to determine the local culture of a PC (such as en-US) without running an application? I tried looking in Control Panel | Regional Settings (running WinXP), but I don't know how the choices there map to the PC's culture.
I'm looking for a solution that doesn't require creating an .exe, such as running a command fr...
I'm looking at 1000s of code setting the CultureInfo for ToString and number conversions and date usages. The application is only used on one server, in one town, by one monolingual office and isn't going to move to another country ever.
I think these got there from following misplaced FxCop advice about internationalization.
Is there...