Skip to content

Commit

Permalink
Merge pull request #25 from creative-commoners/pulls/4.0/helptext
Browse files Browse the repository at this point in the history
adjust help link default translation text
  • Loading branch information
robbieaverill authored Jul 2, 2019
2 parents 4da382d + 4762ae6 commit 78dc08f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions client/src/components/TOTP/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,16 @@ class Register extends Component {
* @returns {HTMLElement}
*/
renderSupportLink() {
const { method } = this.props;
const { method: { supportLink, supportText } } = this.props;
const { ss: { i18n } } = window;

if (!method.supportLink) {
if (!supportLink) {
return null;
}

return (
<a href={method.supportLink} target="_blank" rel="noopener noreferrer">
{ i18n._t('TOTPRegister.HOW_TO_USE', 'How to use authenticator app.') }
<a href={supportLink} target="_blank" rel="noopener noreferrer">
{supportText || i18n._t('TOTPRegister.HOW_TO_USE', 'How to use authenticator apps.')}
</a>
);
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/TOTP/Verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ class Verify extends Component {
* @returns {HTMLElement}
*/
renderSupportLink() {
const { method } = this.props;
const { method: { supportLink, supportText } } = this.props;
const { ss: { i18n } } = window;

if (!method.supportLink) {
if (!supportLink) {
return null;
}

return (
<a href={method.supportLink} target="_blank" rel="noopener noreferrer">
{ i18n._t('TOTPVerify.HOW_TO_USE', 'How to use authenticator app.') }
<a href={supportLink} target="_blank" rel="noopener noreferrer">
{supportText || i18n._t('TOTPVerify.HOW_TO_USE', 'How to use authenticator apps.')}
</a>
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/RegisterHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public function getSupportLink(): string
return (string) $this->config()->get('user_help_link');
}

public function getSupportText(): string
{
return _t(__CLASS__ . '.SUPPORT_LINK_DESCRIPTION', 'How to use authenticator apps.');
}

public function getComponent(): string
{
return 'TOTPRegister';
Expand Down

0 comments on commit 78dc08f

Please sign in to comment.