<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Culture-specific strings pluralization in .NET</title>
	<atom:link href="http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/</link>
	<description>In my blog I'll try to describe about interesting technologies, my discovery in IT and some useful things about programming.</description>
	<pubDate>Tue, 07 Oct 2008 04:36:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: Алексей Махоткин</title>
		<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-143835</link>
		<dc:creator>Алексей Махоткин</dc:creator>
		<pubDate>Sun, 30 Nov 2003 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-143835</guid>
		<description>Про плюрализацию моя любимая тема.

В доке к GNU gettext изложен большой набор разных вариантов в разных языках (и то, как они это обрабатывают):

&lt;a href="http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms" rel="nofollow"&gt;Additional functions for plural forms&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Про плюрализацию моя любимая тема.</p>
<p>В доке к GNU gettext изложен большой набор разных вариантов в разных языках (и то, как они это обрабатывают):</p>
<p><a href="http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms" rel="nofollow" onclick="javascript:pageTracker._trackPageview ('/outbound/www.gnu.org');">Additional functions for plural forms</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pechkinator</title>
		<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-94490</link>
		<dc:creator>pechkinator</dc:creator>
		<pubDate>Tue, 30 Nov 2004 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-94490</guid>
		<description>есть плагин для Ruby On Rails - Globalize. Там эта проблема решина так. В таблице с языками у каждого языка есть так называемая pluralization-строка. Например для русского:

&lt;code lang="ruby"&gt;c%10==1 &#038;&#038; c%100!=11 ? 1 : c%10&gt;=2 &#038;&#038; c%10&lt;=4 &#038;&#038; (c%100&lt;10 &#124;&#124; c%100&gt;=20) ? 2 : 3&lt;/code&gt;

, для английского:

&lt;code lang="ruby"&gt;c == 1 ? 1 : 2&lt;/code&gt;

, для ирландского:

&lt;code lang="ruby"&gt;c==1 ? 1 : c==2 ? 2 : 3&lt;/code&gt;

и т.д. Затем переводы находятся по ключу и количеству, где количество это на самом деле не количество, а число которое возвращает pluralization-строка при выполнении, если &lt;tt&gt;c&lt;/tt&gt; это количество объектов. 

Использовать в коде это очень просто, напр.

&lt;code lang="ruby"&gt;"%d COMMENT".t(@comments.count)&lt;/code&gt;

&lt;tt&gt;%d&lt;/tt&gt; подмениться на число, а вместо &lt;tt&gt;COMMENT&lt;/tt&gt; подставиться слово "комментарий" в нужной форме.</description>
		<content:encoded><![CDATA[<p>есть плагин для Ruby On Rails - Globalize. Там эта проблема решина так. В таблице с языками у каждого языка есть так называемая pluralization-строка. Например для русского:</p>
<div class="codecolorer-container ruby" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">c%<span class="nu0">10</span>==<span class="nu0">1</span> &amp;&amp; c%<span class="nu0">100</span>!=<span class="nu0">11</span> ? <span class="nu0">1</span> : c%<span class="nu0">10</span>&gt;=<span class="nu0">2</span> &amp;&amp; c%<span class="nu0">10</span>&lt;=<span class="nu0">4</span> &amp;&amp; <span class="br0">&#40;</span>c%<span class="nu0">100</span>&lt;<span class="nu0">10</span> || c%<span class="nu0">100</span>&gt;=<span class="nu0">20</span><span class="br0">&#41;</span> ? <span class="nu0">2</span> : <span class="nu0">3</span></div></div>
<p>, для английского:</p>
<div class="codecolorer-container ruby" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">c == <span class="nu0">1</span> ? <span class="nu0">1</span> : <span class="nu0">2</span></div></div>
<p>, для ирландского:</p>
<div class="codecolorer-container ruby" style="height:35px;"><div class="codecolorer" style="font-family: monospace;">c==<span class="nu0">1</span> ? <span class="nu0">1</span> : c==<span class="nu0">2</span> ? <span class="nu0">2</span> : <span class="nu0">3</span></div></div>
<p>и т.д. Затем переводы находятся по ключу и количеству, где количество это на самом деле не количество, а число которое возвращает pluralization-строка при выполнении, если <tt>c</tt> это количество объектов. </p>
<p>Использовать в коде это очень просто, напр.</p>
<div class="codecolorer-container ruby" style="height:35px;"><div class="codecolorer" style="font-family: monospace;"><span class="st0">&quot;%d COMMENT&quot;</span>.<span class="me1">t</span><span class="br0">&#40;</span>@comments.<span class="me1">count</span><span class="br0">&#41;</span></div></div>
<p><tt>%d</tt> подмениться на число, а вместо <tt>COMMENT</tt> подставиться слово &#8220;комментарий&#8221; в нужной форме.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmytro Shteflyuk</title>
		<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91135</link>
		<dc:creator>Dmytro Shteflyuk</dc:creator>
		<pubDate>Wed, 30 Nov 2011 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91135</guid>
		<description>2Mihail: Странно, но у меня код компилируется нормально :-) В Visual Studio 2005 нужно открыть проект как &lt;em&gt;File/Open/Web Site...&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>2Mihail: Странно, но у меня код компилируется нормально <img src='http://kpumuk.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> В Visual Studio 2005 нужно открыть проект как <em>File/Open/Web Site&#8230;</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihail</title>
		<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91086</link>
		<dc:creator>Mihail</dc:creator>
		<pubDate>Mon, 30 Nov 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91086</guid>
		<description>Кстати, код не компилируется:

 Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'App_Code' could not be found (are you missing a using directive or an assembly reference?)</description>
		<content:encoded><![CDATA[<p>Кстати, код не компилируется:</p>
<p> Compilation Error<br />
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.</p>
<p>Compiler Error Message: CS0246: The type or namespace name &#8216;App_Code&#8217; could not be found (are you missing a using directive or an assembly reference?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mihail</title>
		<link>http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91084</link>
		<dc:creator>Mihail</dc:creator>
		<pubDate>Mon, 30 Nov 2009 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://kpumuk.info/asp-net/culture-specific-strings-pluralization-in-net/#comment-91084</guid>
		<description>Спасибо за отличный пример!</description>
		<content:encoded><![CDATA[<p>Спасибо за отличный пример!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
