Welcome header text %{site_name} gives error: The following interpolation key is invalid: site_name

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,
    });
  }
3 Likes