- This topic has 2 replies, 2 voices, and was last updated 10 years, 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › Using eMember with the Polylang plugin for a multilanguage site
Tagged: eMember, multilanguage, Polylang
I’m trying to create a new multilingual site using the Polylang plugin, so I’ve searched a solution to my case.
I tried some workaround following the suggestions of this other topic https://support.tipsandtricks-hq.com/forums/topic/multilanguage-support
Because I’m using WP eMember v. 8.8.1 I added the code below in the eMember_init.php file.
//Specify which language file to load based on WPML language selection
$language_file = 'lang/'.ICL_LANGUAGE_CODE.'.php';
include_once($language_file);
I’ve also renamed from eng to en and from ita to it a copy of the language files.
On the frontend all seems work good, but in the backend I have this error so I search help on how to solve it.
Warning: include_once(lang/ICL_LANGUAGE_CODE.php): failed to open stream: No such file or directory in **/wp-content/plugins/wp-eMember/eMember_init.php on line 6
Warning: include_once(): Failed opening ‘lang/ICL_LANGUAGE_CODE.php’ for inclusion (include_path=’.:/opt/php54/lib/php’) in **/wp-content/plugins/wp-eMember/eMember_init.php on line 6
Another question, is possible to have the eMember email in two language?
Thanks in advance for any response.
Don’t include those files in the admin side so use the following snippet of code:
if(!is_admin()){
$language_file = 'lang/'.ICL_LANGUAGE_CODE.'.php';
include_once($language_file);
}
That should get rid of the error you get in the backend.
eMember can’t email in two languages at the same time.
Thanks for your response, all works good now.
On the email question I haven’t explained well. What I want to know, would be possible that the email sent by eMember (on registration, on password reset, etc.)can be automatically set to the same language type with which the user compiled the form?
To make an example, send an email in English to users who have registered on the English registration page and in Italian for those who register on the Italian registration page.
Thanks again for any response.