{"issue":{"title":"Simple calculations for translators","user":{"login":"fpoirotte","id":499919,"url":"https://api.github.com/users/fpoirotte","avatar_url":"https://secure.gravatar.com/avatar/adf15294c19648e1fac2509bd42d01c7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"adf15294c19648e1fac2509bd42d01c7"},"created_at":"2011-12-28T21:00:34Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-28T21:00:34Z","id":2674681,"closed_at":null,"html_url":"https://github.com/fpoirotte/Erebot/issues/23","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Sometimes the rules to handle plurals vary depending on the total value of several variables.\r\nIt would be great if simple calculations could be expressed in translations.\r\n\r\nI propose the following changes:\r\n1. Restrict variable names to ``[a-zA-Z0-9_\\.]+`` (``-`` is excluded on purpose).\r\n2. Allow use of ``#`` as a prefix to count the number of items in an array.\r\n3. Allow additions & subtractions in ``<var name=\"...\"/>`` & ``<plural var=\"...\"/>``.\r\n\r\nTherefore, it would now be possible to write something like:\r\n\r\n    There\r\n    <plural var=\"#boys+#girls\">\r\n        <case form=\"one\">is one person</case>\r\n        <case form=\"other\">are <var name=\"\"#boys+#girls\"\"/> persons</case>\r\n    </plural>\r\n    in this room.","number":23,"url":"https://api.github.com/repos/fpoirotte/Erebot/issues/23","comments":0,"assignee":null},"action":"opened"}