The personal finance app for everyone (by everyone)
Ruby
fix(i18n): drop redundant Questrade t() default: strings (#2976)
William Wei Mingb754065858b3
diff --git a/app/views/questrade_items/_questrade_item.html.erb b/app/views/questrade_items/_questrade_item.html.erbindex 07f2d50ae8..50d67e2aa6 100644--- a/app/views/questrade_items/_questrade_item.html.erb+++ b/app/views/questrade_items/_questrade_item.html.erb@@ -19,30 +19,30 @@<div class="flex items-center gap-2"><%= tag.p "Questrade", class: "font-medium text-primary" %><% if questrade_item.scheduled_for_deletion? %>- <p class="text-destructive text-sm animate-pulse"><%= t(".deletion_in_progress", default: "Removing…") %></p>+ <p class="text-destructive text-sm animate-pulse"><%= t(".deletion_in_progress") %></p><% end %></div>- <p class="text-xs text-secondary"><%= t(".kind", default: "Brokerage") %></p>+ <p class="text-xs text-secondary"><%= t(".kind") %></p><% if questrade_item.syncing? %><div class="text-secondary flex items-center gap-1"><%= icon "loader", size: "sm", class: "animate-spin" %>- <%= tag.span t(".syncing", default: "Syncing…") %>+ <%= tag.span t(".syncing") %></div><% elsif questrade_item.sync_error.present? %><div class="text-secondary flex items-center gap-1"><%= render DS::Tooltip.new(text: questrade_item.sync_error, icon: "alert-circle", size: "sm", color: "destructive", as: :span) %>- <%= tag.span t(".error", default: "Sync error"), class: "text-destructive" %>+ <%= tag.span t(".error"), class: "text-destructive" %></div><% else %><p class="text-secondary"><% if questrade_item.last_synced_at %><% if questrade_item.sync_status_summary %>- <%= t(".status_with_summary", default: "Synced %{timestamp} ago · %{summary}", timestamp: time_ago_in_words(questrade_item.last_synced_at), summary: questrade_item.sync_status_summary) %>+ <%= t(".status_with_summary", timestamp: time_ago_in_words(questrade_item.last_synced_at), summary: questrade_item.sync_status_summary) %><% else %>- <%= t(".status", default: "Synced %{timestamp} ago", timestamp: time_ago_in_words(questrade_item.last_synced_at)) %>+ <%= t(".status", timestamp: time_ago_in_words(questrade_item.last_synced_at)) %><% end %><% else %>- <%= t(".status_never", default: "Not synced yet") %>+ <%= t(".status_never") %><% end %></p><% end %>@@ -56,7 +56,7 @@<%= render DS::Menu.new do |menu| %><% menu.with_item(variant: "button",- text: t(".delete", default: "Delete"),+ text: t(".delete"),icon: "trash-2",href: questrade_item_path(questrade_item),method: :delete,@@ -92,15 +92,15 @@<% if unlinked_count > 0 %><div class="p-4 flex flex-col gap-3 items-center justify-center">- <p class="text-primary font-medium text-sm"><%= t(".setup_needed", default: "Accounts need setup") %></p>- <p class="text-secondary text-sm"><%= t(".setup_description", default: "%{linked} of %{total} accounts linked", linked: linked_count, total: total_count) %></p>- <%= render DS::Link.new(text: t(".setup_action", default: "Set up accounts"), icon: "settings", variant: "primary", href: setup_accounts_questrade_item_path(questrade_item), frame: :modal) %>+ <p class="text-primary font-medium text-sm"><%= t(".setup_needed") %></p>+ <p class="text-secondary text-sm"><%= t(".setup_description", linked: linked_count, total: total_count) %></p>+ <%= render DS::Link.new(text: t(".setup_action"), icon: "settings", variant: "primary", href: setup_accounts_questrade_item_path(questrade_item), frame: :modal) %></div><% elsif questrade_item.accounts.empty? && total_count == 0 %><div class="p-4 flex flex-col gap-3 items-center justify-center">- <p class="text-primary font-medium text-sm"><%= t(".no_accounts_title", default: "No accounts found") %></p>- <p class="text-secondary text-sm"><%= t(".no_accounts_description", default: "We could not find any Questrade accounts to import.") %></p>- <%= render DS::Link.new(text: t(".setup_action", default: "Set up accounts"), icon: "settings", variant: "primary", href: setup_accounts_questrade_item_path(questrade_item), frame: :modal) %>+ <p class="text-primary font-medium text-sm"><%= t(".no_accounts_title") %></p>+ <p class="text-secondary text-sm"><%= t(".no_accounts_description") %></p>+ <%= render DS::Link.new(text: t(".setup_action"), icon: "settings", variant: "primary", href: setup_accounts_questrade_item_path(questrade_item), frame: :modal) %></div><% end %></div>diff --git a/app/views/questrade_items/select_existing_account.html.erb b/app/views/questrade_items/select_existing_account.html.erbindex b1298b9291..3573bc642b 100644--- a/app/views/questrade_items/select_existing_account.html.erb+++ b/app/views/questrade_items/select_existing_account.html.erb@@ -1,25 +1,25 @@-<% content_for :title, t(".page_title", default: "Link a Questrade account") %>+<% content_for :title, t(".page_title") %><%= render DS::Dialog.new(disable_click_outside: true) do |dialog| %>- <% dialog.with_header(title: t(".dialog_title", default: "Link to a Questrade account")) do %>+ <% dialog.with_header(title: t(".dialog_title")) do %><div class="flex items-center gap-2"><%= icon "link", class: "text-primary" %>- <span class="text-primary"><%= t(".subtitle", default: "Connect this account to one of your Questrade accounts") %></span>+ <span class="text-primary"><%= t(".subtitle") %></span></div><% end %><% dialog.with_body do %><div class="space-y-6"><div class="bg-surface border border-primary p-4 rounded-lg">- <p class="text-sm text-secondary"><%= t(".linking_label", default: "Linking") %></p>+ <p class="text-sm text-secondary"><%= t(".linking_label") %></p><p class="font-medium text-primary"><%= @account.name %></p></div><% if @questrade_accounts.blank? %><div class="flex flex-col items-center justify-center py-6 space-y-3"><%= icon "alert-circle", size: "lg", class: "text-warning" %>- <p class="text-primary text-center font-medium"><%= t(".none_available", default: "No unlinked Questrade accounts available.") %></p>- <%= render DS::Link.new(text: t(".buttons.cancel", default: "Cancel"), variant: "secondary", href: account_path(@account), frame: "_top") %>+ <p class="text-primary text-center font-medium"><%= t(".none_available") %></p>+ <%= render DS::Link.new(text: t(".buttons.cancel"), variant: "secondary", href: account_path(@account), frame: "_top") %></div><% else %><div class="space-y-2">@@ -32,13 +32,13 @@<p class="font-medium text-primary"><%= questrade_account.name %></p><p class="text-xs text-secondary"><%= [ questrade_account.account_type, questrade_account.currency ].compact.join(" · ") %></p></div>- <%= render DS::Button.new(text: t(".buttons.link", default: "Link"), variant: "secondary", size: "sm", type: "submit") %>+ <%= render DS::Button.new(text: t(".buttons.link"), variant: "secondary", size: "sm", type: "submit") %><% end %><% end %></div><div class="flex justify-end">- <%= render DS::Link.new(text: t(".buttons.cancel", default: "Cancel"), variant: "ghost", href: account_path(@account), frame: "_top") %>+ <%= render DS::Link.new(text: t(".buttons.cancel"), variant: "ghost", href: account_path(@account), frame: "_top") %></div><% end %></div>diff --git a/app/views/questrade_items/setup_accounts.html.erb b/app/views/questrade_items/setup_accounts.html.erbindex 4b8b4616b2..34710bfe09 100644--- a/app/views/questrade_items/setup_accounts.html.erb+++ b/app/views/questrade_items/setup_accounts.html.erb@@ -1,10 +1,10 @@-<% content_for :title, t(".page_title", default: "Set up Questrade accounts") %>+<% content_for :title, t(".page_title") %><%= render DS::Dialog.new(disable_click_outside: true) do |dialog| %>- <% dialog.with_header(title: t(".dialog_title", default: "Set up your Questrade accounts")) do %>+ <% dialog.with_header(title: t(".dialog_title")) do %><div class="flex items-center gap-2"><%= icon "chart-line", class: "text-primary" %>- <span class="text-primary"><%= t(".subtitle", default: "Choose how to import each account") %></span>+ <span class="text-primary"><%= t(".subtitle") %></span></div><% end %>@@ -13,8 +13,8 @@<% if @unlinked_accounts.blank? %><div class="flex flex-col items-center justify-center py-6 space-y-3"><%= icon "check-circle", size: "lg", class: "text-success" %>- <p class="text-primary text-center font-medium"><%= t(".all_linked", default: "All Questrade accounts are already linked.") %></p>- <%= render DS::Link.new(text: t(".buttons.done", default: "Done"), variant: "primary", href: accounts_path, frame: "_top") %>+ <p class="text-primary text-center font-medium"><%= t(".all_linked") %></p>+ <%= render DS::Link.new(text: t(".buttons.done"), variant: "primary", href: accounts_path, frame: "_top") %></div><% else %><%= form_with url: complete_account_setup_questrade_item_path(@questrade_item), method: :post, data: { turbo_frame: "_top" }, class: "space-y-6" do %>@@ -27,14 +27,14 @@</p><label class="block text-sm text-secondary mb-1" for="account_type_<%= questrade_account.id %>">- <%= t(".import_as", default: "Import as") %>+ <%= t(".import_as") %></label><select id="account_type_<%= questrade_account.id %>"name="accounts[<%= questrade_account.id %>][account_type]"class="bg-container border border-primary rounded px-2 py-1 text-sm text-primary w-full">- <option value="investment" selected><%= t(".types.investment", default: "Investment") %></option>- <option value="depository"><%= t(".types.depository", default: "Cash / Depository") %></option>- <option value="skip"><%= t(".types.skip", default: "Skip this account") %></option>+ <option value="investment" selected><%= t(".types.investment") %></option>+ <option value="depository"><%= t(".types.depository") %></option>+ <option value="skip"><%= t(".types.skip") %></option></select></div><% end %>@@ -42,13 +42,13 @@<div class="flex gap-3"><%= render DS::Button.new(- text: t(".buttons.create", default: "Create accounts"),+ text: t(".buttons.create"),variant: "primary",icon: "plus",type: "submit",class: "flex-1") %>- <%= render DS::Link.new(text: t(".buttons.cancel", default: "Cancel"), variant: "secondary", href: accounts_path, frame: "_top") %>+ <%= render DS::Link.new(text: t(".buttons.cancel"), variant: "secondary", href: accounts_path, frame: "_top") %></div><% end %><% end %>diff --git a/app/views/settings/providers/_questrade_panel.html.erb b/app/views/settings/providers/_questrade_panel.html.erbindex 08f8d7f684..041924d038 100644--- a/app/views/settings/providers/_questrade_panel.html.erb+++ b/app/views/settings/providers/_questrade_panel.html.erb@@ -4,16 +4,16 @@<% unless connected %><%= render "settings/providers/setup_steps",- eyebrow: t("questrade_items.panel.eyebrow", default: "Setup · desktop only"),+ eyebrow: t("questrade_items.panel.eyebrow"),steps: [- t("questrade_items.panel.steps.s1_html", default: %q{Sign in to the <a href="https://my.questrade.com" target="_blank" rel="noopener noreferrer" class="text-primary font-medium underline">Questrade portal</a> on a desktop browser. The API settings are not available in the mobile app.}).html_safe,- t("questrade_items.panel.steps.s2", default: "Open Settings, and under General settings edit the IQ API settings."),- t("questrade_items.panel.steps.s3_html", default: %q{In the API access modal, click <strong>Manage</strong> under <strong>My applications</strong>.}).html_safe,- t("questrade_items.panel.steps.s4", default: "Register a personal app with a name and description, then save."),- t("questrade_items.panel.steps.s5", default: "Add a new device and generate a token."),- t("questrade_items.panel.steps.s6", default: "Paste the generated token below and save.")+ t("questrade_items.panel.steps.s1_html").html_safe,+ t("questrade_items.panel.steps.s2"),+ t("questrade_items.panel.steps.s3_html").html_safe,+ t("questrade_items.panel.steps.s4"),+ t("questrade_items.panel.steps.s5"),+ t("questrade_items.panel.steps.s6")],- help: { url: "https://www.questrade.com/api/documentation/getting-started", text: t("questrade_items.panel.help_text", default: "Questrade API docs") } %>+ help: { url: "https://www.questrade.com/api/documentation/getting-started", text: t("questrade_items.panel.help_text") } %><% end %><% error_msg = local_assigns[:error_message] || @error_message %>@@ -50,13 +50,13 @@<div class="flex items-center gap-2 mt-4"><%= render DS::Button.new(- text: t("questrade_items.panel.disconnect", default: "Disconnect"),+ text: t("questrade_items.panel.disconnect"),icon: "trash-2",variant: :outline_destructive,size: :sm,href: questrade_item_path(items.first),method: :delete,- data: { turbo_frame: "_top", turbo_confirm: t("questrade_items.panel.disconnect_confirm", default: "Disconnect Questrade? This removes the connection and unlinks its synced accounts.") }+ data: { turbo_frame: "_top", turbo_confirm: t("questrade_items.panel.disconnect_confirm") }) %></div><% else %>diff --git a/config/locales/views/questrade_items/en.yml b/config/locales/views/questrade_items/en.ymlindex 3ba28ff3d8..0ba0107e00 100644--- a/config/locales/views/questrade_items/en.yml+++ b/config/locales/views/questrade_items/en.yml@@ -30,6 +30,17 @@ en:# Panel (settings view)panel:+ eyebrow: "Setup · desktop only"+ help_text: "Questrade API docs"+ disconnect: "Disconnect"+ disconnect_confirm: "Disconnect Questrade? This removes the connection and unlinks its synced accounts."+ steps:+ s1_html: 'Sign in to the <a href="https://my.questrade.com" target="_blank" rel="noopener noreferrer" class="text-primary font-medium underline">Questrade portal</a> on a desktop browser. The API settings are not available in the mobile app.'+ s2: "Open Settings, and under General settings edit the IQ API settings."+ s3_html: "In the API access modal, click <strong>Manage</strong> under <strong>My applications</strong>."+ s4: "Register a personal app with a name and description, then save."+ s5: "Add a new device and generate a token."+ s6: "Paste the generated token below and save."setup_instructions: "Setup instructions:"step_1: "Visit your Questrade dashboard to get your credentials"step_2: "Enter your credentials below and click the Save button"@@ -129,6 +140,13 @@ en:# Select existing account viewselect_existing_account:+ page_title: "Link a Questrade account"+ dialog_title: "Link to a Questrade account"+ linking_label: "Linking"+ none_available: "No unlinked Questrade accounts available."+ buttons:+ cancel: "Cancel"+ link: "Link"account_already_linked: "This account is already linked to a provider"all_accounts_already_linked: "All Questrade accounts are already linked"api_error: "API error: %{message}"@@ -149,7 +167,7 @@ en:no_credentials_configured: "Please configure your Questrade credentials first in Provider Settings."no_name_placeholder: "(No name)"settings_link: "Go to Provider Settings"- subtitle: "Choose a Questrade account"+ subtitle: "Connect this account to one of your Questrade accounts"title: "Link %{account_name} with Questrade"# Link existing account@@ -165,6 +183,18 @@ en:# Setup accounts wizardsetup_accounts:+ page_title: "Set up Questrade accounts"+ dialog_title: "Set up your Questrade accounts"+ all_linked: "All Questrade accounts are already linked."+ import_as: "Import as"+ buttons:+ cancel: "Cancel"+ create: "Create accounts"+ done: "Done"+ types:+ investment: "Investment"+ depository: "Cash / Depository"+ skip: "Skip this account"account_type_label: "Account Type:"accounts_count:one: "%{count} account available"@@ -230,7 +260,7 @@ en:create_accounts: "Create Accounts"creating_accounts: "Creating Accounts..."historical_data_range: "Historical Data Range:"- subtitle: "Choose the correct account types for your imported accounts"+ subtitle: "Choose how to import each account"sync_start_date_help: "Select how far back you want to sync transaction history."sync_start_date_label: "Start syncing transactions from:"title: "Set Up Your Questrade Accounts"