diff --git a/app/javascript/retrospring/features/user/action.ts b/app/javascript/retrospring/features/user/action.ts index a362ca0c..9ec7d654 100644 --- a/app/javascript/retrospring/features/user/action.ts +++ b/app/javascript/retrospring/features/user/action.ts @@ -51,7 +51,7 @@ export function userActionHandler(event: Event): void { switch (action) { case 'follow': button.dataset.action = 'unfollow'; - button.innerText = I18n.translate('views.actions.unfollow'); + button.innerText = I18n.translate('voc.unfollow'); button.classList.remove('btn-primary'); button.classList.add('btn-default'); break; @@ -82,7 +82,7 @@ export function userActionHandler(event: Event): void { function resetFollowButton(button: HTMLButtonElement) { button.dataset.action = 'follow'; - button.innerText = I18n.translate('views.actions.follow'); + button.innerText = I18n.translate('voc.follow'); button.classList.remove('btn-default'); button.classList.add('btn-primary'); } \ No newline at end of file diff --git a/app/views/user/_actions.haml b/app/views/user/_actions.haml index a7d9cc43..ab7869ba 100644 --- a/app/views/user/_actions.haml +++ b/app/views/user/_actions.haml @@ -5,10 +5,10 @@ - elsif user_signed_in? - if current_user.following? user %button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :unfollow, type: type, target: user.screen_name } } - = t 'views.actions.unfollow' + = t("voc.unfollow") - else %button.btn.btn-primary.btn-block{ type: :button, name: 'user-action', data: { action: :follow, type: type, target: user.screen_name } } - = t 'views.actions.follow' + = t("voc.follow") .btn-group.btn-block %button.btn.btn-light.btn-block.btn-sm.dropdown-toggle{ data: { toggle: :dropdown }, aria: { expanded: false } } = t(".title") diff --git a/config/locales/en.yml b/config/locales/en.yml index 5e3d90e1..86653f42 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -15,8 +15,6 @@ en: title: "List" members: "Members" actions: - follow: "Follow" - unfollow: "Unfollow" list: "Manage list memberships" sessions: destroy: "Logout" diff --git a/config/locales/voc.en.yml b/config/locales/voc.en.yml index 2c6b5800..94193a8e 100644 --- a/config/locales/voc.en.yml +++ b/config/locales/voc.en.yml @@ -7,6 +7,7 @@ en: confirm: "Are you sure?" delete: "Delete" edit: "Edit" + follow: "Follow" load: "Load more" login: "Sign in" save: "Save changes" @@ -14,6 +15,7 @@ en: report: "Report" terms: "Terms of Service" unblock: "Unblock" + unfollow: "Unfollow" update: "Update" view_in_rails_admin: "View in Rails Admin" y: Yes