Skip to content

Commit

Permalink
🌐 Add translations for OptionAuth
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Sep 9, 2024
1 parent b24eb93 commit d4922da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions locales/en/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"domainsTab": "Domains",
"helpTab": "Help",
"listsTab": "Lists",
"passwordRemoveButton": "REMOVE",
"passwordUpdateButton": "SET",
"passwordUpdateFailed": "Failed to update password.",
"settingsTab": "Settings",
"statsTab": "Stats",
"testTab": "Test",
Expand Down
8 changes: 4 additions & 4 deletions src/script/optionAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class OptionAuth {
this.setPasswordButton();
if (this.optionPage.cfg.contextMenu) this.optionPage.sendUpdateContextMenuMessage();
} catch (err) {
this.Class.OptionPage.handleError('Failed to update password.', err);
this.Class.OptionPage.handleError(this.optionPage.translation.t('options:passwordUpdateFailed'), err);
}
}

Expand All @@ -49,12 +49,12 @@ export default class OptionAuth {
if (this.optionPage.cfg.password) { // Password already set
this.Class.OptionPage.enableBtn(passwordBtn);
if (passwordText.value) { // Password field filled
passwordBtn.innerText = 'SET';
passwordBtn.innerText = this.optionPage.translation.t('options:passwordUpdateButton');
} else { // Empty password field
passwordBtn.innerText = 'REMOVE';
passwordBtn.innerText = this.optionPage.translation.t('options:passwordRemoveButton');
}
} else { // Password not already set
passwordBtn.innerText = 'SET';
passwordBtn.innerText = this.optionPage.translation.t('options:passwordUpdateButton');
if (passwordText.value) { // Password field filled
this.Class.OptionPage.enableBtn(passwordBtn);
} else { // Empty password field
Expand Down

0 comments on commit d4922da

Please sign in to comment.