Skip to content
Snippets Groups Projects
Unverified Commit c9939c3b authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

page translation pushed at the right place

parent 97c28714
No related branches found
No related tags found
No related merge requests found
......@@ -8,9 +8,8 @@ module Communication::Website::Page::WithPath
def path
path = ''
# TODO i18n remplacer le choix de la langue
if website.languages.many?
path += "/#{website.default_language.iso_code}"
path += "/#{language.iso_code}"
end
path += "/#{slug_with_ancestors}/"
path.gsub(/\/+/, '/')
......
......@@ -14,10 +14,11 @@ module WithGit
def git_path_content_prefix(website)
# Handle legacy language-less websites
# TODO I18n: Right now, we use the language of the website. It HAS TO get the language from the object including this concern.
# TODO I18n: Right now, we use the language of the object, fallbacking on the language of the website. In the end, we'll only use the language of the object
path = "content/"
if website.languages.any?
path += "#{website.default_language.iso_code}/"
path_language = respond_to?(:language_id) && language_id.present? ? language : website.default_language
path += "#{path_language.iso_code}/"
end
path
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment