Bulk replacement in translated strings?

I know that Discourse lets use now change text almost everyone on the site through the admin panel, but is there a way to do something like find and replace all?

I know categories and topics are fundamental to how Discourse was built, but what if I wanted to match the experience of the forum I’m migrated to and instead wanted to use ‘Forums’ to replace ‘Categories’ and ‘Threads’ to replace to ‘Topics’. ?

Yes, see this:

There is no easy way to do a bulk translation. It would also be a little confusing because the URLs would not reflect the changes.

2 Likes

I think that you could do it with a plugin that replaced the locale. I do think it would be confusing for people.

I’m interested in doing something like this as well. If there’s a way to implement this while on a Standard or Business plan that would be great!

Me too, I’m selfhosting though

It’s somewhat easier if you’re self hosting. I’d probaby do it at the rails console, though a plugin would be another way to do it.

What do you want to replace?

1 Like

I want to replace the text “Topic” to “Thread”. Is there a command to do it?

I don’t see an easy way to do it. I think the easiest would be a plugin that overrides all of the instances you want to change, so you could do it in a text editor. It would probably take me a couple of hours. A few years ago, it might have been 5? You’d start with GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins copy config/locales/client.en.yml into config/locales in the skeleton, delete the strings you don’t want to change and edit those that you want to change. Though there must be a way to get rails to give you all of the strings (oh, here’s this ruby - How to list all available locale keys in Rails? - Stack Overflow, and then you could loop through them all, get the string and insert a TranslationOverride for those you want to change, but the plugin route is probably better, as you’ll want to tweak stuff by hand and see what it is that you’re changing)

Trying to change “topic” to “thread” is a bad idea, though. No good can come from it. And Discourse doesn’t have threaded discussion, which is why they are called topics. And there won’t often be new strings added that contain “topic” but they could sneak in over time.

Alright, I will try it later today. I guess it might be too much work for a simple thing. I know some JS and Python but never touched ruby.

Thanks for your help!

1 Like

Indeed. I’d recommend that you spend your time on pretty much anything else that you think will make your forum succeed.

2 Likes