From aa84dd8ef5b16774a2f5f1a03dfaab37ec66ce9e Mon Sep 17 00:00:00 2001 From: Vincent Rolea <3525369+virolea@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:49:21 +0200 Subject: [PATCH] Change locale translation route to better reflect the domain --- ...nslation_keys_controller.rb => translations_controller.rb} | 2 +- app/controllers/rosetta/translations_controller.rb | 2 +- app/views/rosetta/locales/_locale.html.erb | 2 +- .../_translation_key.html.erb | 0 .../locales/{translation_keys => translations}/index.html.erb | 2 +- app/views/rosetta/translations/edit.html.erb | 2 +- config/routes.rb | 2 +- ...eys_controller_test.rb => translations_controller_test.rb} | 4 ++-- test/controllers/rosetta/translations_controller_test.rb | 4 ++-- 9 files changed, 10 insertions(+), 10 deletions(-) rename app/controllers/rosetta/locales/{translation_keys_controller.rb => translations_controller.rb} (87%) rename app/views/rosetta/locales/{translation_keys => translations}/_translation_key.html.erb (100%) rename app/views/rosetta/locales/{translation_keys => translations}/index.html.erb (97%) rename test/controllers/rosetta/locales/{translation_keys_controller_test.rb => translations_controller_test.rb} (69%) diff --git a/app/controllers/rosetta/locales/translation_keys_controller.rb b/app/controllers/rosetta/locales/translations_controller.rb similarity index 87% rename from app/controllers/rosetta/locales/translation_keys_controller.rb rename to app/controllers/rosetta/locales/translations_controller.rb index a590a5a..f085615 100644 --- a/app/controllers/rosetta/locales/translation_keys_controller.rb +++ b/app/controllers/rosetta/locales/translations_controller.rb @@ -1,5 +1,5 @@ module Rosetta - class Locales::TranslationKeysController < ApplicationController + class Locales::TranslationsController < ApplicationController before_action :set_locale def index diff --git a/app/controllers/rosetta/translations_controller.rb b/app/controllers/rosetta/translations_controller.rb index 0725cff..60b44b6 100644 --- a/app/controllers/rosetta/translations_controller.rb +++ b/app/controllers/rosetta/translations_controller.rb @@ -9,7 +9,7 @@ def edit def update if @translation.update(translation_params) - redirect_to locale_translation_keys_path(@locale) + redirect_to locale_translations_path(@locale) end end diff --git a/app/views/rosetta/locales/_locale.html.erb b/app/views/rosetta/locales/_locale.html.erb index 2447554..f02c879 100644 --- a/app/views/rosetta/locales/_locale.html.erb +++ b/app/views/rosetta/locales/_locale.html.erb @@ -13,7 +13,7 @@ <% end %> <% unless locale.default_locale? %> - <%= link_to "Manage", locale_translation_keys_path(locale), class: "text-indigo-600 hover:text-indigo-900" %> + <%= link_to "Manage", locale_translations_path(locale), class: "text-indigo-600 hover:text-indigo-900" %> <% end %> diff --git a/app/views/rosetta/locales/translation_keys/_translation_key.html.erb b/app/views/rosetta/locales/translations/_translation_key.html.erb similarity index 100% rename from app/views/rosetta/locales/translation_keys/_translation_key.html.erb rename to app/views/rosetta/locales/translations/_translation_key.html.erb diff --git a/app/views/rosetta/locales/translation_keys/index.html.erb b/app/views/rosetta/locales/translations/index.html.erb similarity index 97% rename from app/views/rosetta/locales/translation_keys/index.html.erb rename to app/views/rosetta/locales/translations/index.html.erb index 198dac0..ccdf601 100644 --- a/app/views/rosetta/locales/translation_keys/index.html.erb +++ b/app/views/rosetta/locales/translations/index.html.erb @@ -35,7 +35,7 @@
- <%= render collection: @translation_keys, partial: "rosetta/locales/translation_keys/translation_key" %> + <%= render collection: @translation_keys, partial: "rosetta/locales/translations/translation_key" %> diff --git a/app/views/rosetta/translations/edit.html.erb b/app/views/rosetta/translations/edit.html.erb index 21022b4..3a6e654 100644 --- a/app/views/rosetta/translations/edit.html.erb +++ b/app/views/rosetta/translations/edit.html.erb @@ -14,7 +14,7 @@