WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
Is there any way to translate WordPress native registration form? (12 posts)

  1. Marcelo Pedra
    Member
    Posted 1 year ago #

    Hi! I am publishing a website in spanish and english, being spanish the main language (in the website and in the WP install), and provide a link to the WordPress registration form. Is there any way to show english strings to people coming to register from the english version of the website?
    Thank you

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  2. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    Not that I was able to find yet, there is a real problem with that as the calls required for the translation don't work on that page

  3. Marcelo Pedra
    Member
    Posted 1 year ago #

    OK, thanks for the answer.

    Idea: isn't there any filter or hook that one can insert prior to registration form display? What if I had the .po/mo files for the WP english version in the wp-content/languages dir altogether with the ES_es files, and via this filter I could redefine the WPLANG constant before WP init? You think it's viable?

  4. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    I am sure there might be a viable solution, changing the locale is something that is already done in Transposh, but in this page things are not really "normal"

    The solution (actually a bypass) is to use a 3rd party login/registration page which can be translated. I remember seeing something like that in the past, but I really don't recall what the exact plugin was

  5. Marcelo Pedra
    Member
    Posted 1 year ago #

    ok, that's good to know. I'll search for a custom registration plugin with it's own processing form. I'm currently customizing the registration process via Register Plus Redux, which is just great, but since this plugin does uses the native WP registration form, it cannot be translated :(

  6. Ofer Wald
    Member
    Plugin Author

    Posted 1 year ago #

    Would appreciate it if you'll post your findings once you are done :)

  7. Marcelo Pedra
    Member
    Posted 1 year ago #

    ok, I'll let you know.

  8. selnomeria
    Member
    Posted 11 months ago #

    I have found one way to translate the registration form - add this code into your themes functions.php:

    function my_translate()
    {
       $your_content=ob_get_contents();
       $your_content= str_replace('Username',        'blabla2222',$your_content);
       $your_content= str_replace('Email Address',   'blabla4444', $your_content);
    
       ob_get_clean();
       echo $your_content;
    }
    add_action( 'register_form', 'my_translate' );

    of course, add or change the words with your desired ones..

  9. selnomeria
    Member
    Posted 11 months ago #

    Sorry, here is the better function:

    function my_translate()
    {
       $your_content=ob_get_contents();
       $your_content= str_replace('Username:',        'blabla2222',$your_content);
       $your_content= str_replace('Email Address:',   'blabla4444', $your_content);
    
       ob_get_clean();
       echo $your_content;
    }
    add_action( 'register_form', 'my_translate' );

    But keep in mind, use the correct uppercase for the translation words, otherwise the above function may translate the inner html codes (for example, it not only translates Username to blabla222, but may translate the inner html code- for example: <input name="username"> to <input name="blabla222">.

    so, to avoid that, you should use only the correct words for tranlation (correctly typed word in current Upper/lowercase). also, it is good to catch the words correctly with : symbol

  10. Ofer Wald
    Member
    Plugin Author

    Posted 11 months ago #

    Hello @selnomeria

    Your solution does not answer the how to get the language for this from the url, and also - what you have done is probably much easier by using the .po/.mo files and setting the appropriate locale

    :)

  11. ivan_vl
    Member
    Posted 7 months ago #

    so, i guess, there is stil no solution to get the registration translated ? :-(

  12. Ofer Wald
    Member
    Plugin Author

    Posted 4 months ago #

    Nothing yet :(

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic