This topic has 38 replies, 7 voices, and was last updated 10 years by dentwo.

  • Author
  • #537

    I use wpml program to translate the site. I like when i have the signs on top with the languages. I start to tranlate all the pages i have or you created. BUT how i translate the profile fields in my language (greek) without lost the english version because maybe somepeople likes to work in english and not in greek. And in the admin page of sweetdate i want to have and both version. What you recommend to me to do..
    Thank’s a lot for your attention!

    #538
    #545
     SQadmin
    Keymaster

    Hi,

    You can set the style for the language switcher to be a dropwdown from WPML. I guess it looks nicer.
    You should let the defined profile fields in english and then translate them using WPML string translation.

    In admin you can select your language form your Profile

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #547
     SQadmin
    Keymaster

    Maybe this plugin can help you also :
    http://wordpress.org/plugins/buddypress-multilingual/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #565
     rugwarrior
    Participant

    Hi there,

    BuddyPress Multilingual is currently under heavy development (as told me from WPML). There will be a new version supporting BuddyPress 1.7+ but they could not tell me how long it will take but they are working on this since a while… so I hope it will be this month 🙂

    And they also completely rewrite the WooCommerce plugin to make the whole process a lot easier (this is already in beta test)…

    #576

    Hi!
    I using WPML string translation BUT i can’t find the words Man, Woman…. i see with mozila source explorer that they are must be in one file with the name program and the WPML don’t work with this. With many other words the translation works as i expect.
    I have try to change from the Admin bat the language to greek in the profile fields but the group and the others don’t change, remain the same…
    Thanks for your attention…

    #621
     SQadmin
    Keymaster

    Those fields come from the database and since they are added as english I have tried to add the generated string into a translation function. That means that you will have to translate all fields that are added as option to the fields.

    I have added this in v.14 which is coming today those

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #655
     SQadmin
    Keymaster

    You can try with the new v1.4 and see if those profile fields appear in WPML strings

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2372
     sv1aud
    Participant

    Hi there

    I also have an issue with Buddypress profile fields label translations, when I add new fields.

    I tried many tricks including WPML and Buddypress Multilingual plugin but nothing works so far.

    Would it be a solution to use a (not used) profile field coming from the database and rename it ? Or please can you explain how to add new profile fields in the Sweetdate tables.

    Thanks for your support.

    #2393
     SQadmin
    Keymaster

    Hi,
    What we tested and worked are the labels in the search form. We did this using WMPL string translation. You should add you fields in english to from admin and they should appear in the WPML string translation.
    Other generated labels from profile area depend on how buddypress generates them.

    We will do some tests also with Buddypress Multilingual.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2401
     sv1aud
    Participant

    Hi,

    I did several tests with WPML but it didn’t work : I created new profile fields from WP admin, but they don’t appear in WPML string translation…

    Same pb for the “text before form”, I don’t see it in the string translation…

    Any idea how I could make it work ?
    Replace existing Profile fields instead of creating new ones ?

    Thanks.

    #2621
     SQadmin
    Keymaster

    Hi,
    By default Buddypress doesn’t wrap the field name in a translation function so this will do the trick so your field names would appear under WMPL string translation:
    Add this code to your sweetdate-child/functions.php file and make sure to have the sweetdate-child theme active:

    COPY CODE
    
    
    add_filter('bp_get_the_profile_field_name', 'kleo_translated_profile_name');
    function kleo_translated_profile_name($name) {
    return __($name,'buddypress');
    }
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2666
     sv1aud
    Participant

    Hi,
    Unfortunately it still doesn’t work for me.

    – I added your function to the child theme functions.php
    – activated the child theme
    – added a new Buddypress profile field

    But it still doesn’t show up in the WPML string translation…

    Did you manage to do the same test ?

    Thanks.

    #2669
     sv1aud
    Participant

    Hi again,

    I guess I understood why it didn’t work for me.

    You need to check the WPML option “Auto Register strings” in the String Translation menu…

    I still have a few bugs to solve. For ex. a select field displayed on the home page (search form) will display the right translated select menu values, whereas the user profile page won’t…

    #2670
     SQadmin
    Keymaster

    Hi,
    Instead adding those lines of code I gave you try to do this change in Buddypress core and see if it changes something: http://wpml.org/forums/topic/translate-buddypress-profile-fields/#post-64803

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2671
     SQadmin
    Keymaster

    So in conclusion this solution worked for us:
    – WPML plugin
    – WMPL String translation plugin
    – From WPML -> String Translation -> Auto-register strings only when logged in as an administrator
    – Make this core Buddypress change as in here: http://wpml.org/forums/topic/translate-buddypress-profile-fields/#post-64803
    – Browse trough the site so the strings get registered

    If you update Buddypress you need to do the core change again.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2676
     sv1aud
    Participant

    Thanks… looks like it works !

    I also added Buddypress Multingual : http://wordpress.org/plugins/buddypress-multilingual/ to allow users to edit their profile fields in the right language.

    Now I guess the only remaining string I could not translate is the text “before” and “after” search form, that you can edit from the theme admin. Any idea how I could do this ?

    You guys got my 4 stars for your support !

    #2677
     SQadmin
    Keymaster

    Hi.
    Please replace the contents of this file: sweetdate/custom_buddypress/kleo-bp-search.php with this: https://archived.seventhqueen.com/files/kleo-bp-search.txt

    4 is good, 5 would be great
    Just kidding. Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2687
     sv1aud
    Participant

    Works perfect.

    You won another star for rating 😉

    #2709
     SQadmin
    Keymaster

    Awesome. Thanks

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2825
     sv1aud
    Participant

    Sorry I have to re-open this post 😉

    Buddypress profile field names now translates well with WPML, but field values don’t… Should I register a new core function to handle them ?

    Any suggestion ?

    #2867
     SQadmin
    Keymaster

    I don’t think that should be translated but you can try modifying the same core file:
    from:

    COPY CODE
    
    	function bp_get_the_profile_field_value() {
    		global $field;
    
    		$field->data->value = bp_unserialize_profile_field( $field->data->value );
    
    		return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
    	}
    

    to

    COPY CODE
    
    	function bp_get_the_profile_field_value() {
    		global $field;
    
    		$field->data->value = __(bp_unserialize_profile_field( $field->data->value ));
    
    		return apply_filters( 'bp_get_the_profile_field_value', $field->data->value, $field->type, $field->id );
    	}
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2871
     sv1aud
    Participant

    Thanks, we’re close…

    After applying your change to Buddypress core file fields values appear translated in the theme search forms, but not in :
    Register page
    Edit profile page

    Is this handled by Buddypress or by the theme ?

    #2895
     SQadmin
    Keymaster

    That is handled by also by Buddypress. They can’t appear translated there since they need to be inserted first and then display the translated version, so original remains in the default language

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2922
     sv1aud
    Participant

    I don’t get it. In the Edit profile page, fields are already inserted when you modify them…

    Plus same fields (“Month of birth”) in my case shows translated in the Sweedate search forms, but not in the Buddypress pages…

    If you have any proposal that would really help. Thanks again.

    #2976
     SQadmin
    Keymaster

    Tough thing with translating inserted values but try modifying another core file: buddypress/bp-xprofile//bp-xprofile-classes.php at function get_value_byid()
    modify return $data;
    with return __($data, ‘buddypress’);

    Should work.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #2986
     sv1aud
    Participant

    Unfortunately that one didn’t make it…

    The (select menu) field still shows in original language, and also loses index value (December switched to default January)
    It’s hard to believe Buddypress doesn’t handle properly field values…!

    Thanks for your help, let me know if you have any other proposal please.

    #3020
     SQadmin
    Keymaster

    Revert the previous solution if it didn’t worked and try editing the buddypress/bp-xprofile/bp-xprofile-template.php and replace:
    line 513

    COPY CODE
    
    $html .= apply_filters( 'bp_get_the_profile_field_options_select', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_attr( stripslashes( __($options[$k]->name )) ) . '</option>', $options[$k], $field->id, $selected, $k );
    
    

    line 552

    COPY CODE
    
    $html .= apply_filters( 'bp_get_the_profile_field_options_multiselect', '<option' . $selected . ' value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '">' . esc_attr( stripslashes( __($options[$k]->name )) ) . '</option>', $options[$k], $field->id, $selected, $k );
    

    line 578

    COPY CODE
    
    $html .= apply_filters( 'bp_get_the_profile_field_options_radio', '<label><input' . $selected . ' type="radio" name="field_' . $field->id . '" id="option_' . $options[$k]->id . '" value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '"> ' . esc_attr( stripslashes( __($options[$k]->name )) ) . '</label>', $options[$k], $field->id, $selected, $k );
    

    line 618

    COPY CODE
    
    $html .= apply_filters( 'bp_get_the_profile_field_options_checkbox', '<label><input' . $selected . ' type="checkbox" name="field_' . $field->id . '[]" id="field_' . $options[$k]->id . '_' . $k . '" value="' . esc_attr( stripslashes( $options[$k]->name ) ) . '"> ' . esc_attr( stripslashes( __($options[$k]->name )) ) . '</label>', $options[$k], $field->id, $selected, $k );
    

    The lines might not be the same but you’ll see something similar that gets replaced

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5247
     wttribe
    Participant

    Hello I have a similar problem.
    I need to translate profile fields.
    I followed all these steps:
    – WPML plugin
    – WMPL String translation plugin
    – From WPML -> String Translation -> Auto-register strings only when logged in as an administrator
    – Make this core Buddypress change as in here: http://wpml.org/forums/topic/translate-buddypress-profile-fields/#post-64803
    – Browse trough the site so the strings get registered

    It does not work.
    What should I do?

    here is what I have:
    – wpml 2.9.3
    – wpml string translation 1.9
    – buddypress 1.8.1
    – buddypress multilingual 1.4.2
    everything is updated to the latest version!!

    please help, I dont know what to do…

    #5282
     SQadmin
    Keymaster

    Hi,
    Those should appear, at least it appeared in our tests and @sv1aud
    Maybe you haven’t made the core changes to Buddypress right?

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #5285
     sv1aud
    Participant

    Hi

    yes I finally cancelled my BP core code changes, as it didn’t work

    On my side I could translate all profile fields.
    Did you install the BP multilingual plugin ?

    #5286
     wttribe
    Participant

    Hi,

    here is what I did. I opened buddypress bp-xprofile-template.php and changed from this

    function bp_the_profile_field_name() {
    echo bp_get_the_profile_field_name();
    }

    function bp_get_the_profile_field_name() {
    global $field;

    return apply_filters( ‘bp_get_the_profile_field_name’, $field->name );
    }

    To this:

    function bp_the_profile_field_name() {
    echo bp_get_the_profile_field_name();
    }

    function bp_get_the_profile_field_name() {
    global $field;
    $f_name = __( $field->name, ‘buddypress’ );
    return apply_filters( ‘bp_get_the_profile_field_name’, $f_name );
    }

    Nothing changed.

    I have BP multilingual plugin activated.

    In my wpml strings I did not find any new string…

    #6760
     wttribe
    Participant

    Any help on this?

    #6856
     SQadmin
    Keymaster

    Hi, I checked again and worked when I applied the fix that is specified here: http://wpml.org/forums/topic/translate-buddypress-profile-fields/#post-64803

    You have to :
    – let WPML to handle the strings translations from WPML – Theme and plugins localization
    – Auto-register strings only when logged in as an administrator from WPML – Strings Translation

    Then I went to my profile, switched to my secondary language and that done it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #6954
     wttribe
    Participant

    Ok I solved the problem. I report here for the others who might find the same problem.

    I updated both wpml plugin and wpml strings translation plugin (they ware out-dated)

    I switched the theme to the default wp theme.

    I clicked on “translate with WPML”

    and it worked.

    Then I turned Sweetdate child theme back and run the scan for new strings to be translated.

    It worked fine.

    A little bit tricky but effective so far.

    Thank you for your support!

    #8762
     dentwo
    Participant

    i tried all the methods stated above and still can’t get buddy press to recognise the profile field values so that i can translate it using WPML ….

    any help is appreciated

    #8763
     dentwo
    Participant
    This reply has been set as private.
    #8797
     Abe
    Keymaster

    Hi,
    This solution worked for us:
    Install this plugins:
    – WPML plugin
    – WMPL String translation plugin
    – Buddypress Multilingual
    – From WPML -> String Translation -> Auto-register strings only when logged in as an administrator
    – Make this core Buddypress change as in here: http://wpml.org/forums/topic/translate-buddypress-profile-fields/#post-64803
    – Browse trough the site so the strings get registered. Try switching the site language when you are viewing your profile to the other language

    If you update Buddypress you need to do the core change again.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #8800
     dentwo
    Participant

    hi Abe,

    i have done all the above and only the profile fields is able to be translated.

    eg. I have a profile field “looking for” with checkbox selection for male/ female. i am able to translate “looking for” but not male and female.

Viewing 39 posts - 1 through 39 (of 39 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?