Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions app/assets/javascripts/discourse/app/models/login-method.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ export default class LoginMethod extends EmberObject {

@discourseComputed
title() {
return this.title_override || i18n(`login.${this.name}.title`);
// Prefer explicit override, then i18n, then pretty name, finally a humanized provider name.
const fallback = this.prettyName || this.name?.toString().replace(/_/g, " ");
return (
this.title_override ||
i18n(`login.${this.name}.title`, { defaultValue: fallback })
);
}

@discourseComputed
Expand All @@ -43,7 +48,13 @@ export default class LoginMethod extends EmberObject {

@discourseComputed
prettyName() {
return this.pretty_name_override || i18n(`login.${this.name}.name`);
// Prefer explicit override, then i18n, and finally a humanized provider name.
return (
this.pretty_name_override ||
i18n(`login.${this.name}.name`, {
defaultValue: this.name?.toString().replace(/_/g, " "),
})
);
}

doLogin({ reconnect = false, signup = false, params = {} } = {}) {
Expand Down