The following interpolation key is invalid: site_name
Alright thanks for the info, for now I am using CSS to put the site name. Was just having a problem underlining it in the welcome text.
That makes sense. They didn’t log in, so we don’t know who they are. There is no name for them in the database.
It’s like when someone you don’t know rings your doorbell; you won’t be able to greet them by name until they introduce themselves.
Yes, but I would like to use that %site_name for logged in users as well ![]()
Thanks for reporting it! Looks like I over-promised which variables were available…I’ve got an update coming that will correct this.
So we still can’t add %{site_name} if user is logged in?
The siteSetting service might work to get the value of the title site setting
I looked into this, the blocker here is not accessing the value of title. It’s that the backend validates translations by extracting valid interpolation keys from the default locale strings.
So when %{site_name} is not in the default string, it is rejected as an “invalid interpolation key”.
I don’t know what @NateDhaliwal’s idea is. I only wanted to point out an alternative to an additional request to /about.json.
I think a custom component that copies the welcome banner but provides the site_name key for all texts would be the way to go.
Or a PR that adds site_name as available key to the texts for logged in users in core
get headerText() {
if (!this.currentUser) {
return i18n("welcome_banner.header.anonymous_members", {
site_name: this.siteSettings.title,
});
}
const isNewUser = !this.currentUser.previous_visit_at;
const key = isNewUser
? "welcome_banner.header.new_members"
: "welcome_banner.header.logged_in_members";
return i18n(key, {
preferred_display_name: sanitize(
prioritizeNameFallback(this.currentUser.name, this.currentUser.username)
),
+ site_name: this.siteSettings.title,
});
}
@hipp0 thanks again for raising this! We pushed an update that makes the site_name variable available on all three header fields:




