# Can't customize text on custom button in template override using UI

**URL:** https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663
**Category:** Support
**Created:** [April 7, 2022, 8:10pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663 "2022-04-07T20:10:53Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 7, 2022, 8:10pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/1 "2022-04-07T20:10:53Z")

</div>

I’m overriding one of the handlebars templates, `static.hbs`, so that I can create a custom login page.

I’ve been able to add a custom button instead of the Sign Up button, which will allow people to visit a pricing page to buy a membership through Memberful.

The challenge I have is that I’m not able to customize the text for the pricing button and I’m not sure why.

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/d/b/edba3be0145773e72e7adb8fc66e55ec519a515a.png)

I’ve added the button as such:

```plaintext
{{d-button href="https://example.com/pricing" class="btn-primary pricing-button" label="pricing_button"}}

```

Yet when I go to Admin \> Customize \> Text and search for “pricing\_button” it doesn’t show up.

I’ve run the [Find a translation key with verbose localization](https://meta.discourse.org/t/find-a-translation-key-with-verbose-localization/134651) and it shows in the console as `Translation #36: pricing_button`, but again, when I search the Admin \> Customize \> Text page, I don’t find it.

Any ideas what might be happening?

UPDATE: Seems that I’ll have to create this as a theme component with a repo, not just using the UI/UX, and that I have to add the pricing-button to the locale.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 8, 2022, 7:17am UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/2 "2022-04-08T07:17:06Z")

</div>

You need to add `pricing-button` to the locale. See [Add localizable strings to themes and theme components](https://meta.discourse.org/t/adding-localizable-strings-to-themes-and-theme-components/109867)

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 8, 2022, 6:03pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/3 "2022-04-08T18:03:30Z")

</div>

Ah, I forgot to add that I did the template override in a new theme component that I created in the Admin menu, not in a separate git repo.

I tried doing it as such, by adding the `theme-prefix` in the label:

> [@Add localizable strings to themes and theme components](https://meta.discourse.org/t/add-localizable-strings-to-themes-and-theme-components/109867/1):
>
> Or, if you need to pass the translation key into another component, you can use the `theme-prefix` helper:
> 
> ```plaintext
> {{d-button label=(theme-prefix 'my_translation_key')}}
> 
> ```

…but it didn’t seem to work.

Is it possible to add locales/custom text in a theme/component created in the admin page without having to create a git repo?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 8, 2022, 6:17pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/4 "2022-04-08T18:17:37Z")

</div>

I don’t think you can do it with the UX; that’s really designed only for trivial changes.

I think that you’d need to use the [Discourse Theme CLI (console app to help you build themes)](https://meta.discourse.org/t/discourse-theme-cli-console-app-to-help-you-build-themes/82950).

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 8, 2022, 6:35pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/5 "2022-04-08T18:35:36Z")

</div>

Haha, darn. For something so simple, I wish it could be just done in the UX.

Ok, looks as if I’ll have to create a proper theme component, thank you for your help!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 8, 2022, 7:11pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/6 "2022-04-08T19:11:06Z")

</div>

Adding a locale isn’t so simple, but if you want it to be simple, you can try using

```
                translatedLabel="Actual Text!"

```

Instead of the label that uses a locale.

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 8, 2022, 8:20pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/7 "2022-04-08T20:20:54Z")

</div>

Fair point, I agree locales are much more complex. When I said simple, I meant it in the context of using a template override and adding a `{{d-button}}`.

However, you have solved my problem with the:

> [@pfaffman](#):
>
> `translatedLabel="Actual Text!"`

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/8/d/48d88976e72fccde90d570641192527dc57ed365.png)

```plaintext
{{d-button href="https://example.com/pricing" class="btn-primary pricing-button" translatedLabel='Pricing'}}

```

Thank you so much!!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 8, 2022, 8:22pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/8 "2022-04-08T20:22:18Z")

</div>

You’re so welcome! I had a similar issue with, for reasons, not wanting to put the label in locale in just the last week. 🥂

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [April 8, 2022, 8:23pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/9 "2022-04-08T20:23:51Z")

</div>

🥂 to you, to Discourse, and to the weekend 😃

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [May 8, 2022, 8:24pm UTC](https://meta.discourse.org/t/cant-customize-text-on-custom-button-in-template-override-using-ui/223663/10 "2022-05-08T20:24:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
