Skip to content

Commit

Permalink
fix: make hardcoded strings translatable (#12)
Browse files Browse the repository at this point in the history
* fix: make hardcoded strings translatable

* style: fix StyleCI
  • Loading branch information
rafaucau authored Oct 19, 2023
1 parent 502d3f3 commit 6300e52
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/src/forum/components/TwoFactorGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export default class TwoFactorGrid extends Component {
'backupCodes',
<TwoFactorGridItem
icon="fas fa-key"
title="Backup Codes Remaining:"
title={app.translator.trans('ianm-twofactor.forum.security.backup_codes_remaining')}
value={this.backupCodesRemaining}
// action={
// this.backupCodesRemaining < 2 ? (
// <Button className="Button Button--primary" onclick={this.generateBackupCodes.bind(this)}>
// Generate More
// {app.translator.trans('ianm-twofactor.forum.security.generate_backup_codes_button')}
// </Button>
// ) : null
// }
Expand Down
4 changes: 4 additions & 0 deletions locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ianm-twofactor:
backup_codes: Your Backup Codes
backup_codes_instruction: Please save these codes in a secure place. They can be used to access your account if you lose your primary authentication method. They will not be displayed again.
saved_backup_codes_button: I've saved these codes
backup_codes_remaining: "Backup Codes Remaining:"
two_factor_enabled_confirmation: Two-Factor Authentication has been successfully enabled for your account.
ok_button: Ok
confirm_disable_2fa_title: Confirm Disabling Two-Factor Authentication
Expand All @@ -61,6 +62,9 @@ ianm-twofactor:
Two-Factor Authentication has been {type} for your account on {forum_url}.
If you initiated this action, no further steps are necessary. If you did not authorize this change, please contact the forum administrators immediately.
status_type:
enabled: enabled
disabled: disabled
views:
reset_password:
two_factor_token_label: 2FA Token
Expand Down
2 changes: 1 addition & 1 deletion src/Notification/TwoFactorStatusChangedBlueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getEmailView()
public function getEmailSubject(TranslatorInterface $translator): string
{
return $translator->trans('ianm-twofactor.email.subject.status_changed', [
'{type}' => $this->type(),
'{type}' => $translator->trans('ianm-twofactor.email.status_type.'.$this->type()),
]);
}
}
2 changes: 1 addition & 1 deletion views/email/status_changed.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{!! $translator->trans('ianm-twofactor.email.body.status_changed', [
'{recipient_display_name}' => $user->display_name,
'{forum_url}' => $url->to('forum')->base(),
'type' => $blueprint->type()
'{type}' => $translator->trans('ianm-twofactor.email.status_type.'.$blueprint->type())
]) !!}

0 comments on commit 6300e52

Please sign in to comment.