<commit_before>[![alt tag](http://img.shields.io/badge/maintainer-hawkinswnaf-blue.svg)](https://github.com/hawkinswnaf)

commotion-translation-generator
=============================================

Parses commotion-router source files for user-facing strings and uses them to generate PO files for [https://github.com/opentechinstitute/luci-i18n-commotion](luci-i18n-commotion).

Translation of Commotion OpenWRT is managed on Transifex:
https://www.transifex.com/projects/p/commotion-user-interface/<commit_msg>Added prerequisites and usage to README<commit_after>[![alt tag](http://img.shields.io/badge/maintainer-hawkinswnaf-blue.svg)](https://github.com/hawkinswnaf)

# commotion-translation-generator
=============================================

Parses commotion-router source files for user-facing strings and uses them to generate PO files for [https://github.com/opentechinstitute/luci-i18n-commotion](luci-i18n-commotion). The PO file generator will attempt to re-use any existing translations in the new PO file.

Translation of Commotion OpenWRT is managed on Transifex:
https://www.transifex.com/projects/p/commotion-user-interface/

## Prerequisites
* Perl 5
* perl modules (available through cpan)
  * DateTime
  * File::Copy
  * File::Next
  * File::Path
  * Git::Repository
  * Text::Balanced

## Usage

1. `$ cd scripts`
2. `$ ./parse.pl`

Newly generated PO files will be written to `scripts/working/translations/` and must be manually added to luci-i18n-commotion for upload to github.
{'fraction_non_alphanumeric': 0.16699801192842942, 'fraction_numerical': 0.008614976805831677, 'mean_word_length': 5.291666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '1284447', 'n_tokens_mistral': 482, 'n_tokens_neox': 450, 'n_words': 116}