i18n and l10n for Mustache (PHP) and Angular (Javascript)

English in fact uses just two forms of plural:

  • 0 children
  • 1 child
  • 2 children
  • 3 children

In Angular terminology it means ONE or OTHER1:

/**
 * Plural select rules for en locale
 *
 * @param {number} n  The count of items.
 * @return {goog.i18n.pluralRules.Keyword} Locale-specific plural value.
 * @private
 */
goog.i18n.pluralRules.enSelect_ = function(n) {
  if (n == 1) {
   return goog.i18n.pluralRules.Keyword.ONE;
  }
  return goog.i18n.pluralRules.Keyword.OTHER;
};
Continue reading “i18n and l10n for Mustache (PHP) and Angular (Javascript)”