|
|
|
- page_title = (_ 'language_translations', vars: {:language => (_ ('languages.' + @lang))})
|
|
|
|
- title page_title
|
|
|
|
- banner_title page_title
|
|
|
|
- page_style :form
|
|
|
|
|
|
|
|
.row
|
|
|
|
%table.columns#translations{data: {token: form_authenticity_token}}
|
|
|
|
%thead
|
|
|
|
%tr
|
|
|
|
%th.key=_'translations.Key'
|
|
|
|
%th.key=_'translations.Pages'
|
|
|
|
%th.key=_'translations.Value'
|
|
|
|
- @translations.sort{| a1, a2 | a1[0].downcase <=> a2[0].downcase}.each do |k,translation|
|
|
|
|
- current_translation = Translation.locale(@lang.to_sym).lookup(k)#[0].value #_ translation[0], :strict, locale: @lang.to_sym
|
|
|
|
- current_translation = current_translation.size() > 0 ? current_translation = current_translation[0].value : nil
|
|
|
|
- cached = (translation['languages'] && translation['languages'].include?(@lang))
|
|
|
|
- vars = translation.has_key?('vars') && translation['vars'].size() > 0 ? translation['vars'] : nil
|
|
|
|
- (vars && vars.include?(:count) ? I18n.backend.get_pluralization_rules(@lang) : [nil]).each do |pluralization|
|
|
|
|
- key = k + (pluralization ? ".#{pluralization.to_s}" : '')
|
|
|
|
%tr{:class => current_translation ? 'exists' : 'not-exists', :data => {:key => key}}
|
|
|
|
%td.key
|
|
|
|
= key
|
|
|
|
- if vars
|
|
|
|
.tags
|
|
|
|
%h5=_'translations.Vars'
|
|
|
|
%ul
|
|
|
|
- vars.each do |v|
|
|
|
|
%li=v
|
|
|
|
%td.pages
|
|
|
|
%ul
|
|
|
|
- translation['pages'].each do |page|
|
|
|
|
%li
|
|
|
|
%a{:href => page}=page
|
|
|
|
%td.value.primary
|
|
|
|
- if current_translation
|
|
|
|
= current_translation
|
|
|
|
- elsif I18n.locale.to_s == @lang.to_s
|
|
|
|
Nil
|
|
|
|
- else
|
|
|
|
- translation_hint = Translation.locale(I18n.locale).lookup(k)
|
|
|
|
- translation_hint = translation_hint && translation_hint.size() > 0 ? translation_hint = translation_hint[0].value : nil
|
|
|
|
= translation_hint ? (_ "languages.#{I18n.locale.to_s}") + " = \"#{translation_hint}\"" : 'Nil'
|
|
|
|
- unless current_translation
|
|
|
|
%a{:href => '#', :class => 'auto-translate button small'}='Auto'
|
|
|
|
|
|
|
|
-# content_for :footer_scripts
|
|
|
|
= javascript_include_tag 'translations'
|