New home › Forums › Pro Add-on › Troubleshooting › String translation missing ?
Tagged: columns, polylang, string, translate, translation
- This topic has 12 replies, 2 voices, and was last updated 1 year, 5 months ago by costino80.
-
AuthorPosts
-
March 30, 2022 at 1:33 pm #72602costino80Participant
Hi,
I have WP Google Maps pro and I’m very happy with this great and powerful extension.
I translated my website with Polylang in three languages (french, dutch, english) and while some strings are translated (pagination, etc), other are not…How can I translate theses strings ?
– “Filter by”
– The columns headers of the markers list (Adres, Description, Title,…). They stay in french no matter what I try…
-Marker’s info bubble (x km distance from.., itinerary,etc…)Since the .po files exist, shouldn’t they be automatically translated ?
Thanks in advance for you help !
April 4, 2022 at 1:43 pm #72733costino80ParticipantUp.
Any idea on how to translate those strings ?
Thanks
April 5, 2022 at 7:50 am #72738StevenModeratorHi there,
Thank you so much for getting in touch, we really appreciate your time.
Some strings cannot be translated automatically via the PO if the strings do not exist so these might need to be added.
– https://www.wpgmaps.com/documentation/translating-the-plugin/With that said, fields are static and need to be adjusted with some custom script which I am happy to help with.
If open to this, please send me a link to the page where your map is situated?
I look forward to hearing back from you.
Kindest Regards,
Steven De BeerApril 14, 2022 at 3:08 pm #72846costino80ParticipantThis reply has been marked as private.April 14, 2022 at 3:39 pm #72850StevenModeratorHi @costino80,
Thank you so much for getting back to me.
Could I kindly ask you to navigate to -> Maps -> Settings Advanced Settings -> please copy the script found in the below link and paste this in the custom JS field:
– https://gist.github.com/StevenDeBeer/56a0796ccdc52babdb52cbba2e0aba30Kindly adjust where it says New Text Here to the correct translations in order(1,2,3) which is left to right of the table.
This should detect the language of the page or browser and adjust the translations accordingly.
Let me know if this helps?
Kindest Regards,
Steven De BeerApril 14, 2022 at 5:09 pm #72851costino80ParticipantHello,
Thanks.
It’s strange because I don’t have the “custom JS field” on the advanced settings page but I have two custom css fields.
I assumed it was a backend translation issue and pasted the code in the second text field, without changing anything. (except userLang to fr-BE and nl-BE from my page html)
I looked on the frontend and my columns weren’t translated in “New text”.
Am I missing something ?
Thanks.
Attachments:
You must be logged in to view attached files.April 19, 2022 at 10:05 am #72862StevenModeratorHi again,
Thank you so much for getting back to me.
That is correct, it does seem to be a translation issue so the second field should still contain the functionality for custom JavaScript.
Might I kindly ask if you would be open to creating a temporary admin account so that I might try a few adjustments?
Kindest regards,
Steven De BeerApril 19, 2022 at 4:54 pm #72873costino80ParticipantThis reply has been marked as private.April 24, 2022 at 8:33 pm #72916costino80ParticipantHello,
Did you have de chance to have a look at this strange behavior ?
Thanks,
April 25, 2022 at 2:44 pm #72926StevenModeratorHi again,
Thank you so much for getting back to me and my sincerest apologies for the delay.
I have made a few adjustments and this does seem to be getting adjusted at my end.
Could I kindly ask you to take a look at your end?
Kindest Regards,
Steven De beerApril 25, 2022 at 8:54 pm #72927costino80ParticipantGreat thank you !
It works like a charm !I assume “markerlistingupdated.wpgmza” is a custom jquery event 🙂
For those interested to change the column headers of the markers’listing, paste this code below in Maps -> Settings => Advanced Settings -> custom JS field, and change the language code “fr-BE, nl-BE..” accordingly.
Query(document.body).on(“markerlistingupdated.wpgmza”, function(event){
var userLang = navigator.language || navigator.userLanguage;
var htmlLang = document.getElementsByTagName(“html”)[0].getAttribute(“lang”);if(userLang == ‘nl-BE’ || htmlLang == ‘nl-BE’) {
// Dutch Translation
jQuery(‘.wpgmza_marker_holder th:nth-child(1)’).text(‘New Text Here’);
jQuery(‘.wpgmza_marker_holder th:nth-child(2)’).text(‘New Text Here’);
jQuery(‘.wpgmza_marker_holder th:nth-child(3)’).text(‘New Text Here’);
} else if(userLang == ‘fr-BE’ || htmlLang == ‘fr-BE’) {
// French Translation
jQuery(‘.wpgmza_marker_holder th:nth-child(1)’).text(‘New Text Here’);
jQuery(‘.wpgmza_marker_holder th:nth-child(2)’).text(‘New Text Here’);
jQuery(‘.wpgmza_marker_holder th:nth-child(3)’).text(‘New Text Here’);
}});
Again thank you !
April 26, 2022 at 7:31 am #72928StevenModeratorI am glad this has helped.
That is correct, this should ensure that each time the marker listing is updated fur to filtering for example, the title change along with it.
Do let me know if there is anything more I can help with or if you have any more questions. 🙂
If you ever have two minutes spare, please consider reviewing the plugin on Twitter @WPGMaps or if you don’t use Twitter on https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post it would mean the world to me! (If possible, could I ask you to mention both your name and mine in the review for administrative purposes, this would be a tremendous help!)
Kindest Regards,
Steven De BeerApril 26, 2022 at 3:59 pm #72932costino80ParticipantThank you.
I don’t use Twitter but I reviewed the plugin and the great support on WordPress.org
Keep up the good work !
Thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.