diff --git a/.cursor/rules/general-rules.mdc b/.cursor/rules/general-rules.mdc index efe32cd30..f9f053759 100644 --- a/.cursor/rules/general-rules.mdc +++ b/.cursor/rules/general-rules.mdc @@ -11,7 +11,6 @@ alwaysApply: true - Read [project-design.mdc](mdc:.cursor/rules/project-design.mdc) to understand the codebase - Read [project-conventions.mdc](mdc:.cursor/rules/project-conventions.mdc) to understand _how_ to write code for the codebase - Read [ui-ux-design-guidelines.mdc](mdc:.cursor/rules/ui-ux-design-guidelines.mdc) to understand how to implement frontend code specifically -- Ignore i18n methods and files. Hardcode strings in English for now to optimize speed of development. - ActiveRecord migrations must inherit from `ActiveRecord::Migration[7.2]`. Do **not** use version 8.0 yet. ## Prohibited actions diff --git a/CLAUDE.md b/CLAUDE.md index 8f0e2de7f..575ba82c5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,8 +56,7 @@ Only proceed with pull request creation if ALL checks pass. - Use `Current.family` for the current family. Do NOT use `current_family`. ### Development Guidelines -- Prior to generating any code, carefully read the project conventions and guidelines -- Ignore i18n methods and files. Hardcode strings in English for now to optimize speed of development +- Carefully read project conventions and guidelines before generating any code. - Do not run `rails server` in your responses - Do not run `touch tmp/restart.txt` - Do not run `rails credentials` @@ -112,6 +111,15 @@ Sidekiq handles asynchronous tasks: - Always use functional tokens (e.g., `text-primary` not `text-white`) - Prefer semantic HTML elements over JS components - Use `icon` helper for icons, never `lucide_icon` directly +- **i18n**: All user-facing strings must use localization (i18n). Update locale files for each new or changed element. + +### Internationalization (i18n) Guidelines +- **Key Organization**: Use hierarchical keys by feature: `accounts.index.title`, `transactions.form.amount_label` +- **Translation Helper**: Always use `t()` helper for user-facing strings +- **Interpolation**: Use for dynamic content: `t("users.greeting", name: user.name)` +- **Pluralization**: Use Rails pluralization: `t("transactions.count", count: @transactions.count)` +- **Locale Files**: Update `config/locales/en.yml` for new strings +- **Missing Translations**: Configure to raise errors in development for missing keys ### Multi-Currency Support - All monetary values stored in base currency (user's primary currency) @@ -220,11 +228,36 @@ Sidekiq handles asynchronous tasks: ```erb
<%= t("components.transaction_details.amount_label") %>: <%= @transaction.amount %>
+<%= t("components.transaction_details.date_label") %>: <%= @transaction.date %>
+<%= t("components.transaction_details.category_label") %>: <%= @transaction.category.name %>
+Here's what's happening with your finances
++ <%= t("pages.dashboard.subtitle") %> +
No <%= classification_group.name %> yet
-<%= "Add your #{classification_group.name} accounts to see a full breakdown" %>
++ <%= t("pages.dashboard.balance_sheet.no_items", name: classification_group.name) %> +
++ <%= t("pages.dashboard.balance_sheet.add_accounts", name: classification_group.name) %> +
No cash flow data for this time period
-Add transactions to display cash flow data or expand the time period
+<%= t("pages.dashboard.cashflow_sankey.no_data_title") %>
+<%= t("pages.dashboard.cashflow_sankey.no_data_description") %>
<%= render DS::Link.new( - text: "Add transaction", + text: t("pages.dashboard.cashflow_sankey.add_transaction"), icon: "plus", href: new_transaction_path, frame: :modal diff --git a/app/views/pages/dashboard/_no_accounts_graph_placeholder.html.erb b/app/views/pages/dashboard/_no_accounts_graph_placeholder.html.erb index 5b0909c1f..b8cca831b 100644 --- a/app/views/pages/dashboard/_no_accounts_graph_placeholder.html.erb +++ b/app/views/pages/dashboard/_no_accounts_graph_placeholder.html.erb @@ -5,10 +5,10 @@ icon: "layers", ) %> -No accounts yet
-Add accounts to display net worth data
+<%= t("pages.dashboard.no_accounts.title") %>
+<%= t("pages.dashboard.no_accounts.description") %>
<%= render DS::Link.new( - text: "Add account", + text: t("pages.dashboard.no_accounts.add_account"), icon: "plus", href: new_account_path, frame: :modal diff --git a/app/views/pages/dashboard/_outflows_donut.html.erb b/app/views/pages/dashboard/_outflows_donut.html.erb index e89f4d4fe..cefd472f7 100644 --- a/app/views/pages/dashboard/_outflows_donut.html.erb +++ b/app/views/pages/dashboard/_outflows_donut.html.erb @@ -2,7 +2,7 @@