UX: Fallback to regular title if screen-reader title is unavailable (#15048)

c401d641 introduced a new translation key for auth providers, and provided new strings for core providers. However, not all plugins have added this string. This commit makes the screenreader title fallback to the regular title in those cases.
This commit is contained in:
David Taylor 2021-11-23 11:12:54 +00:00 committed by GitHub
parent 948a1523ea
commit c749b41163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -15,7 +15,10 @@ const LoginMethod = EmberObject.extend({
@discourseComputed
screenReaderTitle() {
return this.title_override || I18n.t(`login.${this.name}.sr_title`);
return (
this.title_override ||
I18n.t(`login.${this.name}.sr_title`, { defaultValue: this.title })
);
},
@discourseComputed