mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 07:13:32 +00:00
[PM-13776] Generator Icon Button labels (#11623)
* update aria labels for generate and copy buttons within the generator components - Using the `appA11yTitle` across all icon buttons - Updated all labels to be targeted towards the credential type rather than just "password" * add copy/generate passphrase translations to desktop * add fixme comments for translations * remove reference to JIRA ticket
This commit is contained in:
@@ -63,6 +63,44 @@ export class CredentialGeneratorComponent implements OnInit, OnDestroy {
|
||||
nav: null,
|
||||
});
|
||||
|
||||
/**
|
||||
* Emits the copy button aria-label respective of the selected credential type
|
||||
*
|
||||
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
|
||||
*/
|
||||
protected credentialTypeCopyLabel$ = this.root$.pipe(
|
||||
map(({ nav }) => {
|
||||
if (nav === "password") {
|
||||
return this.i18nService.t("copyPassword");
|
||||
}
|
||||
|
||||
if (nav === "passphrase") {
|
||||
return this.i18nService.t("copyPassphrase");
|
||||
}
|
||||
|
||||
return this.i18nService.t("copyUsername");
|
||||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* Emits the generate button aria-label respective of the selected credential type
|
||||
*
|
||||
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
|
||||
*/
|
||||
protected credentialTypeGenerateLabel$ = this.root$.pipe(
|
||||
map(({ nav }) => {
|
||||
if (nav === "password") {
|
||||
return this.i18nService.t("generatePassword");
|
||||
}
|
||||
|
||||
if (nav === "passphrase") {
|
||||
return this.i18nService.t("generatePassphrase");
|
||||
}
|
||||
|
||||
return this.i18nService.t("generateUsername");
|
||||
}),
|
||||
);
|
||||
|
||||
protected onRootChanged(nav: RootNavValue) {
|
||||
// prevent subscription cycle
|
||||
if (this.root$.value.nav !== nav) {
|
||||
|
||||
Reference in New Issue
Block a user