SOURCE CODE: Uize.Build.Templates.Module.Plurals.ModuleTemplate (view docs)

<%@
  required (
    'Uize.Build.Templates.Module.HeadComment'
  );
  input ({
    namespace:'string',
    language:'string',
    pluralRulesFunction:'string'
  });
%><%
  var
    _input = input,
    _moduleName = _input.namespace + '.' + _input.language,
    _pluralRules = _input.pluralRules
  ;
%><%=
  Uize.Build.Templates.Module.HeadComment.process ({
    moduleName:_moduleName,
    moduleType:'Package',
    creationYear:(new Date).getFullYear ()
  })
%>/* Module Meta Data
  type: Package
  importance: 1
  codeCompleteness: 100
  docCompleteness: 100
*/

/*?
  Introduction
    The =<%= _moduleName %>= module implements a feature for determining a plural category from a number value for the <%. language %> language.

    *DEVELOPERS:* `Chris van Rensburg`

    Plural Categories
      ........................................................
      << table >>

      title: Plural Categories
      data:
      :| Category | Rule |
<%
  for (var _pluralRuleName in _pluralRules) {
%>      :| <%= _pluralRuleName %> | <%= _pluralRules [_pluralRuleName] %> |
<%
  }
%>      ........................................................
*/

Uize.module ({
  name:'<%= _moduleName  %>',
  required:'Uize.Loc.Plurals.Util',
  builder:function () {
    'use strict';

    return Uize.package ({
      getPluralCategory:function (_value) {
        return Uize.Loc.Plurals.Util.getPluralCategory (
          _value,
          <%. pluralRulesFunction -> indent{amount:5}
%>        );
      }
    });
  }
});