<commit_before>
General
=======

We plan to use Jade, so it will be most convenient to use this [jade-i18n progect](https://github.com/LearnBoost/jade-i18n).
It has lack of some features:

- No embedded plurals support, with easy syntax
  - https://github.com/LearnBoost/jade-i18n/issues/3
  - https://github.com/masylum/dialect/blob/master/lib/helpers/plurals.js
- ? No gender support, with easy syntax
- No context-depended phrases support
  - https://github.com/LearnBoost/jade-i18n/issues/4
- No built-in i18n __() for translations without templates
- the same phrases with variables can be different for templates & direct js calls
  - try to avoid such situation. Check if we really need to avoid it.
  - compile such phrases when added, to find ready result by phrase hash
- instruments to make lang files (similar to wordpress makepot.php)

Proposed changes
================

Plurals
-------

We use macros ((...)) to define plurals.

### Example 1. Single var -> 1 or more plurals

    Look, ((there is|there are)) #{ap_count} ((apple|apples)) on the table

Plurals are in double brakets. Variable used to change proper value.

(*) Escape if really needs double brackets as plain text

### Example 2. Several vars -> plurals, all plurals on the right

More rare, but also possible case. Usually, plurals goes after numbers.
So, pattern is still simple
<commit_msg>Added i18n summary<commit_after>
General
=======

We plan to use Jade, so it will be most convenient to use this [jade-i18n progect](https://github.com/LearnBoost/jade-i18n).
It has lack of some features:

- No embedded plurals support, with easy syntax
  - https://github.com/LearnBoost/jade-i18n/issues/3
  - https://github.com/masylum/dialect/blob/master/lib/helpers/plurals.js
- ? No gender support, with easy syntax
- No context-depended phrases support
  - https://github.com/LearnBoost/jade-i18n/issues/4
- No built-in i18n __() for translations without templates
- the same phrases with variables can be different for templates & direct js calls
  - try to avoid such situation. Check if we really need to avoid it.
  - compile such phrases when added, to find ready result by phrase hash
- instruments to make lang files (similar to wordpress makepot.php)

Proposed changes
================

All changes have 2 points:

1. We need SIMPLE format for translators
2. We need compatible phrases format both templates and code (for example, JSON/XML output don't need templates)

Plurals
-------

We use macros ((...)) to define plurals.

### Example 1. Single var -> 1 or more plurals

    Look, ((there is|there are)) #{ap_count} ((apple|apples)) on the table

Plurals are in double brakets. Variable used to change proper value.

(*) Escape if really needs double brackets as plain text

### Example 2. Several vars -> plurals, all plurals on the right

More rare, but also possible case. Usually, plurals goes after numbers.
So, pattern is still simple

{'fraction_non_alphanumeric': 0.10361281526925699, 'fraction_numerical': 0.011929107021131561, 'mean_word_length': 3.7879282218597066, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4594925', 'n_tokens_mistral': 906, 'n_tokens_neox': 841, 'n_words': 371}