Culture-specific strings pluralization in .NET

Posted by Dmytro Shteflyuk on under ASP.NET

Not so long ago I faced a problem of displaying count of some entities in singular or plural form (“No comments” or “less than a minute ago”, “1 comment” or “a minute ago”, “2 comments” or “2 minutes ago”). It’s very easy for English (there are three variants only), but I’m working on application that should be localized for several cultures. For example, in Russian we have at least 4 forms (“Нет комментариев”, “1 комментарий”, “2 комментария”, “5 комментариев”) and not so obvious rules for plural forms (“11 комментариев”, “111 комментариев”, but “21 комментарий”). I don’t speak any other language, but I think that several of them might be even more complicated than Russian. Here you can find my thoughts about such strings localization.

Read the rest of entry »

Using Panel.DefaultButton property with LinkButton control in ASP.NET

Posted by Dmytro Shteflyuk on under ASP.NET

ASP.NET has great limitation — only one server form on the page. Even if you are developing complex page, which looks like several forms with different submit buttons, in fact you have only one form. So we have a problem: How browser understanding which button should be triggered when user pressed ENTER? It uses first Button control (usually that’s wrong), and if you have LinkButton‘s, they would never be triggered. In ASP.NET 2.0 new property has been added to the Panel and HtmlForm controls — DefaultButton, which can be used to specify ID of the control, which implements IButtonControl interface (usually Button and LinkButton). This button control would be triggered when user pressed ENTER. But there is one big problem exist: LinkButton control would not be triggered in Firefox on ENTER. In this article I will show why this problem take place and how to solve it.

Read the rest of entry »

Best Tech Videos: Great Changes Coming

Posted by Dmytro Shteflyuk on under Resume

Best Tech Videos: Logo

During the last few months we (I and Alexey Kovyrin) have been working on a major Best Tech Videos site platform update. If you have not seen it before — it is time to take a look at it because really soon everything will change. I don’t mean that site idea would change (you would be able to find there the best tech videos), but usability, information availability and many small but useful things will be changed for good.

Read the rest of entry »