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
  • Author
    Posts
  • #384905

    stillwater
    Full Member
    Post count: 44

    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.

    #384924

    Guust
    Moderator
    Post count: 29970

    Language 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.mo

    Thanks

    #384927

    stillwater
    Full Member
    Post count: 44

    I 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>

    #384932

    Guust
    Moderator
    Post count: 29970

    See 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

    #384933

    stillwater
    Full Member
    Post count: 44

    Great, 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?

    http://stay-boutique.com/?geodir_search=1&stype=gd_hotels&s=+&snear=lol&sgeo_lat=44.951313&sgeo_lon=0.7637349999999969

    See where it has %%location%%? Is there a valid variable I could use for search term?

    #384936

    Guust
    Moderator
    Post count: 29970

    That 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

    #385154

    stillwater
    Full Member
    Post count: 44

    Gotcha. Makes sense to me. I agree about the verbiage – I’ll relay this to our client. Thanks for your help!

    #385188

    stillwater
    Full Member
    Post count: 44

    Sorry 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:

    http://stay-boutique.com/?geodir_search=1&stype=gd_hotels&s=+&snear=fffwewf&sgeo_lat=23.1166667&sgeo_lon=120.46666670000002

    #385209

    Guust
    Moderator
    Post count: 29970
    This reply has been marked as private.
    #385228

    stillwater
    Full Member
    Post count: 44

    A-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!

    #385230

    Guust
    Moderator
    Post count: 29970

    You’re welcome 🙂

Viewing 11 posts - 1 through 11 (of 11 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount