Translate navigation labels (main nav + settings) (#472)

* Translate main navigation labels

Move main nav item names to layout locale keys.

* Use the interpolation that corresponds with the view name
This commit is contained in:
Juan José Mata
2025-12-20 19:13:40 +01:00
committed by GitHub
parent 6a03451ead
commit 5c293b532a
11 changed files with 68 additions and 13 deletions

View File

@@ -1,9 +1,9 @@
<% mobile_nav_items = [
{ name: "Home", path: root_path, icon: "pie-chart", icon_custom: false, active: page_active?(root_path) },
{ name: "Transactions", path: transactions_path, icon: "credit-card", icon_custom: false, active: page_active?(transactions_path) },
{ name: "Reports", path: reports_path, icon: "chart-bar", icon_custom: false, active: page_active?(reports_path) },
{ name: "Budgets", path: budgets_path, icon: "map", icon_custom: false, active: page_active?(budgets_path) },
{ name: "Assistant", path: chats_path, icon: "icon-assistant", icon_custom: true, active: page_active?(chats_path), mobile_only: true }
{ name: t(".nav.home"), path: root_path, icon: "pie-chart", icon_custom: false, active: page_active?(root_path) },
{ name: t(".nav.transactions"), path: transactions_path, icon: "credit-card", icon_custom: false, active: page_active?(transactions_path) },
{ name: t(".nav.reports"), path: reports_path, icon: "chart-bar", icon_custom: false, active: page_active?(reports_path) },
{ name: t(".nav.budgets"), path: budgets_path, icon: "map", icon_custom: false, active: page_active?(budgets_path) },
{ name: t(".nav.assistant"), path: chats_path, icon: "icon-assistant", icon_custom: true, active: page_active?(chats_path), mobile_only: true }
] %>
<% desktop_nav_items = mobile_nav_items.reject { |item| item[:mobile_only] } %>

View File

@@ -48,7 +48,7 @@ nav_sections = [
<div class="space-y-4">
<div class="hidden lg:flex items-center gap-2 p-1.5">
<%= render DS::Link.new(
text: "Back",
text: t("settings.settings_nav_link_large.previous"),
icon: "chevron-left",
href: previous_path,
variant: "ghost",
@@ -85,7 +85,7 @@ nav_sections = [
<ul class="flex space-y-1">
<li>
<%= render DS::Link.new(
text: "Back",
text: t("settings.settings_nav_link_large.previous"),
icon: "chevron-left",
href: previous_path,
variant: "ghost",

View File

@@ -18,14 +18,14 @@
<% if direction == 'previous' %>
<div class="flex items-center gap-3">
<%= icon("arrow-left") %>
<span class="text-sm text-secondary">Back</span>
<span class="text-sm text-secondary"><%= t("settings.settings_nav_link_large.previous") %></span>
</div>
<div>
<span class="text-sm font-medium text-primary"><%= title %></span>
</div>
<% else %>
<div>
<span class="text-sm text-secondary">Next</span>
<span class="text-sm text-secondary"><%= t("settings.settings_nav_link_large.next") %></span>
</div>
<div class="flex items-center gap-3">
<span class="text-sm font-medium text-primary"><%= title %></span>

View File

@@ -1,6 +1,13 @@
---
ca:
layouts:
application:
nav:
assistant: Assistent
budgets: Pressupostos
home: Inici
reports: Informes
transactions: Transaccions
auth:
existing_account: Ja tens un compte?
no_account: Nou a %{product_name}?
@@ -10,4 +17,3 @@ ca:
footer:
privacy_policy: Política de privacitat
terms_of_service: Termes del servei

View File

@@ -1,6 +1,13 @@
---
de:
layouts:
application:
nav:
assistant: Assistent
budgets: Budgets
home: Startseite
reports: Berichte
transactions: Transaktionen
auth:
existing_account: Du hast bereits ein Konto?
no_account: Neu bei %{product_name}?
@@ -10,4 +17,4 @@ de:
shared:
footer:
privacy_policy: Datenschutzrichtlinie
terms_of_service: Nutzungsbedingungen
terms_of_service: Nutzungsbedingungen

View File

@@ -1,6 +1,13 @@
---
en:
layouts:
application:
nav:
assistant: Assistant
budgets: Budgets
home: Home
reports: Reports
transactions: Transactions
auth:
existing_account: Already have an account?
no_account: New to %{product_name}?

View File

@@ -1,6 +1,13 @@
---
es:
layouts:
application:
nav:
assistant: Asistente
budgets: Presupuestos
home: Inicio
reports: Informes
transactions: Transacciones
auth:
existing_account: ¿Ya tienes una cuenta?
no_account: ¿Nuevo en %{product_name}?

View File

@@ -1,6 +1,13 @@
---
nb:
layouts:
application:
nav:
assistant: Assistent
budgets: Budsjett
home: Hjem
reports: Rapporter
transactions: Transaksjoner
auth:
existing_account: Har du allerede en konto?
no_account: Ny hos %{product_name}?
@@ -9,4 +16,4 @@ nb:
shared:
footer:
privacy_policy: Personvernerklæring
terms_of_service: Vilkår for bruk
terms_of_service: Vilkår for bruk

View File

@@ -1,6 +1,13 @@
---
pt-BR:
layouts:
application:
nav:
assistant: Assistente
budgets: Orçamentos
home: Início
reports: Relatórios
transactions: Transações
auth.sign_up:
existing_account: Já tem uma conta?
no_account: Novo no %{product_name}?

View File

@@ -1,6 +1,13 @@
---
ro:
layouts:
application:
nav:
assistant: Asistent
budgets: Bugete
home: Acasă
reports: Rapoarte
transactions: Tranzacții
auth:
existing_account: Ai deja un cont?
no_account: Ești nou pe %{product_name}?

View File

@@ -1,6 +1,13 @@
---
tr:
layouts:
application:
nav:
assistant: Asistan
budgets: Bütçeler
home: Ana Sayfa
reports: Raporlar
transactions: İşlemler
auth:
existing_account: Zaten bir hesabınız var mı?
no_account: "%{product_name}'ye yeni misiniz?"
@@ -9,4 +16,4 @@ tr:
shared:
footer:
privacy_policy: Gizlilik Politikası
terms_of_service: Hizmet Şartları
terms_of_service: Hizmet Şartları