• Hi,

    After spending a lot of time, I found the labels of the fields are all together in the database Table “options” under Option_Name: yith_wcaf_affiliate_profile_fields
    With the Option value you can see down. How It supposed to be translated? Loco neither Polylang can find it.

    Translate via functions.php don’t seems the most beauty way to do it.

    Thanks in advance.

    a:7:{i:0;a:7:{s:4:”name”;s:8:”username”;s:5:”label”;s:17:”Nombre de usuario”;s:13:”admin_tooltip”;s:209:”Este campo está protegido ya que es necesario para que el formulario de registro funcione correctamente. Puedes activarlo/desactivarlo desde el escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad.”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:1;a:6:{s:4:”name”;s:10:”first_name”;s:5:”label”;s:6:”Nombre”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}i:2;a:6:{s:4:”name”;s:9:”last_name”;s:5:”label”;s:8:”Apellido”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}i:3;a:8:{s:4:”name”;s:5:”email”;s:5:”label”;s:33:”Dirección de correo electrónico”;s:13:”admin_tooltip”;s:107:”Este campo está protegido ya que es obligatorio para que el formulario de registro funcione correctamente.”;s:4:”type”;s:5:”email”;s:10:”validation”;s:5:”email”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:4;a:7:{s:4:”name”;s:8:”password”;s:5:”label”;s:11:”Contraseña”;s:13:”admin_tooltip”;s:209:”Este campo está protegido ya que es necesario para que el formulario de registro funcione correctamente. Puedes activarlo/desactivarlo desde el escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad.”;s:4:”type”;s:8:”password”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:5;a:8:{s:4:”name”;s:12:”privacy_text”;s:5:”label”;s:187:”Tus datos personales se utilizarán para procesar tu pedido, mejorar tu experiencia en esta web, gestionar el acceso a tu cuenta y otros propósitos descritos en nuestra [privacy_policy].”;s:13:”admin_tooltip”;s:244:”Puedes cambiar el contenido de este párrafo desde el Escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad. El párrafo será visible cuando elijas una página de política de privacidad en el escritorio de WP > Ajustes > Privacidad.”;s:5:”class”;s:31:”woocommerce-privacy-policy-text”;s:4:”type”;s:9:”paragraph”;s:7:”enabled”;b:1;s:8:”reserved”;b:1;s:8:”editable”;b:0;}i:6;a:8:{s:4:”name”;s:5:”terms”;s:5:”label”;s:54:”He leído y estoy de acuerdo con los [terms] de la web”;s:11:”admin_label”;s:41:”¿Han sido aceptados lo términos de uso?”;s:4:”type”;s:8:”checkbox”;s:11:”label_class”;s:11:”terms-label”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}}

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi there!
    Thank you for contacting us

    Those fields are not fixed strings, so you need to directly write them (when creating each field) in the language you are aiming at.

    As you said, the translation plugins are not able to pick them up, because the content of those fields is variable and will depend on what you introduce when creating them.

    Please, let us know any news.
    Have a nice day!

    Thread Starter jandres

    (@jandres)

    Thank you for the answer,

    I becoming crazy… I have 4 languages in my site, I need to translate it, but the usual ways dont work, I will start fro the beginning:

    add_filter(  'gettext',  'register_text'  );
    add_filter(  'ngettext',  'register_text'  );
    function register_text( $translated ) {
         $translated = str_ireplace(  'Nombre',  'Name',  $translated );
         return $translated;
    }

    That should work. But don’t. Can you help me?

    Thanks

    Hi there!

    I checked the code and it seems to be fine a priori, and the method you used should be finding for sure the text.
    There’s not much we can try.
    Have you tried to check if $translated is = “Nombre” or “Name” at any point when loading the affiliate form page?
    Have you tried to change “str_ireplace” for “str_replace” ?

    Have you tried to use a priority in the code?

    add_filter( 'gettext', 'register_text', 999 );
    add_filter( 'ngettext', 'register_text', 999 );

    Please, let us know.
    Have a nice day!

    Thread Starter jandres

    (@jandres)

    Thanks,

    Yes, I tried with 999 and nothing. Somehow, str_replace and str_ireplace can’t access to shortcode/registerform.

    Any idea? There is another approach for Yith register form?

    The website: Affiliate Desktop | GeoCats

    Thanks

    Thread Starter jandres

    (@jandres)

    This should work too, but nothing. Im always cleaning my caché too.

    function mp_filter( $result ) {
    $search = ‘Nombre’;
    $replacewith = ‘Name’;
    return str_replace( $search, $replacewith, $result );
    }
    add_filter( ‘yith_wcaf_affiliate_dashboard’, ‘mp_filter’, 999, 2 );

    Hi there,

    Honestly, those filters (gettext, ngettext) should be executed for sure as they are added directly from WordPress.
    Could you share specifically which fields are you trying to translate?
    Maybe I can create a custom code myself to achieve what you want, but as I understand, if you already have them in a certain language configured, they should be displayed that way.

    Please, let me know.
    Have a nice day!

    Thread Starter jandres

    (@jandres)

    Hi, Thanks for the answer.

    I need to translate according the 4 languages we have. And we expect more in the future.

    This:

    a:7:{i:0;a:7:{s:4:”name”;s:8:”username”;s:5:”label”;s:17:”Nombre de usuario”;s:13:”admin_tooltip”;s:209:”Este campo está protegido ya que es necesario para que el formulario de registro funcione correctamente. Puedes activarlo/desactivarlo desde el escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad.”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:1;a:6:{s:4:”name”;s:10:”first_name”;s:5:”label”;s:6:”Nombre”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}i:2;a:6:{s:4:”name”;s:9:”last_name”;s:5:”label”;s:8:”Apellido”;s:4:”type”;s:4:”text”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}i:3;a:8:{s:4:”name”;s:5:”email”;s:5:”label”;s:33:”Dirección de correo electrónico”;s:13:”admin_tooltip”;s:107:”Este campo está protegido ya que es obligatorio para que el formulario de registro funcione correctamente.”;s:4:”type”;s:5:”email”;s:10:”validation”;s:5:”email”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:4;a:7:{s:4:”name”;s:8:”password”;s:5:”label”;s:11:”Contraseña”;s:13:”admin_tooltip”;s:209:”Este campo está protegido ya que es necesario para que el formulario de registro funcione correctamente. Puedes activarlo/desactivarlo desde el escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad.”;s:4:”type”;s:8:”password”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:8:”reserved”;b:1;}i:5;a:8:{s:4:”name”;s:12:”privacy_text”;s:5:”label”;s:187:”Tus datos personales se utilizarán para procesar tu pedido, mejorar tu experiencia en esta web, gestionar el acceso a tu cuenta y otros propósitos descritos en nuestra [privacy_policy].”;s:13:”admin_tooltip”;s:244:”Puedes cambiar el contenido de este párrafo desde el Escritorio de WP > WooCommerce > Ajustes > Cuentas y privacidad. El párrafo será visible cuando elijas una página de política de privacidad en el escritorio de WP > Ajustes > Privacidad.”;s:5:”class”;s:31:”woocommerce-privacy-policy-text”;s:4:”type”;s:9:”paragraph”;s:7:”enabled”;b:1;s:8:”reserved”;b:1;s:8:”editable”;b:0;}i:6;a:8:{s:4:”name”;s:5:”terms”;s:5:”label”;s:54:”He leído y estoy de acuerdo con los [terms] de la web”;s:11:”admin_label”;s:41:”¿Han sido aceptados lo términos de uso?”;s:4:”type”;s:8:”checkbox”;s:11:”label_class”;s:11:”terms-label”;s:7:”enabled”;b:1;s:8:”required”;b:1;s:7:”show_in”;a:2:{s:8:”settings”;b:0;s:19:”become_an_affiliate”;b:0;}}}

    Hi there,

    I understand that you need to translate the entire form, but this would require a condition that checks for the current language of the page, as I understand, you have a Multilanguage site, right?

    There’s not much we can do about it, because we have no control over the language used, but the best way to do it would be to be in touch with the support of your language plugin, to find a way to create those conditions I mentioned above.
    Also, take into account that translating the entire option does not make sense, you should retrieve each field individually.

    Let us know.
    Have a nice day!

    Thread Starter jandres

    (@jandres)

    Hello,

    Thanks for the answer, but is not helpful. I know how to translate in diferent languages in functions.php. I did it for other stuff of woocommerce and is working, for each lang. But it not work with your Form. So, if this not work, what can i do? ITs the simpliest code to test ireplace can access it. But Not.

    add_filter(  'gettext',  'register_text'  );
    add_filter(  'ngettext',  'register_text'  );
    function register_text( $translated ) {
         $translated = str_ireplace(  'Nombre',  'Name',  $translated );
         return $translated;
    }
    
    Thread Starter jandres

    (@jandres)

    Solved installing another user registration:
    https://es.wordpress.org/plugins/user-registration/

    Hi there,

    I’m sorry my solution did not worked, but glad that the issue is finally gone.

    Have a nice day!

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

The topic ‘Impossible to translate Registration Form’ is closed to new replies.