This topic has 18 replies, 3 voices, and was last updated 8 years by Andrei.

  • Author
  • #99271
     Macarlos1
    Participant

    Dear Team,

    I need your help to solve one situation. I’ve encountered an issue during set up of the theme which is related to the translation results in particular search fields. I’m working to translate the theme to Polish.

    – There are two search fields in the theme which are responsible for saying whether user is a man or a woman. They both work as designed in English.

    Example:

    I am a: Man

    I’m looking for a: Woman

    – After translation however, both of these fields have to have different inputs and outputs for each. This is due to implications of Polish language. It should work exactly as follows:

    I am a: Mężczyzną

    I’m looking for: Kobiety

    and

    I am a: Kobietą

    I’m looking for: Mężczyzny

    I’m pasting in two attachments to give you small overview of the fields I’m referring to. If you need some more clarifications, please kindly get back to me.

    I need these fields to have visible output as follows:

    I am a: Mężczyzną

    I am a: Kobietą

    and

    I’m looking for: Kobiety

    I’m looking for: Mężczyzny

    P.S.

    The irony is that:

    At the moment the results of translations in Polish I’m getting – given current setup of search fields – can be understood in English as:

    me: Man

    me looking for: Woman

    *It doesn’t quite do the job unless you’re a caveman :).

    I thank you in advance for your assistance.

    Attachments:
    You must be logged in to view attached files.
    #99652
     Laura
    Moderator

    Hello, will assign the ticket to a higher support level who can help and advise you in your query.
    Thanks! 🙂

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

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #99720
     Andrei
    Moderator

    This happens because the way the words men and woman are translated in your language under different circumstances. The solution is easy, just be sure you find a common wording for your search field values so that they can be identical ( Kobiety/Kobietą and Mężczyzną/Mężczyzny).

    Let me know how it works.

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

    Hi Andrei,

    Thanks for your answer. The issue is a bit more complicated (yet solvable in my opinion), as there is no common wording to satisfy the need of this search in current configuration. Unlike in English, the forms of words in Polish are changing under different circumstances as you’ve mentioned. If functionality of these two fields is not separated to provide different outcomes, then the entire experience will going to be a bit odd. Since this is the number one feature which is going to be used by all potential users, I cannot afford it to look unprofessionally I’m afraid.

    The split should work as follows.

    Field – “I am a:”, (Polish: “Jestem:”) – needs to allow to choose only:

    Mężczyzną
    Kobietą

    And the other one – “I’m looking for a”, (Polish: “Szukam:”) – has to give the following as the outcome:

    Mężczyzny
    Kobiety

    Thanks!
    Karl

    #99950
     Andrei
    Moderator

    Can you please setup a test place with this translations and with some test users so we can give a look at your site and see if we can come up with a quickly fix ?

    Don’t forget to provide us ftp/wpadmin accounts.

    Looking forward.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #99980
     Macarlos1
    Participant
    This reply has been set as private.
    #100048
     Andrei
    Moderator

    Sure, just let us know when you have more news about it.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100118
     Macarlos1
    Participant
    This reply has been set as private.
    #100293
     Andrei
    Moderator

    Hi,

    Plugins translation files should reside under the following path: “wp-content/languages/plugins/buddypress-es_ES.mo”.

    I’ll keep you updated how things are going on your other issue.

    Looking forward

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

    I’ve found a solution but the ftp credentials don’t work, can you please double check them yourself ?

    Looking forward.

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

    Here is the code which will help you manipulate the field search queries, you need to add it into the functions.php file of your theme

    COPY CODE
    
    
    function kleo_bp_field_query_custom($sql, $field_id, $field_value){
        if( $field_id == '1'){ // I am a - field id
            $extra_sql = false;
            if( $field_value == 'Mężczyzna'){
                $extra_sql = 'Mężczyzny';
            }
            if( $field_value == 'Kobietą'){
                $extra_sql = 'Kobiety';
            }
            if( $extra_sql ){
                $extra_sql = " OR value LIKE '%".esc_sql($extra_sql)."%'";
            }
            $sql = str_replace("value LIKE '%".esc_sql($field_value)."%'", "value LIKE '%".esc_sql($field_value)."%'" . $extra_sql , $sql);
        }
        if( $field_id == '6'){ // Looking for - field id
            $extra_sql = false;
            if( $field_value == 'Mężczyzny'){
                $extra_sql = 'Mężczyzną';
            }
            if( $field_value == 'Kobiety'){
                $extra_sql = 'Kobietą';
            }
            if( $extra_sql ){
                $extra_sql = " OR value LIKE '%".esc_sql($extra_sql)."%'";
            }
            $sql = str_replace("value LIKE '%".esc_sql($field_value)."%'", "value LIKE '%".esc_sql($field_value)."%'" . $extra_sql , $sql);
        }
    
        return $sql;
    }
    add_filter ('kleo_bp_field_query', 'kleo_bp_field_query_custom', 100, 3);
    

    Also, in order for this code to work I had to make a small change to a core file which I have attached below and you’ll have to update it over ftp in the main theme: “wp-content/themes/sweetdate/custom_buddypress/kleo-bp-search.php”, and we’ll include this modification in updates as well.

    Let me know how it went.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
    #100644
     Macarlos1
    Participant
    This reply has been set as private.
    #100648
     Andrei
    Moderator

    Just proceed yourself with the above advices and everything should work just fine.

    Let me know how it went.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100716
     Macarlos1
    Participant
    This reply has been set as private.
    #100764
     Andrei
    Moderator

    Well, in order for my modifications to work you will have to set up your field values as you stated in your first post:

    COPY CODE
    
    I am a: Mężczyzną
    
    I am a: Kobietą
    
    and
    
    I’m looking for: Kobiety
    
    I’m looking for: Mężczyzny
    

    I have built the custom search based on this values.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100849
     Macarlos1
    Participant
    This reply has been set as private.
    #102209
     Andrei
    Moderator

    You can set them from your wp admin backend under “Users > Profile Fields”

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #102227
     Macarlos1
    Participant
    This reply has been set as private.
    #102237
     Andrei
    Moderator

    I’m glad to hear that.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 19 posts - 1 through 19 (of 19 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?