Skip to content
Permalink
Browse files

Another refinement to logic for whether to show translate link. If yo…

…u are on previously translated version, don't provide the link. Will add "unless the locale's version is old case" at some point soon.
  • Loading branch information...
Walter McGinnis
Walter McGinnis committed Dec 9, 2010
1 parent ad92b37 commit cb9bc9d181cbfe4e990e2b8237a7ab99f51d2ceb
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/kete_translatable_content/extensions/helpers/application_helper.rb
@@ -9,7 +9,10 @@ def extras_after_title_headline
html += '<div style="display:inline; padding-top: 10px; margin-bottom: -7px;" id="translations">' + I18n.t('translations.available_in')
html += '<ul class="horizontal-list">'

raw_available_in_locales_links(current_translatable_record, :params => {:version => version }).each_with_index do |link, i|
available_locale_links = raw_available_in_locales_links(current_translatable_record, :params => {:version => version })
available_locales = available_locale_links.collect { |link| link[:locale].to_s }
logger.debug("what are available_locales: " + available_locales.inspect)
available_locale_links.each_with_index do |link, i|
html += "<li#{' class="first"' if i == 0 }>"
html += link[:link]

@@ -20,7 +23,7 @@ def extras_after_title_headline

html += '</li>'
end
unless current_translatable_record.original_locale == I18n.locale
if current_translatable_record.original_locale != I18n.locale && !available_locales.include?(I18n.locale.to_s)
html += '<li id="translate">' + translate_link(current_translatable_record,
:lightbox => true,
:params => {:version => version}) + '</li>'

0 comments on commit cb9bc9d

Please sign in to comment.
You can’t perform that action at this time.