<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;h3&gt;Overview of experimental pluralize backend&lt;/h3&gt;
&lt;p&gt;Different pluralization rulesets for a different locales can be stored to the pluralize backend.&lt;/p&gt;
&lt;p&gt;The pluralizer backend has a #add_pluralizer function that accepts lambda code block as a pluralization rule for the given locale:&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
  # Instantiating backend
  backend = I18n::Backend::Pluralizing.new
  
  # Pluralization ruleset for :cz locale
  cz_pluralizer = lambda{ |c| c == 1 ? :one : (2..4).include?(c) ? :few : :other }

  # Adding ruleset to pluralize backend
  backend.add_pluralizer(:cz, cz_pluralizer)

  # Pluralization rules are used when requesting translation for :cz locale
  I18n.translate :cz, :foo

  # Backend defaults to :en locale in case no ruleset is defined for given locale
  I18n.translate :fi, :foo
&lt;/code&gt;
&lt;/pre&gt;</body>
  <created-at type="datetime">2008-08-27T02:59:40-07:00</created-at>
  <id type="integer">49648</id>
  <permalink>pluralize-backend</permalink>
  <repository-id type="integer">39249</repository-id>
  <title>Pluralize backend</title>
  <updated-at type="datetime">2008-08-27T03:35:20-07:00</updated-at>
  <user-id type="integer">4651</user-id>
</wiki>
