Replaced by: 

This module is deprecated. Use Plural Forms Manager (l10n_pconfig) instead.

l10n_pconfig does everything String Plural Form does, and more:/p>

  • sets the plural formula when you add a language;
  • keeps Drupal's runtime plural table in sync with configuration, including config imports;
  • protects the formula during .po imports that don't overwrite;
  • writes the correct Plural-Forms header when you export;
  • labels plural variants in interface, configuration and Views translation;
  • adds a "Plural status" page to find and fix problems.

String Plural Form will get no new features. Please don't start new sites with it.

Moving to l10n_pconfig

  1. Note the rule you chose for each language at Configuration » Regional and language » Languages » String Plural Form.
  2. Install l10n_pconfig. It sets a formula for each language from drupal.org's defaults. If your chosen rule differs from that default, l10n_pconfig either replaces it with the default or leaves the language without a formula and shows a warning.
  3. For each language where your rule differs, edit the language and set Plural formula to your rule. Write it as nplurals=N; plural=EXPRESSION;. The expression is the value of getGettextPlural() in the rule's plugin class, and N is the value of getGettextNplurals().
  4. Check the Plural status tab under Languages. It should show no problems.
  5. Uninstall String Plural Form. Uninstalling doesn't change Drupal's plural table.

Thanks to Gábor Hojtsy for building l10n_pconfig out.

Define and manage Plural forms for Translatable strings. The module provides necessary User Interface to manage Plural forms in a Drupal site.

Features

- As a site admin you would be able to select appropriate plural form for all enabled languages
- Provides a plugin system that can be used to develop custom Plural Forms via other modules

Drupal Core provides a mechanism to update Plural forms by uploading a PO file. However this may not be convenient solution for everybody. By enabling and using this module, Site Admins can select one of the available Plural Forms rules for a given language.

Post-Installation

After enabling the module, visit "/admin/config/regional/language/string-plural-form" to as Site Admin to configure the rules.

Additional Requirements

This modules doesn't have any other dependency than Drupal Core and Locale module which ships with Drupal.

N/A

Similar projects

- Plural formula configurator
- Locale Plural Formula (Unsupported Abandoned)

Following Issues are being worked on to improve the experience int his area,

- #2882617: String version of plural formula is not available, exported .po files contain an incorrect default
- #2273889: Don't use one language's plural index formula with another language's string in the case of untranslated strings using format_plural().
- #2660338: Deprecate locale_get_plural
- #3496223: Plural Formula gets ignored for Singular Case for languages where Singular Form is not found in the first index

Supporting this Module

- N/A

Community Documentation

- N/A

Other References

Following Links provides better understanding around handling of Plural Forms in Drupal

- Gettext Plural Forms Manual
- #519736: Plurals
- #566390: Apply locale import protection to the plural forms

Supporting organizations: 
funded development

Project information

Releases