-
Author
-
January 19, 2016 at 13:30 #99271Macarlos1Participant
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.January 20, 2016 at 23:52 #99652LauraModeratorHello, 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 solutionLaura 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 🙂
January 21, 2016 at 12:31 #99720AndreiModeratorThis 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 solutionJanuary 22, 2016 at 10:18 #99917Macarlos1ParticipantHi 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
KobietyThanks!
KarlJanuary 22, 2016 at 14:54 #99950AndreiModeratorCan 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 solutionJanuary 22, 2016 at 22:44 #100048AndreiModeratorSure, 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 solutionJanuary 25, 2016 at 09:46 #100293AndreiModeratorHi,
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 solutionJanuary 26, 2016 at 18:05 #100609AndreiModeratorI’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 solutionJanuary 26, 2016 at 18:23 #100618AndreiModeratorHere 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 CODEfunction 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 solutionAttachments:
You must be logged in to view attached files.January 26, 2016 at 21:07 #100648AndreiModeratorJust 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 solutionJanuary 27, 2016 at 16:35 #100764AndreiModeratorWell, in order for my modifications to work you will have to set up your field values as you stated in your first post:
COPY CODEI 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 solutionFebruary 4, 2016 at 20:27 #102209AndreiModeratorYou 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 solutionFebruary 5, 2016 at 01:31 #102237AndreiModeratorI’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 -
AuthorPosts
You must be logged in to reply to this topic.