Skip to content

Commit

Permalink
Another refinement to logic for whether to show translate link. If yo…
Browse files Browse the repository at this point in the history
…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 committed Dec 9, 2010
1 parent ad92b37 commit cb9bc9d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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>'
Expand Down

0 comments on commit cb9bc9d

Please sign in to comment.