latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Translate S2Member front-end only, by theme

Home Forums Community Forum Translate S2Member front-end only, by theme

This topic contains 4 replies, has 2 voices. Last updated by  Bruce 4 years ago.

Topic Author Topic
Posted: Saturday Dec 8th, 2012 at 8:15 am #33983
eBierek
Username: eBierek

Hi,

I need to translate the front-end of S2M, and also want to keep the mo-file in my current theme’s language folder. I use the code below for bbpress and wordpress to just translate front-end, not backend/wp-admin, and it works fine. But it seems to not be working for S2M. (Have viewed it while not logged in.) Any ideas why?

if (!is_admin('administrator'))
{
	// Tell S2M to translate to sv_SE if file exists
	if ( file_exists( get_template_directory() . '/languages/s2member-sv_SE.mo' ) ) {
	load_textdomain( 'default', get_template_directory() . '/languages/s2member-sv_SE.mo' );
	}
}

I have used po-edit to translate the original pot-file to Swedish. Thank you in advance for any ideas :)

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Saturday Dec 8th, 2012 at 2:34 pm #34006
Bruce
Username: Bruce
Staff Member

Hi Emily,

Looks like the problem is in this line:

load_textdomain( 'default', get_template_directory() . '/languages/s2member-sv_SE.mo' );

If you used the same “domain” (‘default’), it won’t work. Try changing that to ‘s2member’.

Posted: Tuesday Dec 11th, 2012 at 8:50 am #34246
eBierek
Username: eBierek

Hi Bruce & thank you, I will try that.

Posted: Tuesday Dec 11th, 2012 at 8:55 am #34252
eBierek
Username: eBierek

It worked perfectly, thanks again!

Posted: Tuesday Dec 11th, 2012 at 2:34 pm #34286
Bruce
Username: Bruce
Staff Member

Hi Emily,

Glad to hear it. Let us know if you have any further issues.

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.