<%=trla("Translation Tokens")%>
<% if @translation_key.translation_tokens? %>
<% @translation_key.translation_tokens.each do |token| %>
<% if token.decoration? %>
<%= link_to_function(token.sanitized_name, "tr8nTranslator.insertDecorationToken('#{token.name}', 'tr8n_translation_label_#{@translation_key.id}');", :title => trla("Click to insert this token above") ) %>
<% else %>
<%= link_to_function(token.sanitized_name, "tr8nTranslator.insertToken('#{token.name}', 'tr8n_translation_label_#{@translation_key.id}');", :title => trla("Click to insert this token above") ) %>
<% end %>
<% end %>
<%=trla("Click on a token to insert it into the label")%>
<% end %>
<% if @translation_key.data_tokens? and tr8n_current_language.cases.any? %>
<%=link_to_function(trla("Click here if the token values depend on the language cases"), "Tr8n.Effects.hide('cases_trigger'); Tr8n.Effects.blindDown('tr8n_translator_tokens_extended_view');") %>
<%=trla("Data Tokens With Language Cases")%>
<% @translation_key.data_tokens.each do |token| %>
<% next unless token.supports_cases? %>
<% tr8n_current_language.cases.each do |lcase| %>
<%= link_to_function(token.sanitized_name_for_case(lcase.keyword), "tr8nTranslator.insertToken('#{token.name_for_case(lcase.keyword)}', 'tr8n_translation_label_#{@translation_key.id}');", :title => trla("Click to insert this token above") ) %>
|
<%=lcase.native_name%>
<%=lcase.description%>
|
<% end %>
<% end %>
<%=trla("Choose the language forms of the tokens and insert them into the sentence.")%>
<%=link_to_function(trla("{laquo} the token values do not depend on language cases", 'Tr8n translation rules section'), "Tr8n.Effects.show('cases_trigger'); Tr8n.Effects.blindUp('tr8n_translator_tokens_extended_view');") %>
<% end %>
<% if @translation_key.permutatable? %>
<%
if @translation_key.translation_tokens?
link_label = tra("Click here if this translation depends on any of the token values or the gender of the viewing user")
else
link_label = tra("Click here if this translation depends on the gender of the viewing user")
end
%>
<%=link_to_function(link_label, "Tr8n.element('has_rules').value='true'; Tr8n.Effects.hide('rules_trigger'); Tr8n.Effects.blindDown('translation_rules');") %>
<%=trla("Token Dependency Rules For This Translation")%>
<%=hidden_field_tag("has_rules", "true") %>
|
<%=trla('Token', 'Tr8n translation rules header')%> |
<%=trla('Context Rule', 'Tr8n translation rules header')%> |
<% @translation_key.language_rules_dependant_tokens.each_with_index do |token, index| %>
<%
rule_options = []
tr8n_current_language.rule_classes.each do |rule_class|
if rule_class.dependant?(token)
rule_options += rule_class.for(tr8n_current_language).collect{|rule| [rule.description, rule.id.to_s]}
end
end
%>
<%=check_box_tag("rules[#{token.name}][selected]", "true", (@rules[token.name]!=nil), :id => "check_#{index}", :style => "width:20px")%>
|
<%=token.name %>
|
<%=select_tag("rules[#{token.name}][rule_id]", options_for_select(rule_options, @rules[token].to_s), :onChange => "Tr8n.element('check_#{index}').checked = true;")%>
|
<% end %>
<%=trla("Select all of the rules that apply to this translation or [link: generate all context rules for this phrase].", '', :link => lambda{|t| link_to_function(t, 'addContextRules()')})%>
<%=link_to_function(trl("{laquo} this translation has no context rules", 'Tr8n translation rules section'), "Tr8n.element('has_rules').value='false'; Tr8n.Effects.show('rules_trigger'); Tr8n.Effects.blindUp('translation_rules');") %>
<% end %>
<% end %>