From c749b411639ab48f9dd08cb65404dc8de7ebe354 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 23 Nov 2021 11:12:54 +0000 Subject: [PATCH] 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. --- app/assets/javascripts/discourse/app/models/login-method.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/models/login-method.js b/app/assets/javascripts/discourse/app/models/login-method.js index 113482d8e0c..0c3b5168734 100644 --- a/app/assets/javascripts/discourse/app/models/login-method.js +++ b/app/assets/javascripts/discourse/app/models/login-method.js @@ -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