app/helpers/georgia/internationalization_helper.rb in georgia-0.7.6 vs app/helpers/georgia/internationalization_helper.rb in georgia-0.7.7

- old
+ new

@@ -11,9 +11,22 @@ else link_to_locale_list html_options end end + def link_to_available_locales + return unless I18n.available_locales.any? + links = I18n.available_locales.map do |locale| + content_tag(:li, link_to(t("georgia.#{locale}"), locale: locale )) + end + content_tag(:p, class: 'hint') do + content_tag(:div, class: 'dropdown') do + link_to("Change language <span class='caret'></span>".html_safe, '#', class: 'btn btn-warning', data: {toggle: 'dropdown'}, role: :button) + + content_tag(:ul, links.join('').html_safe, class: 'dropdown-menu', role: 'menu') + end + end + end + protected def link_to_locale_list html_options content_tag :ul, html_options do available_locales.each do |lang| \ No newline at end of file