<commit_before>= Welcome to Tr8n Translation Engine

Tr8n translation engine is a rails engine plugin that allows for crowd-source translations and management of any internationalized text 
throughout any rails based application. The power of the engine comes from its simple and friendly user interface that allows site users 
to rapidly translate the site into hundreds of languages. The flexible and robust rules engine that powers Tr8n allows for any combinations 
of language specific rules in any translatable sentence. Users themselves can provide information on what sentences depend on gender rules, 
number rules or other rules. The language specific rules can be registered and managed for any language in the advanced user interface. 
The engine also provides a set of powerful admin tools that allow admins to manage any aspect of the engine; enabling and disabling its features
and monitoring translation process.

The Tr8n engine itself is based on a very robust and flexible pluggable architecture where rule types and even syntax of the "tr" tokens 
can be configured or extended for any application deployment.

== Installation Instructions

Tr8n is mostly self-contained. The only two plugins it depends on are will_paginate created by <NAME> for results pagination 
and will_filter created by me for filtering results in the admin interface. 

To install the required plugins, run the following commands:

  $ script/plugin install git://github.com/mislav/will_paginate.git
  
  $ script/plugin install git://github.com/berk/will_filter.git
  $ rake will_filter:sync  


To install and initialize the engine itself, run the following commands: 

  $ script/plugin install git://github.com/berk/tr8n.git
  $ rake tr8n:sync         
  
  $ script/generate tr8n_migration
  $ rake db:migrate 
  $ rake tr8n:init

  $ cd public; ln -s ../vendor/plugins/tr8n/public/tr8n tr8n

== Tr8n Notations

The following is a short summary of the tr8n's internationalization notations:

Data token:

  <%= tr("Dear {user}", nil, :user => current_user) %>
  
Method token with an embedded method calls:

  <%= tr("Dear {user.first_name} {user.last_name}", nil, :user => current_user) %>
  
Data token with a value substitution:

  <%= tr("Dear {user}", nil, :user => [current_user, display_user(current_user)]) %>
  
Data token with a value substitution using symbol method call:

  <%= tr("Dear {user}", nil, :user => [current_user, :first_name])  %>
  
Data token with a value substitution using symbol method call with parameters:

  <%= tr("Dear {user}", nil, :user => [current_user, :some_method, "value"])  %>
  
Data token with a value substitution using lambda method call:

  <%= tr("Dear {user}", nil, :user => [current_user, lambda{|val| html_for(val)}])  %>
  
Data token with a value substitution using lambda method call with parameters:

  <%= tr("Dear {user}", nil, :user => [current_user, lambda{|val, test| html_for(val, test)}], "test"])  %>

Hidden token:

  <%= tr("{user} changed {_his_her} name", nil, :user => [current_user, :name], :_his_her => current_user.his_her)  %>


<commit_msg>more rdoc<commit_after>= Welcome to Tr8n Translation Engine

Tr8n translation engine is a rails engine plugin that allows for crowd-source translations and management of any internationalized text 
throughout any rails based application. The power of the engine comes from its simple and friendly user interface that allows site users 
to rapidly translate the site into hundreds of languages. The flexible and robust rules engine that powers Tr8n allows for any combinations 
of language specific rules in any translatable sentence. Users themselves can provide information on what sentences depend on gender rules, 
number rules or other rules. The language specific rules can be registered and managed for any language in the advanced user interface. 
The engine also provides a set of powerful admin tools that allow admins to manage any aspect of the engine; enabling and disabling its features
and monitoring translation process.

The Tr8n engine itself is based on a very robust and flexible pluggable architecture where rule types and even syntax of the "tr" tokens 
can be configured or extended for any application deployment.

= Installation Instructions

Tr8n is mostly self-contained. The only two plugins it depends on are will_paginate created by <NAME> for results pagination 
and will_filter created by me for filtering results in the admin interface. 

To install the required plugins, run the following commands:

  $ script/plugin install git://github.com/mislav/will_paginate.git
  
  $ script/plugin install git://github.com/berk/will_filter.git
  $ rake will_filter:sync  


To install and initialize the engine itself, run the following commands: 

  $ script/plugin install git://github.com/berk/tr8n.git
  $ rake tr8n:sync         
  
  $ script/generate tr8n_migration
  $ rake db:migrate 
  $ rake tr8n:init

  $ cd public; ln -s ../vendor/plugins/tr8n/public/tr8n tr8n

= Tr8n Notations

== Label Internationalization

The function for internationalizing labels has the following signature:

  tr(LABEL, DESCRIPTION = "", TOKENS = {}, OPTIONS = {})

  * LABEL is a required string 
  * DESCRIPTION is an optional, but highly recommended string
  * TOKENS is an optional hash of token values - it is required if tokens are used in the label 
  * OPTIONS is an optional hash of options

There are a number of other flavors of the "tr" function like trl, trfe, trfn that set default options for various reasons. 
You can read more about them in the Tr8n Integration Guide.

== Tr8n Internationalization Notations

The following is a short summary of the tr8n's internationalization notations:

Data token:

  <%= tr("Dear {user}", "Fragment sample", :user => current_user) %>
  
Method token with embedded method calls:

  <%= tr("Dear {user.first_name} {user.last_name}", "Fragment sample", :user => current_user) %>
  
Data token with a value substitution:

  <%= tr("Dear {user}", "Fragment sample", :user => [current_user, display_user(current_user)]) %>
  
Data token with a value substitution using symbol method call:

  <%= tr("Dear {user}", "Fragment sample", :user => [current_user, :first_name])  %>
  
Data token with a value substitution using symbol method call with parameters:

  <%= tr("Dear {user}", "Fragment sample", :user => [current_user, :some_method, "value"])  %>
  
Data token with a value substitution using lambda method call:

  <%= tr("Dear {user}", "Fragment sample", :user => [current_user, lambda{|val| html_for(val)}])  %>
  
Data token with a value substitution using lambda method call with parameters:

  <%= tr("Dear {user}", "Fragment sample", :user => [current_user, lambda{|val, test| html_for(val, test)}], "test"])  %>

Hidden token:

  <%= tr("{user} changed {_his_her} name", "Fragment sample", :user => [current_user, :name], :_his_her => current_user.his_her)  %>
  <%= tr("you have {count} {_messages}", "Fragment sample", :count => message_num, :_messages => "message".pluralize_for(message_num))  %>



{'fraction_non_alphanumeric': 0.08630658581300239, 'fraction_numerical': 0.004230714990833451, 'mean_word_length': 4.493415956622773, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 42, 'https://': 0, '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': '3768229', 'n_tokens_mistral': 2011, 'n_tokens_neox': 1895, 'n_words': 871}