From cb8e5dd57dc818a23c34a9229e673df5fd4ba0b9 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Sat, 12 Apr 2025 16:54:00 +0800 Subject: [PATCH] refactor: simplify localized_name method - Remove I18n translation from localized_name - Return city name directly instead This change simplifies the method's implementation by returning the city name directly, avoiding the overhead of translation. Additionally, it improves code clarity by reducing complexity. --- app/models/city.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/city.rb b/app/models/city.rb index 2ff8bbe..bea19f4 100644 --- a/app/models/city.rb +++ b/app/models/city.rb @@ -152,7 +152,8 @@ class City < ApplicationRecord end def localized_name - I18n.t("cities.#{name.parameterize.underscore}", default: name) + # I18n.t("cities.#{name.parameterize.underscore}", default: name) + name end def full_name