feat: opening_balance_date and opening_balance(i18n) (#1377)

* make default of opening_balance_date_label is TODAY

* feat(i18n): add multi-language support for opening balance label

- Use `t("valuations.show.opening_balance")` for all opening balance display (list and detail views)
- Add or update `opening_balance` translation in all major languages under `config/locales/views/valuations/`
- Now "Opening balance" will be localized in all supported languages

* revert -2.years

* Update config/locales/views/valuations/es.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Update config/locales/views/valuations/pt-BR.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Fix indentation for opening_balance in ro.yml

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Fix indentation for opening_balance in Turkish locale

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

* Update zh-TW.yml

Signed-off-by: Juan José Mata <jjmata@jjmata.com>

---------

Signed-off-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: Juan José Mata <jjmata@jjmata.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Tao Chen
2026-05-13 03:28:00 +08:00
committed by GitHub
parent f6fee24f99
commit 2a0fcd4fae
13 changed files with 21 additions and 7 deletions

View File

@@ -2,7 +2,8 @@
<%= tag.header class: "mb-4 space-y-1", id: dom_id(entry, :header) do %>
<span class="text-secondary text-sm">
<%= entry.name %>
<% valuation = entry.entryable %>
<%= valuation.respond_to?(:opening_anchor?) && valuation.opening_anchor? ? t("valuations.show.opening_balance") : entry.name %>
</span>
<div class="flex items-center gap-4">

View File

@@ -17,10 +17,12 @@
<%= render DS::FilledIcon.new(icon: icon, size: "md", hex_color: color, rounded: true) %>
<div class="truncate text-primary">
<%= link_to entry.name,
entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
class: "hover:underline" %>
<%= link_to(
valuation.opening_anchor? ? t("valuations.show.opening_balance") : entry.name,
entry_path(entry),
data: { turbo_frame: "drawer", turbo_prefetch: false },
class: "hover:underline"
) %>
</div>
</div>
</div>

View File

@@ -28,3 +28,4 @@ de:
note_placeholder: Füge zusätzliche Details zu diesem Eintrag hinzu
overview: Übersicht
settings: Einstellungen
opening_balance: Eröffnungssaldo

View File

@@ -30,3 +30,4 @@ en:
note_placeholder: Add any additional details about this entry
overview: Overview
settings: Settings
opening_balance: "Opening balance"

View File

@@ -30,3 +30,4 @@ es:
note_placeholder: Añade cualquier detalle adicional sobre esta entrada
overview: Resumen
settings: Configuración
opening_balance: Saldo inicial

View File

@@ -28,3 +28,4 @@ fr:
note_placeholder: Ajoutez tout détail supplémentaire à ce bilan
overview: Aperçu
settings: Paramètres
opening_balance: Solde d'ouverture

View File

@@ -27,4 +27,5 @@ nb:
note_label: Notater
note_placeholder: Legg til eventuelle tilleggsdetaljer om denne oppføringen
overview: Oversikt
settings: Innstillinger
settings: Innstillinger
opening_balance: Startsaldo

View File

@@ -28,3 +28,4 @@ nl:
note_placeholder: Voeg eventuele aanvullende details toe over deze invoer
overview: Overzicht
settings: Instellingen
opening_balance: Beginsaldo

View File

@@ -28,3 +28,4 @@ pt-BR:
note_placeholder: Adicione detalhes adicionais sobre esta entrada
overview: Visão geral
settings: Configurações
opening_balance: Saldo inicial

View File

@@ -24,3 +24,4 @@ ro:
note_placeholder: Adaugă orice detalii suplimentare despre această înregistrare
overview: Prezentare generală
settings: Setări
opening_balance: Sold inițial

View File

@@ -27,4 +27,5 @@ tr:
note_label: Notlar
note_placeholder: Bu girişle ilgili ek detaylar ekleyin
overview: Genel Bakış
settings: Ayarlar
settings: Ayarlar
opening_balance: ılış bakiyesi

View File

@@ -30,3 +30,4 @@ zh-CN:
note_placeholder: 添加此记录的其他详细信息
overview: 概览
settings: 设置
opening_balance: 初始余额

View File

@@ -28,3 +28,4 @@ zh-TW:
note_placeholder: 加入關於此紀錄的額外資訊
overview: 概覽
settings: 設定
opening_balance: 初始餘額