summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-06-15 17:14:26 -0700
committerelijah <elijah@riseup.net>2015-06-15 17:14:26 -0700
commit83a9cadbb13bd2292c7d064d40721fa5f64119fb (patch)
tree294c13678a0514634a6817428d2c656738c14e52 /app/helpers
parent12ab515ecd448f98ff006e30a93e43626183b6d0 (diff)
added CommonLanguages gem
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/core_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/helpers/core_helper.rb b/app/helpers/core_helper.rb
index 46e8fa4..f34d2f2 100644
--- a/app/helpers/core_helper.rb
+++ b/app/helpers/core_helper.rb
@@ -17,4 +17,16 @@ module CoreHelper
APP_CONFIG[:service_levels].present? && APP_CONFIG[:service_levels].detect{|k,v| v['rate'].present?}
end
+ #
+ # a bunch of links to the different languages that are available.
+ #
+ def locales_links
+ CommonLanguages.available.collect { |lang|
+ link_to(lang.name,
+ {:action => params[:action], :controller => params[:controller], :locale => lang.code},
+ {:class => (lang.code == I18n.locale ? 'locale active' : 'locale')}
+ )
+ }.join(" ").html_safe
+ end
+
end