Customize Text or change language
-
How can I change the text of the forum, for example, change “Create New Topic” to something of my choosing? Alternately, is there a way to change everything to simplified Chinese? Thank you.
-
Thank you, Robin W.
Robin W., after reading that, I think I should explain my problem better. I do not want to change my entire WordPress site’s language. I really just want the ability to customize the text on bbpress, such as “Create New Topic”. I want the text to be both in Chinese and in English. Is there a way to manually do that? Thank you.
Put the following in your functions file
//This function changes the text wherever it is quoted function change_translate_text( $translated_text ) { if ( $translated_text == 'old text' ) { $translated_text = 'new text'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text', 20 );
you can put in multiple lines eg
if ( $translated_text == 'old text1' ) { $translated_text = 'new text1'; } if ( $translated_text == 'old text2' ) { $translated_text = 'new text2'; }
Thank you. How do I specify which text I want to change?
so if you wanted to change ‘Create New Topic’ to ‘hello mother’ you would do
//This function changes the text wherever it is quoted function change_translate_text( $translated_text ) { if ( $translated_text == 'Create New Topic' ) { $translated_text = 'hello mother'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text', 20 );
Ok thanks!
This is exactly what we need. But when I use this function…
//This function changes the text wherever it is quoted function change_translate_text( $translated_text ) { if ( $translated_text == 'Subscriber' ) { $translated_text = 'Member'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text', 20 );
…it doesn’t change “Subscriber” to “Member” in profile area or anywhere else.
Any suggestions on what I can do to get this working?
Thanks for any help.
Subscriber is normally a wordpress role and probably isn’t viewed as ‘text’, it will be taken from a function.
are yours showing on the forum pages?
Ok, I see now.
Yes, it’s a role we are trying to change. We are doing some whacky things with roles. On frontend of bbPress, sometimes we display bbPress roles and sometimes standard WordPress roles.
I was looking for a method to change how roles are displayed on frontend, without changing the actual name of the role in the database.
For example, instead of “Participant,” is shows as “New Member”
Or, instead of “Subscriber,” is shows as “Student”
Maybe there are different methods to accomplish this for standard WordPress roles and bbPress roles?
Thanks for any suggestions.
ok, for bbpress roles, then my style pack plugin will let you change role names (and a whole lot more)
go to settings>bbp style pack>forum roles
if you need something bespoke, email me
Robin – That’s a powerful plugin. I’ve had it installed for some time. Should be part of bbPress core!
In plugin, I see where you can change names of roles. This is helpful, but many of our roles are WP roles and custom roles (which I don’t see listed in plugin).
Any other suggestion on how to change the name of a WP or custom role (just what displays on front-end)?
For example, if I have a custom role “unsubscribed,” how can I change this to “Inactive”
Thanks for any help.
without knowing how you are currently displaying them (what functions) then hard to say. I can probably do something if I know how it is done currently
I found this plugin which seems to do the job:
great !!
- You must be logged in to reply to this topic.