Change "No listings" verbiage?
This topic contains 10 replies, has 2 voices, and was last updated by Guust 7 years, 9 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
June 27, 2017 at 7:34 pm #384905
If a user searches for a location that doesn’t exist, they get this result
“No Records Found
Sorry, no records were found. Please adjust your search criteria and try again.
No listings found which match your selection.”How can I alter this verbiage? Client wants the text to be more helpful to the user.
I read through this post: https://wpgeodirectory.com/docs/translate-core/
Which confused me. I don’t need to alter any translations, I just want to add some text to the error to be more helpful to the user. Nevertheless, I tried to follow the instructions, although I didn’t use poedit.
I took the files at wp-content > plugins > geodirectory > geodirectory-languages > geodirectory-en_US.mo + po and put them in my child theme (wp-content > themes > supreme-directory > geodirectory > geodirectory-languages) then made the text mod (in my text editor Atom).
Uploaded to server, and it doesn’t work to override the default text.
I then tried putting the files in wp-content > themes > supreme-directory > languages > plugins and still no change.
What am I doing wrong? I don’t want to alter any plugin files directly and want everything to be in my child theme.
June 27, 2017 at 10:06 pm #384924Language files are not only used for translations, but to edit any default language strings in plugins or themes.
One reason things do not work is because you did not use PoEdit, only PoEdit will create the correct MO file if editing the PO file.
Look at point 4 of the documentation. You are “translating” a plugin, not a theme. The correct file path is /wp-content/languages/plugins/geodirectory-en_US.moThanks
June 27, 2017 at 10:21 pm #384927I see.
So I opened up geodirectory/geodirectory-languages/geodirectory-en_US.po in PoEdit
But it doesn’t really explain in the tutorial how to make an edit to this file
Please see screenshot. This is the text I would like to edit. I want it to be something like:
<p>Sorry, no hotels were found for %%location%%. Please contact us if you would like to add some for this location.</p>
June 27, 2017 at 10:28 pm #384932See the box called “Translation” on the bottom?
Enter your new text in there, and save the file.
That will update the PO and the Mo file, then upload to the correct spot.This may assist too: https://www.youtube.com/watch?v=Z6aAnlyKoxk
June 27, 2017 at 10:34 pm #384933Great, that worked 🙂 Thanks!
While I’ve got you here, could you point me in the direction of a variable that could handle pulling in the search term?
See where it has %%location%%? Is there a valid variable I could use for search term?
June 27, 2017 at 10:42 pm #384936That cannot work. If the original language string does not have a variable, you cannot add on in the translation.
Also, possible reason for “no results” is not necessarily if there are no hotels in the location, it may just be because the visitor search for a keyword that does not exist. So the message as it is, would be misleading.Thanks
June 29, 2017 at 3:52 pm #385154Gotcha. Makes sense to me. I agree about the verbiage – I’ll relay this to our client. Thanks for your help!
June 29, 2017 at 6:55 pm #385188Sorry to open this back up again, but is there a way for me to form an email link in the translation?
It is breaking my ’email us’ mailto link for no results found:
June 30, 2017 at 12:18 am #385209This reply has been marked as private.June 30, 2017 at 4:38 am #385228A-ha! PoEdit was adding their own quotations into the a tag automatically, in addition to mine when I typed out the HTML, so it was double quotations 😛 Interesting setup but at least now I know. Thanks for your help/for the test link!
June 30, 2017 at 5:54 am #385230You’re welcome 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket