-
Author
-
January 19, 2016 at 13:30 #99271
Macarlos1
ParticipantDear 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.
January 20, 2016 at 23:52 #99652Laura
ModeratorHello, 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 solutionJanuary 21, 2016 at 12:31 #99720Andrei
ModeratorThis 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 #99917Macarlos1
ParticipantHi 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 #99950Andrei
ModeratorCan 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 16:38 #99980Macarlos1
ParticipantI will work on it. Please keep this post open – I’ll get back to you as soon as I have one.
January 22, 2016 at 22:44 #100048Andrei
ModeratorSure, 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 23, 2016 at 09:37 #100118Macarlos1
ParticipantOK – I have set up the accounts you can use.
Couple of comments regarding Loco Translation plug-in that you should know. I’ve managed to made some translations of “BuddyPress” plug-in already and the updates are appearing on the webpage immediately. For Sweetdate theme it seems like *.po and *.mo files are in the wrong FTP location, so please keep that in mind if you make any updates. I wasn’t able to figure out where they should be placed.
The goal is to set each “Jestem” (English: “I am a”) field as:
Mężczyzną
Kobietąand each “Szukam” (English: “I am looking for”) field as
Mężczyzny
KobietyPlease let me know if you need anything more from my end. Also, thank you in advance for your efforts – it’s much appreciated.
FTP:
Server name: http://ftp.macarloslv.nazwa.pl
User name: macarloslv_kupidi-test
password: @Seventhqueen@Wp-admin:
web page address: kupidi.pl
wp-admin address: kupidi.pl/wp-admin
login: kupidi-test
password: @Seventhqueen@January 25, 2016 at 09:46 #100293Andrei
ModeratorHi,
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 #100609Andrei
ModeratorI’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 #100618Andrei
ModeratorHere 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 solutionJanuary 26, 2016 at 20:47 #100644Macarlos1
ParticipantIn rush I’ve forgotten to establish access via IP’s from outside my country.
Credentials already sent should be working now. Could you still have a look, please?January 26, 2016 at 21:07 #100648Andrei
ModeratorJust 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 10:32 #100716Macarlos1
ParticipantI’ve made the updates as per your advise, though it seems like nothing has changes.
Please login to FTP and verify my update.
functions.php file that was updated is in the following location:
/wp_1/wp-content/themes/sweetdate/functions.php
The function was added to the very bottom of the file. I don’t have too much knowledge on PHP in particular, so it might be that I’m doing something wrong.
The other file as per your advice has been uploaded to: “/wp1/wp-content/themes/sweetdate/custom_buddypress/kleo-bp-search.php”
Current screenshot of webpage search field in attachment.
(?) Please also check line number 4 of the script – probably the word “Mężczyzna” should be updated as “Mężczyzną”. (?)
January 27, 2016 at 16:35 #100764Andrei
ModeratorWell, 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ężczyznyI 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 solutionJanuary 27, 2016 at 20:17 #100849Macarlos1
ParticipantSorry to be a pain – my questions comes simply out of lack of knowledge…
Where can I find the place that would allow me to set up my values for these two fields?
Also – are there any other settings I should be aware of, to make this solution to work?February 4, 2016 at 20:27 #102209Andrei
ModeratorYou 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 4, 2016 at 23:00 #102227Macarlos1
ParticipantHi again,
Just wanted to let you know that it works.
Thank you for great support!
February 5, 2016 at 01:31 #102237Andrei
ModeratorI’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.