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.

Keep users default language after Login

Home Forums Community Forum Keep users default language after Login

This topic contains 8 replies, has 2 voices. Last updated by  Bruce 3 years, 10 months ago.

Topic Author Topic
Posted: Thursday Feb 14th, 2013 at 6:04 pm #41722

List Of Topic Replies

Viewing 8 replies - 1 through 8 (of 8 total)
Author Replies
Author Replies
Posted: Sunday Feb 17th, 2013 at 11:27 am #42029

Maybe I should add the login widget via php?
Would this offer more choice for the language?
Sorry, I think I have to push this a bit as I posted accidentally in the community forum at the beginning;)

Posted: Sunday Feb 17th, 2013 at 9:06 pm #42220
Bruce
Username: Bruce
Staff Member

Thank-you for your inquiry. ~ We’re very sorry for the delay.

To dynamically change this text, you will need to use the information provided in this Knowledge Base Article:

Knowledge Base » Changing Words/Phrases In s2Member®

You can find the Login Widget’s sourcecode here:

/s2member-pro/includes/classes/login-widget.inc.php

Posted: Monday Feb 18th, 2013 at 3:38 am #42242

Hello,
thank you very much for your answer,
the delay was absolutely my fault, I posted in the wrong forum.

I am not sure if I got you right. I am a bit confused by your answer.

To dynamically change this text, you will need to use the information provided in this Knowledge Base Article:

( Translating s2Member does not work via adding .po and .mo files?)

Could you maybe explain a bit more how this would help me to keep the chosen language?

p.e. if I log in via my english login widget I am redirected to my french Login Welcome Page.
How can I achieve to be directed to my english Login Welcome Page? (or chinese, japanese?) with your proposed method?
Kind regards

Posted: Tuesday Feb 19th, 2013 at 2:39 pm #42507

Hello,
Could you maybe look at my question once again?
I am not sure your answer matches my question.
I do not need advice for translation but for redirection to members default language?
Is there a possibility?
Someone posted this and it goes in the right direction I think,
but maybe you could help me?
http://www.s2member.com/forums/topic/redirect-problem/

Posted: Tuesday Feb 19th, 2013 at 5:45 pm #42519

Ok, another idea, could I simply remove the redirection to the Login Welcome Page and stay on the same page from where the login took place? Would this help to keep the language which was chosen by the user?
Thank you very much
I tried to put this piece of code in the mu plugin folder

<?php
add_filter ("ws_plugin__s2member_login_redirect",  '__return_false', 10, 2);
?>

and called it hook.inc.php.
I do not have any idea about php but this is what I tried after searching the forum.
It is not working but as I already said I am a php dummy;)
But as far as I read in the forum this could be possible?

Posted: Wednesday Feb 20th, 2013 at 8:31 pm #42622
Bruce
Username: Bruce
Staff Member

Thanks for the follow-up. ~ We appreciate your patience.

( Translating s2Member does not work via adding .po and .mo files?)

s2Member is compatible with translation through .po and .mo files with WordPress I18n translation. Find info on this here:

Pre Sale FAQs » Can s2Member® be translated into other languages?

The reason I recommend translation through PHP as shown in the Article I posted in my previous reply is that you do not have to have your WordPress installation in a specific language for the files to work.

I’m not absolutely certain how the translation works with WPMU, but because you’re hoping to have your site automatically translated based on a User’s preference, I would recommend adding a Custom Profile/Registration Field for a User’s language, and then using this field’s value to decide the language that you should translate your site into.

See: Dashboard -› s2Member® -› General Options -› Registration/Profile Fields

Once you have made this field, you can then grab the field’s value with the get_user_field() function. You might do something like this:

p.e. if I log in via my english login widget I am redirected to my french Login Welcome Page.
How can I achieve to be directed to my english Login Welcome Page? (or chinese, japanese?) with your proposed method?

For this, I would recommend (instead of having multiple pages), to use the same approach that I showed above, and check for the User’s language, and display the correct language based on what they have set up.

Remember that you will need a PHP Execution plugin to use PHP in a Post/Page.

See: Knowledge Base » ezPHP Plugin for WordPress®

Ok, another idea, could I simply remove the redirection to the Login Welcome Page and stay on the same page from where the login took place? Would this help to keep the language which was chosen by the user?

See: http://codex.wordpress.org/Plugin_API/Filter_Reference/login_redirect

That’s about as far as we can go with custom code. If you need further assistance, we recommend http://jobs.wordpress.net, or another freelance web site where WordPress® experts are offering their expertise through a bid on your project.
Posted: Thursday Feb 21st, 2013 at 5:53 pm #42765

Thank you for your answer.

Maybe I got you wrong but in short
• all proposed solutions will display translated content but still redirect to the default (french) Log in Page.
(navigation and as consequence the language switcher is still displayed in french.)
• There does not exist any …..(get_permalink()); “stay on current page” option for s2members after login.

Unfortunately this does not really fit.

Anyway thank you very much for the effort.

Posted: Saturday Feb 23rd, 2013 at 7:18 am #42995
Bruce
Username: Bruce
Staff Member

• all proposed solutions will display translated content but still redirect to the default (french) Log in Page.
(navigation and as consequence the language switcher is still displayed in french.)

In a sense, yes. BUT instead of it being your “French” Login Welcome Page, it will house ALL languages. So it will then just be your Login Welcome Page. Users will see content in a different language based on what you have set up here.

• There does not exist any …..(get_permalink()); “stay on current page” option for s2members after login.

If you’d like to do this with custom code, there is nothing stopping you here. You can redirect Users to a different page with PHP/JavaScript on your site if you’d like rather than this, but that’s not something supported directly by s2Member, and we cannot assist you with this as per our Support Policy.

Viewing 8 replies - 1 through 8 (of 8 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.