How "Reply" to post button text can be changed to "Comment"?

plugins

(Stan Tyan) #1

Hello,

How can I change “Reply” button text to “Comment” on the topic page? My website is more about Questions and Answers, and people usually comment on other answers, not replying.

Example:

I’m using great plugin GitHub - Mittineague/custom-text: A simple Discourse plugin by @Mittineague to customize different texts. However the main problem when I edit:

en:
  js:
    topic:
      reply:
        title: 'Comment'

I get Main “Reply” to topic button changed to “Comment” too as you can see from previous mockup/screenshot.

Please help. How can I customize both of these button text independently?

Thank you so much in advance.


(omfg) #2

I was gonna say you shouldn’t rename the button because Reply actually means reply, but you did your homework :-). The last Reply at the bottom could benefit from renaming.


(Stan Tyan) #3

Yes, basically I want to convert Community/discussion nature of Discourse to strictly Questions&Answers one. In this regard, I already renamed:
topic(s) > question(s)
post(s) > answer(s)
New Topic > "Ask a Question"
Reply button at the bottom of each Topic > “Write your Answer”

the only problem now is Reply button under each post. Main Reply button and post reply button are using the same text string as I understood.

I’m just interested is it possible to change both of these button texts independently? using only client.en.yml override plugin and not changing anything in the core of Discourse


(omfg) #4

Yes, I understand, you explained it well, let’s see if an actual dev can help.
I think it’d be a good feature.


(Stan Tyan) #5

While waiting for official answer from developers I came up with a temporary css solution. I’ve added this code to Customization CSS and now I have word Reply replaced by Comment under each post.

/* Replace Reply with Comment */
.create.fade-out {
    color: transparent !important;
    font-size: 0px !important;
}
.create.fade-out::after {
    font-size: 14px !important;
    color: #4e4e4e !important;
    content:"Comment";
}
nav.post-controls .create i {
    font-size: 15px !important;
    color: #4e4e4e !important;
    margin-left: 10px;
}


(Vaishak Kallore) #6

Its quite old now, however there is a mixed up solution here, which might be helpful for users like me :slight_smile:

Go to Admin -> Customize

Step 1: Follow steps provided by @stantyan above (under Themes, with CSS attribute 'content: “WHAT EVER YOU WANT”)
Step 2: Open Text Content and search Reply or js.topic.reply.title update to text you would like to have for bottom, i.e. “NEW TEXT”.

See how it will appear:

If any better solutions there, always welcome :wink:


(Anil Gupta) #7

I think I found this in-built Discourse feature to change ‘text content’.

It helps you change any string within Discourse and is much cleaner way to do it.

I did use this feature on my Discourse installation and it indeed is a powerful way of changing almost everything that you read.

I replaced all instances of word ‘Topic’ with ‘Question’ and all ‘reply’ with ‘Answer’ here:

The only caveat is that you have to search and replace the text instances one by one. It is not ‘Replace all’ feature.
But, I am happy that it works pretty well after the initial one time set up.


(Benjamin Borowski) #8

The other caveat was discussed above. You cannot change the “reply to post” Reply and the “reply to original post” button texts independently without hacking a bit of css or javascript.

The last two clients I’ve helped onto Discourse both wanted to change this as it’s confusing as to how threading works.


(Evgeny) #9

Try the following code. I’m not sure, but it seems like it should work.

.topic-post.post-hidden .names span.full-name, nav.post-controls button.reply.create span.d-button-label {
    display: none;
}
nav.post-controls button.reply.create:after {
    content: " comm";
}