Bike!Bike! Website!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

43 lines
1.8 KiB

- page_style :form
.row
%h1
= _ 'language_translations', vars: {:language => (_ ('languages.' + @lang))}
%table.columns#translations
%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'