diff --git a/app/views/posts/index.haml b/app/views/posts/index.haml index 87ff4d93..a82616d8 100644 --- a/app/views/posts/index.haml +++ b/app/views/posts/index.haml @@ -89,7 +89,7 @@ %div %tbody - - dir = t("locales.#{@locale}.dir") + - dir = @site.data.dig(params[:locale], 'dir') - size = @posts.size - @posts.each_with_index do |post, i| -# diff --git a/app/views/posts/show.haml b/app/views/posts/show.haml index 64daee41..9ef91888 100644 --- a/app/views/posts/show.haml +++ b/app/views/posts/show.haml @@ -1,4 +1,4 @@ -- dir = t("locales.#{@locale}.dir") +- dir = @site.data.dig(params[:locale], 'dir') .row.justify-content-center .col-md-8 %article.content.table-responsive-md diff --git a/config/routes.rb b/config/routes.rb index 8bab18af..a132135a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -55,7 +55,7 @@ Rails.application.routes.draw do # Gestionar artĂ­culos segĂșn idioma nested do - scope '/(:locale)', constraint: /[a-z]{2}/ do + scope '/(:locale)', constraint: /[a-z]{2}(-[A-Z]{2})?/ do post :'posts/reorder', to: 'posts#reorder' resources :posts do get 'p/:page', action: :index, on: :collection