Full localization implementation

This commit is contained in:
2013-03-03 16:43:27 +01:00
parent 27c188773a
commit 1eb181b043
5 changed files with 32 additions and 7 deletions
+16
View File
@@ -109,4 +109,20 @@ module ApplicationHelper
end
end
def page_path(record)
str = case record
when Page then record.name
else record
end
go_to_path(str, locale: I18n.locale)
end
def find_page(name)
Page.find_by_name_and_locale(name, I18n.locale)
end
def locale_root_path
I18n.locale == I18n.default_locale ? '/' : "/#{I18n.locale}"
end
end