📜 ⬆️ ⬇️

Games with localization

In connection with the release of a localized version of Visual Studio 2010 and the publication of several articles on this topic, there was a desire to see personally what kind of an animal this is - the Russian version of Visual Studio 2010! So I went to the Microsoft website and downloaded the trial version of VS2010 and it began ...

At first, I thought I would start with 10 reasons why the localized version is cool, but I stalled at the first point ... But the localization question is still quite interesting - so the article decided to roll out all the same - this information may be useful to someone.


How to overcome localized messages with exceptions?


If you have a Russian edition of Windows (which is more realistic than Visual Studio 2010), then you must have encountered a problem when all the error messages are localized. I do not know about you, but for me it is not always convenient.
')
Let's create a simple example ala “Hello World!” And write the following code:
try
{
throw new ArgumentNullException( "param" );
}
catch (Exception ex)
{
Console .WriteLine(ex.Message);
}

Console .ReadLine();
Run the project and get the following message:

The value can not be undefined. Parameter name: param

In order for the message to become English, you must add the following line before try:
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(«en-US»);
After this voila:

Value cannot be null. Parameter name: param

It is important to note here that the CurrentCulture property is often used instead of CurrentUIC - in this case nothing will change and the message will still be localized. The reason is that CurrentCulture affects time settings, currency conversion, formatting and string comparison, and does not affect the localization of messages in any way.

But there is another solution ...

Finder


Website: http://finderr.net/

This site is designed for those who want to get the English version of errors and do not want to play with streams and cultures.

We drive in our localized message into the search string and get a literal translation :

.NET Framework error in Russian (English):
The value can not be undefined.
English translation: Value cannot be null.

Currently there are messages in the categories MS SQL Server, .NET Framework, Windows.

There is also a need to mention the "Microsoft .NET Framework 4 Full Edition Language Pack (x86 / x64)" - the Microsoft .NET Framework 4 language pack contains translated text, such as error messages, for each language.

Visual Studio 2010 Language Packs


Visual Studio 2010 Language Packs are free add-ons that allow users to switch the interface language from English to your choice. These addons were created by academic communities. At the moment there are such languages: Czech, Polish, Turkish. I do not know what caused such a specific geography, but if you want to develop in the Turkish IDE - download addons .

Little fun


But most of all I liked the possibility of writing a localized code - I almost missed football while I was playing ( but do not even think of sending it to my customer !!! ).

These are the hits everyone can create:
class {
public static void ( string ){
Console .WriteLine();
}

internal static void ( string )
{
Console .WriteLine();
}
}

static class
{
public static DateTime = DateTime .Now;

public static DateTime ( this DateTime , int )
{
return .AddMinutes();
}
}

class
{
private DateTime { get ; set ; }
public bool { get ; set ; }

internal void ()
{
//
}

internal void ()
{
= .;
}

public bool ( int )
{
return ..CompareTo(.()) > 0;
}
}


* This source code was highlighted with Source Code Highlighter .
Well, actually, in main:
var = new ();
.();

while (!.(30))
{
.();

if (!()) {
. = true ;
break ;
}
}

.( " :)" );
.( " - !" );


* This source code was highlighted with Source Code Highlighter .
I did not manage to install Visual Studio 2010 Maximum on my car - there was not enough space on the hard drive. But nevertheless, I believe that the localized version is at least not superfluous - there are many people who use it for various reasons, and I think Microsoft is doing the right thing, which releases localized products.

Source: https://habr.com/ru/post/98582/


All Articles