Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eMember -register/login form in 2nd language without wpml or qtranslate

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › eMember -register/login form in 2nd language without wpml or qtranslate

Tagged: members, Translation, wpml

  • This topic has 5 replies, 2 voices, and was last updated 8 years, 1 month ago by admin.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • February 11, 2015 at 10:06 am #12194
    jurgenvt
    Member

    Hi, I have read this: https://support.tipsandtricks-hq.com/forums/topic/multilanguage-support

    and this must be a solution for my eMember project.

    However, i have no wpml or qtranslate installed in my website. I also want to avoid installing it, since qtranslate is no longer supported and i find WPML to heavy for just one form in another language.

    is something like this possible wihout any of those plugins installed?

    what i had in mind:

    my base language is hebrew. i have about 3 pages in dutch, but now also the question arised to have the register/login forms in dutch. WHat would work for me is a specific page (to identify with an id, and then load a differend language set for the registration /login form.

    if it would help to create a separate template file for this (login/registration) page, this i can do.

    i just need instructions on how to load another language for the login / registration form.

    your help is -as always- greatly appriciated!

    Thank you

    February 11, 2015 at 10:32 pm #68537
    admin
    Keymaster

    I can tell you how you can load a different language file for emember from your custom code. However, I don’t know if it will fully solve your issue or not.

    Below is an example code that loads the dutch language if the page/post ID is 100. Else it will load the English language file.

    add_filter('emember_get_language_path', 'emember_custom_lang_handler', 10, 2);
    function emember_custom_lang_handler($eMember_language_file, $lang)
    {
    //Add your condition here and specify the language file that you want to load
    global $post;
    if ($post->ID == "100"){
    $eMember_language_file = WP_EMEMBER_PATH . "lang/nld.php";
    }
    else{
    $eMember_language_file = WP_EMEMBER_PATH . "lang/eng.php";
    }
    //Return the path and eMember will load this file.
    return $eMember_language_file;
    }

    February 12, 2015 at 11:27 am #68538
    jurgenvt
    Member

    Thank you so much.

    i must be doing something wrong, because i am getting a white screen.

    in wp_eMember1.php i added (after last “add_action”, line 165:

    //SOSMOD

    add_filter(’emember_get_language_path’, ’emember_custom_lang_handler’), 10, 2);

    function emember_custom_lang_handler($eMember_language_file, $lang)

    {

    //Add your condition here and specify the language file that you want to load

    global $post;

    if ($post->ID == “1071”){

    $eMember_language_file = WP_EMEMBER_PATH . “lang/nld.php”;

    }

    else{

    $eMember_language_file = WP_EMEMBER_PATH . “lang/heb.php”;

    }

    //Return the path and eMember will load this file.

    return $eMember_language_file;

    }

    //SOSMOD

    wrong file? wrong place?

    please advise.

    Thank you!

    February 12, 2015 at 10:34 pm #68539
    admin
    Keymaster

    You shouldn’t add this code to eMember. Add it to a custom plugin or your theme’s functions.php file. That way you won’t lose this customization when you upgrade the plugin also.

    February 13, 2015 at 9:03 am #68540
    jurgenvt
    Member

    i got the white screen tackel:

    there was a “)” to much in:

    add_filter(’emember_get_language_path’, ’emember_custom_lang_handler’), 10, 2);

    now i did in functions.php:

    add_filter(’emember_get_language_path’, ’emember_custom_lang_handler’, 10, 2);

    function emember_custom_lang_handler($eMember_language_file, $lang)

    {

    //Add your condition here and specify the language file that you want to load

    global $post;

    if ($post->ID == “1071”){

    $eMember_language_file = WP_EMEMBER_PATH . “lang/nld.php”;

    }

    else{

    $eMember_language_file = WP_EMEMBER_PATH . “lang/heb.php”;

    }

    //Return the path and eMember will load this file.

    return $eMember_language_file;

    }

    //SOSMOD

    no errors, but no “nld” language on pageid 1071 where i used the shortcode [wp_eMember_registration]

    February 13, 2015 at 11:41 pm #68541
    admin
    Keymaster

    You should probably do an “echo” statement inside the following condition block just to make sure that path of the code is being executed:

    if ($post->ID == "1071")

    Also, check the contents of the “nld.php” file to make sure the texts are translated. We can’t speak or understand dutch. One of our users gave us that file.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • WP PDF Stamper Documentation
  • WP Photo Seller Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial
  • WP Photo Seller Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2023 | Tips and Tricks HQ