diff --git a/Gemfile b/Gemfile index 7f7a463bbb..33d9ff8efe 100644 --- a/Gemfile +++ b/Gemfile @@ -22,6 +22,7 @@ gem "trilogy", "~> 2.9" # Features gem "bcrypt", "~> 3.1.7" +gem "rails-i18n", "~> 8.0" # Vietnamese locale support for Rails gem "geared_pagination", "~> 1.2" gem "rqrcode" gem "redcarpet" diff --git a/Gemfile.lock b/Gemfile.lock index e535c98645..c7767bbc72 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -349,6 +349,9 @@ GEM rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + rails-i18n (8.1.0) + i18n (>= 0.7, < 2) + railties (>= 8.0.0, < 9) rainbow (3.1.1) rake (13.3.1) rdoc (6.16.1) @@ -528,6 +531,7 @@ DEPENDENCIES puma (>= 5.0) rack-mini-profiler rails! + rails-i18n (~> 8.0) redcarpet rouge rqrcode diff --git a/app/views/account/exports/show.html.erb b/app/views/account/exports/show.html.erb index f01c13dc5a..c5b3324a19 100644 --- a/app/views/account/exports/show.html.erb +++ b/app/views/account/exports/show.html.erb @@ -1,12 +1,12 @@ <% if @export.present? %> - <% @page_title = "Download Export" %> + <% @page_title = t("account.export.download_title") %> <% else %> - <% @page_title = "Download Expired" %> + <% @page_title = t("account.export.expired_title") %> <% end %> <% content_for :header do %>
- <%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %> + <%= back_link_to t("account.settings.title"), account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<% end %> @@ -14,16 +14,16 @@

<%= @page_title %>

<% if @export.present? %> -

Your export is ready. The download should start automatically.

+

<%= t("account.export.ready_message") %>

<%= link_to rails_blob_path(@export.file, disposition: "attachment"), id: "download-link", class: "btn btn--link", data: { turbo: false, controller: "auto-click" } do %> - Download your data + <%= t("account.export.download_data") %> <% end %> <% else %> -

That download link has expired. You’ll need to <%= link_to "request a new export", account_settings_path, class: "txt-lnk" %>.

+

<%= t("account.export.expired_message_html", link: link_to(t("account.export.request_new"), account_settings_path, class: "txt-lnk")).html_safe %>

<% end %> diff --git a/app/views/account/join_codes/edit.html.erb b/app/views/account/join_codes/edit.html.erb index bca92e58fa..d9cbf8ff6d 100644 --- a/app/views/account/join_codes/edit.html.erb +++ b/app/views/account/join_codes/edit.html.erb @@ -1,15 +1,15 @@ -<% @page_title = "Change usage limit" %> +<% @page_title = t("account.join_codes.change_limit_title") %> <% content_for :header do %>
- <%= back_link_to "Invite link", account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %> + <%= back_link_to t("account.join_codes.invite_link"), account_join_code_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<% end %>

<%= @page_title %>

-

How many times can this link be used to join the account?

+

<%= t("account.join_codes.change_limit_label") %>

<%= form_with model: @join_code, url: account_join_code_path, method: :patch, data: { controller: "form" }, html: { class: "flex flex-column gap" } do |form| %> @@ -19,13 +19,13 @@ data: { action: "keydown.esc@document->form#cancel focus->form#select" } %>

- This code has been used <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> times. + <%= t("account.join_codes.used_times") %> <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> <%= t("account.join_codes.times") %>.

<%= form.button type: :submit, class: "btn btn--link center txt-medium", data: { form_target: "submit" } do %> - Save changes + <%= t("common.buttons.save_changes") %> <% end %> - <%= link_to "Go back", account_join_code_path, data: { form_target: "cancel" }, hidden: true %> + <%= link_to t("account.join_codes.go_back"), account_join_code_path, data: { form_target: "cancel" }, hidden: true %> <% end %>
diff --git a/app/views/account/join_codes/show.html.erb b/app/views/account/join_codes/show.html.erb index f3cfb1e377..10330a64b3 100644 --- a/app/views/account/join_codes/show.html.erb +++ b/app/views/account/join_codes/show.html.erb @@ -1,15 +1,15 @@ -<% @page_title = "Add people" %> +<% @page_title = t("account.join_codes.title") %> <% content_for :header do %>
- <%= back_link_to "Account Settings", account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %> + <%= back_link_to t("account.settings.title"), account_settings_path, "keydown.left@document->hotkey#click keydown.esc@document->hotkey#click" %>
<% end %>

<%= @page_title %>

-

Share the link below to invite people to this account

+

<%= t("account.join_codes.description") %>

<% url = join_url(code: @join_code.code, script_name: Current.account.slug) %> @@ -18,9 +18,9 @@ <% if Current.user.admin? %> <%= button_to account_join_code_path, method: :delete, class: "btn btn--circle txt-small", data: { - turbo_confirm: "Are you sure you want to generate a new link? The previous code will stop working." } do %> + turbo_confirm: t("account.join_codes.generate_confirm") } do %> <%= icon_tag "refresh" %> - Generate a new code + <%= t("account.join_codes.generate_new") %> <% end %> <% end %>
@@ -30,23 +30,23 @@ controller: "copy-to-clipboard", action: "copy-to-clipboard#copy", copy_to_clipboard_success_class: "btn--success", copy_to_clipboard_content_value: url } do %> <%= icon_tag "copy-paste" %> - Copy invite link + <%= t("account.join_codes.copy_link") %> <% end %>
<%= tag.button class: "btn", data: { action: "dialog#open" } do %> <%= icon_tag "qr-code" %> - Get QR code + <%= t("account.join_codes.get_qr") %> <% end %> -

Scan this code with the camera on your mobile device

+

<%= t("account.join_codes.qr_instruction") %>

<%= qr_code_image(url) %>
@@ -57,12 +57,12 @@

"> - This code has been used <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> times - (<%= @join_code.active? ? @join_code.usage_limit - @join_code.usage_count : "none" %> remaining) + <%= t("account.join_codes.used_times") %> <%= @join_code.usage_count %>/<%= @join_code.usage_limit %> <%= t("account.join_codes.times") %> + (<%= @join_code.active? ? @join_code.usage_limit - @join_code.usage_count : t("account.join_codes.none") %> <%= t("account.join_codes.remaining") %>) <% if Current.user.admin? %> <%= link_to edit_account_join_code_path, class: @join_code.active? ? "txt-link" : "txt-negative txt-underline" do %> - Change limit + <%= t("account.join_codes.change_limit") %> <% end %> <% end %>

diff --git a/app/views/account/settings/_entropy.html.erb b/app/views/account/settings/_entropy.html.erb index 53f5064ce1..f1838d7290 100644 --- a/app/views/account/settings/_entropy.html.erb +++ b/app/views/account/settings/_entropy.html.erb @@ -1,6 +1,6 @@
-

Auto close

-

Fizzy doesn’t let stale cards stick around forever. Cards automatically move to “Not Now” if there is no activity for specific period of time. This is the default, global setting — you can override it on each board.

+

<%= t("account.entropy.title") %>

+

<%= t("account.entropy.description") %>

<%= render "entropy/auto_close", model: account.entropy, url: account_entropy_path, disabled: !Current.user.admin? %> diff --git a/app/views/account/settings/_export.html.erb b/app/views/account/settings/_export.html.erb index d44bb4b744..a09b345dbc 100644 --- a/app/views/account/settings/_export.html.erb +++ b/app/views/account/settings/_export.html.erb @@ -1,19 +1,19 @@
-

Export your data

-

Download an archive of your Fizzy data.

+

<%= t("account.export.title") %>

+

<%= t("account.export.description") %>

- + -

Export your account data

-

This will kick off a request to generate a ZIP archive of all the data in boards you have access to.

-

When the file is ready, we’ll email you a link to download it. The link will expire after 24 hours.

+

<%= t("account.export.dialog_title") %>

+

<%= t("account.export.dialog_body_1") %>

+

<%= t("account.export.dialog_body_2") %>

- <%= button_to "Start export", account_exports_path, method: :post, class: "btn btn--link", form: { data: { action: "submit->dialog#close" } } %> - + <%= button_to t("account.export.start_button"), account_exports_path, method: :post, class: "btn btn--link", form: { data: { action: "submit->dialog#close" } } %> +
\ No newline at end of file diff --git a/app/views/account/settings/_name.html.erb b/app/views/account/settings/_name.html.erb index e3b12f325e..ab63a3195b 100644 --- a/app/views/account/settings/_name.html.erb +++ b/app/views/account/settings/_name.html.erb @@ -1,10 +1,10 @@ <%= form_with model: account, url: account_settings_path, method: :put, scope: :account, data: { controller: "form" }, class: "flex gap-half" do |form| %> - <%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: "Account name…", data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.admin? %> + <%= form.text_field :name, required: true, class: "input input--transparent full-width txt-medium", placeholder: t("account.settings.name_placeholder"), data: { action: "input->form#disableSubmitWhenInvalid" }, readonly: !Current.user.admin? %> <% if Current.user.admin? %> <%= form.button class: "btn btn--circle btn--link txt-medium", data: { form_target: "submit" }, disabled: form.object do %> <%= icon_tag "arrow-right" %> - Save changes + <%= t("common.buttons.save_changes") %> <% end %> <% end %> <% end %> diff --git a/app/views/account/settings/_user.html.erb b/app/views/account/settings/_user.html.erb index 6bc65acd8e..6a2e61f886 100644 --- a/app/views/account/settings/_user.html.erb +++ b/app/views/account/settings/_user.html.erb @@ -11,9 +11,9 @@ <%= form_with model: user, url: user_role_path(user), data: { controller: "form" }, method: :patch do | form | %> - @@ -22,8 +22,8 @@ <%# FIXME: Move this Current.user check to a stimulus controller that just checks for admin? or the like we so we can cache user list %> <%= button_to user, method: :delete, class: "btn btn--circle btn--negative", disabled: !Current.user.can_administer?(user), - data: { turbo_confirm: "Are you sure you want to permanently remove this person from the account?" } do %> + data: { turbo_confirm: t("account.people.remove_confirm") } do %> <%= icon_tag "minus" %> - Remove <%= user.name %> from the account + <%= t("account.people.remove_user", name: user.name) %> <% end %> diff --git a/app/views/account/settings/_users.html.erb b/app/views/account/settings/_users.html.erb index 5e571eb67b..1f38a8efdd 100644 --- a/app/views/account/settings/_users.html.erb +++ b/app/views/account/settings/_users.html.erb @@ -1,5 +1,5 @@
-

People on this account

+

<%= t("account.people.title") %>

<%= tag.div class: "flex flex-column gap settings__user-filter", data: { @@ -10,7 +10,7 @@ } do %>
- + " class="input input--transparent full-width txt-small" type="search" autocorrect="off" autocomplete="off" data-1p-ignore="true" data-filter-target="input" data-action="input->filter#filter">