diff --git a/app/models/communication/website/page/with_path.rb b/app/models/communication/website/page/with_path.rb index 76914dbd46e65f44acd191d42b0882e37a66380c..1809109d1bc8d8792cd5d9557502e08f6e7a92f5 100644 --- a/app/models/communication/website/page/with_path.rb +++ b/app/models/communication/website/page/with_path.rb @@ -19,7 +19,11 @@ module Communication::Website::Page::WithPath def path path = '' # TODO i18n remplacer le choix de la langue - path += "/#{website.languages.first.iso_code}" if website.languages.any? + if website.languages.many? + path += "/fr" + elsif website.languages.any? + path += "/#{website.languages.first.iso_code}" + end path += "/#{slug_with_ancestors}/" path.gsub(/\/+/, '/') end diff --git a/app/models/concerns/with_git.rb b/app/models/concerns/with_git.rb index 3fc35c5cc54cbfc550d4014934caaa4193763327..be5ea940bc46dcb46b7688c92765ac6bf721c401 100644 --- a/app/models/concerns/with_git.rb +++ b/app/models/concerns/with_git.rb @@ -19,7 +19,7 @@ module WithGit if website.languages.many? # todo totalement arbitraire path += "fr/" - else + elsif website.languages.any? path += "#{website.languages.first.iso_code}/" end path diff --git a/app/views/admin/communication/websites/configs/production_config/static.html.erb b/app/views/admin/communication/websites/configs/production_config/static.html.erb index eede2e04d3c27c88193e79676feda4c0a5d64d78..30b86e4b22ae529b7bb6386415eff4684bb02241 100644 --- a/app/views/admin/communication/websites/configs/production_config/static.html.erb +++ b/app/views/admin/communication/websites/configs/production_config/static.html.erb @@ -4,5 +4,9 @@ baseURL: <%= @website.url %> ## LANGUAGE <%# TODO I18n: Add "Default language" in Communication::Website %> +<% if @website.languages.many? %> +defaultContentLanguage: fr +<% else %> defaultContentLanguage: <%= @website.languages.first.iso_code %> -defaultContentLanguageInSubdir: <%= @website.languages.many? %> \ No newline at end of file +<% end %> +defaultContentLanguageInSubdir: <%= @website.languages.many? %>