From 64f794256c271e8d88836d71f971037043262baa Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 12 Feb 2022 23:12:55 +0100 Subject: [PATCH 01/10] Translate title of theme settings page --- app/views/user/edit_theme.haml | 6 +++--- config/locales/views.en.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/user/edit_theme.haml b/app/views/user/edit_theme.haml index e4060ce2..6dd17ba8 100644 --- a/app/views/user/edit_theme.haml +++ b/app/views/user/edit_theme.haml @@ -1,4 +1,4 @@ -= render 'settings/theme' += render "settings/theme" -- provide(:title, generate_title('Theme Settings')) -- parent_layout 'user/settings' +- provide(:title, generate_title(t(".title"))) +- parent_layout "user/settings" diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index a54a55f5..c6aeb524 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -55,3 +55,5 @@ en: user: edit: title: "Profile Settings" + edit_theme: + title: "Theme Settings" From 78357faed53b5d8fc6f512110aa50b66f5f15927 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 12 Feb 2022 23:39:51 +0100 Subject: [PATCH 02/10] Translate lead section of theme settings --- app/views/settings/_theme.haml | 17 +++++------------ config/locales/views.en.yml | 10 +++++++++- config/locales/voc.en.yml | 3 ++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/views/settings/_theme.haml b/app/views/settings/_theme.haml index 50ea4918..4f81e1dc 100644 --- a/app/views/settings/_theme.haml +++ b/app/views/settings/_theme.haml @@ -1,20 +1,13 @@ .card .card-body - %h1 Theming - %p.lead Welcome to the Theme Editor! - %p - Here you'll be able to modify your Retrospring experience by adjusting all available colors. - To further help you with adjusting needs, there are a few example elements using the specified colors, and sections will include - descriptions on their general use on the site! - - %p - And with that: - %b Happy Theming! + %h1= t(".heading") + %p.lead= t(".lead") + = t(".body_html") - if current_user.theme .pull-right - = button_to 'Delete Theme', delete_user_theme_path, data: { confirm: 'Are you sure?' }, tabindex: -1, method: :delete, class: 'btn btn-danger' -= bootstrap_form_for(current_user.theme || Theme.new, url: { action: 'update_theme' }, html: { id: 'update_theme' }, method: :patch) do |f| + = button_to t(".delete"), delete_user_theme_path, data: { confirm: t("voc.confirm") }, tabindex: -1, method: :delete, class: "btn btn-danger" += bootstrap_form_for(current_user.theme || Theme.new, url: { action: "update_theme" }, html: { id: "update_theme" }, method: :patch) do |f| .card .card-body %h2 General diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index c6aeb524..d54c499b 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -38,7 +38,6 @@ en: password: "Leave this blank if you don't want to change it" delete: action: "Delete my account" - confirm: "Are you sure?" heading: "Unsatisfied?" profile: adjust: @@ -52,6 +51,15 @@ en: connect: "Connect to %{service}" disconnect: "Disconnect" confirm: "Really disconnect service %{service}?" + theme: + heading: "Theming" + lead: "Welcome to the Theme Editor!" + body_html: | +

Here you'll be able to modify your Retrospring experience by adjusting all available colors. + To further help you with adjusting needs, there are a few example elements using the specified colors, and sections will include + descriptions on their general use on the site!

+

And with that: Happy Theming! + delete: "Delete Theme" user: edit: title: "Profile Settings" diff --git a/config/locales/voc.en.yml b/config/locales/voc.en.yml index f7e7fd0a..3c50ff5a 100644 --- a/config/locales/voc.en.yml +++ b/config/locales/voc.en.yml @@ -2,10 +2,11 @@ en: voc: cancel: "Cancel" close: "Close" + confirm: "Are you sure?" delete: "Delete" edit: "Edit" login: "Sign in" save: "Save changes" register: "Sign up" terms: "Terms of Service" - update: "Update" + update: "Update" \ No newline at end of file From 83edbad53bd72b5b587abc42ef8733fa2659e617 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sat, 12 Feb 2022 23:40:19 +0100 Subject: [PATCH 03/10] Switch confirm dialog text on account settings to `voc.confirm` --- app/views/settings/_account.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/settings/_account.haml b/app/views/settings/_account.haml index 22152fb0..dc5bfa11 100644 --- a/app/views/settings/_account.haml +++ b/app/views/settings/_account.haml @@ -19,6 +19,6 @@ %hr/ %p = t(".delete.heading") - = button_to t(".delete.action"), "/settings/account", data: { confirm: t(".delete.confirm") }, method: :delete, class: "btn btn-danger btn-xs" + = button_to t(".delete.action"), "/settings/account", data: { confirm: t("voc.confirm") }, method: :delete, class: "btn btn-danger btn-xs" .visible-xs= render "shared/links" From 84a72ce8cc9f6f250bec6fdaa2fc5d1eafff15bd Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:27:46 +0100 Subject: [PATCH 04/10] Translate general and colors theme settings sections --- app/views/settings/_theme.haml | 48 +++++++++------------------------- config/locales/views.en.yml | 23 ++++++++++++++++ 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/app/views/settings/_theme.haml b/app/views/settings/_theme.haml index 4f81e1dc..42ca07d0 100644 --- a/app/views/settings/_theme.haml +++ b/app/views/settings/_theme.haml @@ -10,9 +10,8 @@ = bootstrap_form_for(current_user.theme || Theme.new, url: { action: "update_theme" }, html: { id: "update_theme" }, method: :patch) do |f| .card .card-body - %h2 General - %p - Here you'll find general page values that are basically visible all across the page. + %h2= t(".general.heading") + %p= t(".general.body") .row .col-sm-6 = f.text_field :background_color, class: 'color', data: { default: 0xF0EDF4 } @@ -20,86 +19,63 @@ = f.text_field :body_text, class: 'color', data: { default: 0x000000 } .card .card-body - %h2 Colors - %p - Colors you can find used on the site. The names of the colors usually describe the context. - The "text" colors for all styles represent the color that text on top of these colors has. + %h2= t(".colors.heading") + %p= t(".colors.body") - %ul - %li - %b Primary: - The primary/brand color of the site, used for navigation, links, etc. - %li - %b Danger: - Color used for errors or critical actions like deleting something. - %li - %b Warning: - Color used for warnings if something non-critical has happened. - %li - %b Info: - Color used for informational popups or messages. - %li - %b Success: - Color used for messages if something went through successfully. .row .col-sm-6 = f.text_field :primary_color, class: 'color', data: { default: 0x5E35B1 } .col-sm-6 = f.text_field :primary_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - .alert.alert-primary - A simple primary alert—check it out! + .alert.alert-primary= t(".colors.alert.example", type: t(".colors.alert.type.primary")) .row .col-sm-6 = f.text_field :danger_color, class: 'color', data: { default: 0xDC3545 } .col-sm-6 = f.text_field :danger_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - .alert.alert-danger - A simple danger alert—check it out! + .alert.alert-danger= t(".colors.alert.example", type: t(".colors.alert.type.danger")) .row .col-sm-6 = f.text_field :warning_color, class: 'color', data: { default: 0xFFC107 } .col-sm-6 = f.text_field :warning_text, class: 'color', data: { default: 0x292929 } .col-sm-12 - .alert.alert-warning - A simple warning alert—check it out! + .alert.alert-warning= t(".colors.alert.example", type: t(".colors.alert.type.warning")) .row .col-sm-6 = f.text_field :info_color, class: 'color', data: { default: 0x17A2B8 } .col-sm-6 = f.text_field :info_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - .alert.alert-info - A simple info alert—check it out! + .alert.alert-info= t(".colors.alert.example", type: t(".colors.alert.type.info")) .row .col-sm-6 = f.text_field :success_color, class: 'color', data: { default: 0x28A745 } .col-sm-6 = f.text_field :success_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - .alert.alert-success - A simple success alert—check it out! + .alert.alert-success= t(".colors.alert.example", type: t(".colors.alert.type.success")) .row .col-sm-6 = f.text_field :dark_color, class: 'color', data: { default: 0x343A40 } .col-sm-6 = f.text_field :dark_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - %a.btn.btn-dark.mb-3{ href: '#' } A dark button + %a.btn.btn-dark.mb-3{ href: '#' }= t(".colors.button.example", type: t(".colors.button.type.dark")) .row .col-sm-6 = f.text_field :light_color, class: 'color', data: { default: 0xF8F9FA } .col-sm-6 = f.text_field :light_text, class: 'color', data: { default: 0xFFFFFF } .col-sm-12 - %a.btn.btn-light.mb-3{ href: '#' } A light button + %a.btn.btn-light.mb-3{ href: '#' }= t(".colors.button.example", type: t(".colors.button.type.light")) .row .col-sm-6 = f.text_field :muted_text, class: 'color', data: { default: 0x6C757D } .col-sm-6 - %p.pt-4.text-muted Some muted text + %p.pt-4.text-muted= t(".colors.text.example") .card .card-body %h2 Forms and Inputs diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index d54c499b..e2628291 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -60,6 +60,29 @@ en: descriptions on their general use on the site!

And with that: Happy Theming! delete: "Delete Theme" + general: + heading: "General" + body: "Here you'll find general page values that are basically visible all across the page." + colors: + heading: "Colors" + body: | + Colors you can find used on the site. The names of the colors usually describe the context. + The "text" colors for all styles represent the color that text on top of these colors has. + alert: + example: "A simple %{type} alert — check it out!" + type: + danger: "danger" + info: "info" + primary: "primary" + success: "success" + warning: "warning" + button: + example: "A %{type} button" + type: + dark: "dark" + light: "light" + text: + example: "Some muted text" user: edit: title: "Profile Settings" From 8159d556ab41fc00b8ef2c0e6adb25026c44e046 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:28:10 +0100 Subject: [PATCH 05/10] Translate general and color theme model attributes --- config/locales/activerecord.en.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index b9b5f82b..312d228c 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -19,6 +19,24 @@ en: website: "Website" service: post_tag: "Tag" + theme: + background_color: "Background color" + body_text: "Body text color" + dark_color: "Dark color" + dark_text: "Dark text color" + danger_color: "Danger color" + danger_text: "Danger text color" + info_color: "Info color" + info_text: "Info text color" + light_color: "Light color" + light_text: "Light text color" + muted_text: "Muted text color" + primary_color: "Primary color" + primary_text: "Primary text color" + success_color: "Success color" + success_text: "Success text color" + warning_color: "Warning color" + warning_text: "Warning text color" user: current_password: "Current password" email: "Email" @@ -37,6 +55,12 @@ en: motivation_header: "Shown in the header of the question box on your profile. Motivate users to ask you questions!" services/twitter: post_tag: "Automatically append a tag to your shared answers. A # symbol is not automatically prepended." + theme: + danger_color: "Color used for errors or critical actions like deleting something." + info_color: "Color used for informational popups or messages." + primary_color: "The primary/brand color of the site, used for navigation, links, etc." + success_color: "Color used for messages if something went through successfully." + warning_color: "Color used for warnings if something non-critical has happened." helpers: submit: user: From c50df2f6606f0e45287f212310316b72161f57c0 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:39:01 +0100 Subject: [PATCH 06/10] Translate forms and raised theme settings sections --- app/views/settings/_theme.haml | 17 +++++++++-------- config/locales/views.en.yml | 8 ++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/views/settings/_theme.haml b/app/views/settings/_theme.haml index 42ca07d0..bea99510 100644 --- a/app/views/settings/_theme.haml +++ b/app/views/settings/_theme.haml @@ -12,6 +12,7 @@ .card-body %h2= t(".general.heading") %p= t(".general.body") + .row .col-sm-6 = f.text_field :background_color, class: 'color', data: { default: 0xF0EDF4 } @@ -78,9 +79,9 @@ %p.pt-4.text-muted= t(".colors.text.example") .card .card-body - %h2 Forms and Inputs - %p - Styles for form inputs, like textfields. + %h2= t(".forms.heading") + %p= t(".forms.body") + .row .col-sm-6 = f.text_field :input_color, class: 'color', data: { default: 0xFFFFFF } @@ -88,17 +89,17 @@ = f.text_field :input_text, class: 'color', data: { default: 0x000000 } .card .card-body - %h2 Raised Content - %p - Raised content basically describes all the different boxes and panels you can see across the site. + %h2= t(".raised.heading") + %p= t(".raised.body") + .row .col-sm-6 = f.text_field :raised_background, class: 'color', data: { default: 0xFFFFFF } .col-sm-6 = f.text_field :raised_accent, class: 'color', data: { default: 0xF7F7F7 } .card-footer - %p Some text on top of a accented area on a raised element! + %p= t(".raised.accent.example") .card .card-body .pull-left - = f.submit t('views.actions.save'), class: 'btn btn-primary' + = f.primary diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index e2628291..a892be8b 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -83,6 +83,14 @@ en: light: "light" text: example: "Some muted text" + forms: + heading: "Forms and Inputs" + body: "Styles for form inputs, like text fields." + raised: + heading: "Raised Content" + body: "Raised content basically describes all the different boxes and panels you can see across the site." + accent: + example: "Some text on top of a accented area on a raised element!" user: edit: title: "Profile Settings" From ec680d672269ad2f2ced3b997e87f8631c2ec190 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:39:53 +0100 Subject: [PATCH 07/10] Translate forms and raised theme model attributes --- config/locales/activerecord.en.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index 312d228c..e5468101 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -28,11 +28,15 @@ en: danger_text: "Danger text color" info_color: "Info color" info_text: "Info text color" + input_color: "Input color" + input_text: "Input text color" light_color: "Light color" light_text: "Light text color" muted_text: "Muted text color" primary_color: "Primary color" primary_text: "Primary text color" + raised_accent: "Raised accent color" + raised_background: "Raised background color" success_color: "Success color" success_text: "Success text color" warning_color: "Warning color" @@ -69,3 +73,6 @@ en: update: :voc.save profile: update: :voc.save + theme: + create: :voc.save + update: :voc.save From 56d42ebf35648f763209e405c98ee6fb4ac7dcaf Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:43:23 +0100 Subject: [PATCH 08/10] Fix theme settings HAML lint nits --- app/views/settings/_theme.haml | 46 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/settings/_theme.haml b/app/views/settings/_theme.haml index bea99510..c5cb27f6 100644 --- a/app/views/settings/_theme.haml +++ b/app/views/settings/_theme.haml @@ -15,9 +15,9 @@ .row .col-sm-6 - = f.text_field :background_color, class: 'color', data: { default: 0xF0EDF4 } + = f.text_field :background_color, class: "color", data: { default: 0xF0EDF4 } .col-sm-6 - = f.text_field :body_text, class: 'color', data: { default: 0x000000 } + = f.text_field :body_text, class: "color", data: { default: 0x000000 } .card .card-body %h2= t(".colors.heading") @@ -25,56 +25,56 @@ .row .col-sm-6 - = f.text_field :primary_color, class: 'color', data: { default: 0x5E35B1 } + = f.text_field :primary_color, class: "color", data: { default: 0x5E35B1 } .col-sm-6 - = f.text_field :primary_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :primary_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 .alert.alert-primary= t(".colors.alert.example", type: t(".colors.alert.type.primary")) .row .col-sm-6 - = f.text_field :danger_color, class: 'color', data: { default: 0xDC3545 } + = f.text_field :danger_color, class: "color", data: { default: 0xDC3545 } .col-sm-6 - = f.text_field :danger_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :danger_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 .alert.alert-danger= t(".colors.alert.example", type: t(".colors.alert.type.danger")) .row .col-sm-6 - = f.text_field :warning_color, class: 'color', data: { default: 0xFFC107 } + = f.text_field :warning_color, class: "color", data: { default: 0xFFC107 } .col-sm-6 - = f.text_field :warning_text, class: 'color', data: { default: 0x292929 } + = f.text_field :warning_text, class: "color", data: { default: 0x292929 } .col-sm-12 .alert.alert-warning= t(".colors.alert.example", type: t(".colors.alert.type.warning")) .row .col-sm-6 - = f.text_field :info_color, class: 'color', data: { default: 0x17A2B8 } + = f.text_field :info_color, class: "color", data: { default: 0x17A2B8 } .col-sm-6 - = f.text_field :info_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :info_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 .alert.alert-info= t(".colors.alert.example", type: t(".colors.alert.type.info")) .row .col-sm-6 - = f.text_field :success_color, class: 'color', data: { default: 0x28A745 } + = f.text_field :success_color, class: "color", data: { default: 0x28A745 } .col-sm-6 - = f.text_field :success_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :success_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 .alert.alert-success= t(".colors.alert.example", type: t(".colors.alert.type.success")) .row .col-sm-6 - = f.text_field :dark_color, class: 'color', data: { default: 0x343A40 } + = f.text_field :dark_color, class: "color", data: { default: 0x343A40 } .col-sm-6 - = f.text_field :dark_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :dark_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 - %a.btn.btn-dark.mb-3{ href: '#' }= t(".colors.button.example", type: t(".colors.button.type.dark")) + %a.btn.btn-dark.mb-3{ href: "#" }= t(".colors.button.example", type: t(".colors.button.type.dark")) .row .col-sm-6 - = f.text_field :light_color, class: 'color', data: { default: 0xF8F9FA } + = f.text_field :light_color, class: "color", data: { default: 0xF8F9FA } .col-sm-6 - = f.text_field :light_text, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :light_text, class: "color", data: { default: 0xFFFFFF } .col-sm-12 - %a.btn.btn-light.mb-3{ href: '#' }= t(".colors.button.example", type: t(".colors.button.type.light")) + %a.btn.btn-light.mb-3{ href: "#" }= t(".colors.button.example", type: t(".colors.button.type.light")) .row .col-sm-6 - = f.text_field :muted_text, class: 'color', data: { default: 0x6C757D } + = f.text_field :muted_text, class: "color", data: { default: 0x6C757D } .col-sm-6 %p.pt-4.text-muted= t(".colors.text.example") .card @@ -84,9 +84,9 @@ .row .col-sm-6 - = f.text_field :input_color, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :input_color, class: "color", data: { default: 0xFFFFFF } .col-sm-6 - = f.text_field :input_text, class: 'color', data: { default: 0x000000 } + = f.text_field :input_text, class: "color", data: { default: 0x000000 } .card .card-body %h2= t(".raised.heading") @@ -94,9 +94,9 @@ .row .col-sm-6 - = f.text_field :raised_background, class: 'color', data: { default: 0xFFFFFF } + = f.text_field :raised_background, class: "color", data: { default: 0xFFFFFF } .col-sm-6 - = f.text_field :raised_accent, class: 'color', data: { default: 0xF7F7F7 } + = f.text_field :raised_accent, class: "color", data: { default: 0xF7F7F7 } .card-footer %p= t(".raised.accent.example") .card From 555636577ef1e2862849451b88954694117f533b Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 00:58:08 +0100 Subject: [PATCH 09/10] Translate theme update success/error flashes --- app/controllers/user_controller.rb | 8 ++++---- config/locales/controllers.en.yml | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 88034636..ad756683 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -156,14 +156,14 @@ class UserController < ApplicationController current_user.theme.user_id = current_user.id if current_user.theme.save - flash[:success] = 'Theme saved.' + flash[:success] = t(".success") else - flash[:error] = 'Theme saving failed. ' + current_user.theme.errors.messages.flatten.join(' ') + flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(' ')) end elsif current_user.theme.update(update_attributes) - flash[:success] = 'Theme saved.' + flash[:success] = t(".success") else - flash[:error] = 'Theme saving failed. ' + current_user.theme.errors.messages.flatten.join(' ') + flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(' ')) end redirect_to edit_user_theme_path end diff --git a/config/locales/controllers.en.yml b/config/locales/controllers.en.yml index ea0a20a7..603d128e 100644 --- a/config/locales/controllers.en.yml +++ b/config/locales/controllers.en.yml @@ -31,3 +31,6 @@ en: update_profile: success: :user.update.success error: :user.update.error + update_theme: + success: "Theme saved successfully." + error: "Theme saving failed. %{errors}" From 61edaa5bcd93515bd20d7455c0725aa49cd3d9d1 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Sun, 13 Feb 2022 01:06:38 +0100 Subject: [PATCH 10/10] Fix hound nits --- app/controllers/user_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index ad756683..1ea2030b 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -158,12 +158,12 @@ class UserController < ApplicationController if current_user.theme.save flash[:success] = t(".success") else - flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(' ')) + flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(" ")) end elsif current_user.theme.update(update_attributes) flash[:success] = t(".success") else - flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(' ')) + flash[:error] = t(".error", errors: current_user.theme.errors.messages.flatten.join(" ")) end redirect_to edit_user_theme_path end