Renaming search page title

This topic contains 20 replies, has 4 voices, and was last updated by  David Sirius 6 years, 3 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #411607

    David Sirius
    Expired Member
    Post count: 163

    Hi All,

    My search page is coming along nicely. However, I’m currently struggling with the title of the search page. I found by searching in the forum that the output of “Search Places” can be renamed with Poedit, which by the way worked great for making language changes to the search page.

    However, there are two problems:
    1) the second word is always capitalised (regardless of the lower case input in Poedit)
    2) there is space between the second word and the colon.

    See attached screenshot.

    How can I get the second word to be lower case and remove the space?

    Many thanks
    David

    #411611

    Guust
    Moderator
    Post count: 29970

    Can you post the URL so we can inspect the code?
    You can do that in a private message if you like.

    #411614

    David Sirius
    Expired Member
    Post count: 163

    Hi Guust,

    Unfortunately, the website is currently only on localhost. I hope there is still a solution?

    Many thanks,
    David

    #411617

    Guust
    Moderator
    Post count: 29970

    What theme are you using?

    #411633

    David Sirius
    Expired Member
    Post count: 163

    The regular supreme directory theme.

    #411634

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Both theses issues can be solved by translating the following string ‘ For :’ (note the space at the start)

    Thanks,

    Stiofan

    #411639

    David Sirius
    Expired Member
    Post count: 163

    I’m confused. The “Results For” you see in my screenshot is already my translation by entering “Results” for “Places” and “for” for “Places”. So there is no actual string from the code of “For” that can be translated. Or maybe I missunderestand your solution.

    #411640

    David Sirius
    Expired Member
    Post count: 163

    I adjusted my translation for “for” to ” for :” and that did indeed changed For to lowercase for. But the problem with the space before the colon remains. In the screenshot you see two colons because I entered it exactly as you provided,but even if I remove the colon (‘ for ‘) or colon and space (‘ for’) the space remains.

    #411642

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    What u are looking for is ” For :” and u would want to change it to ” for:”
    (i’m not sure what u did…)

    Stiofan

    #411644

    David Sirius
    Expired Member
    Post count: 163

    I think we are missunderstanding, I’ll explain what I did in more detail:

    1. I downloaded and installed POedit (see https://wpgeodirectory.com/docs/translate-core/)
    2. I followed steps 1.-7. to create a new language file (German)
    3. I made various translations on the search page which all worked fine
    4. The original supreme theme has a header on the search page showing “Search Places :” see also in the demo https://wpgeo.directory/supreme-directory/?geodir_search=1&stype=gd_place&s=+&snear=&sgeo_lat=&sgeo_lon=
    5. I tried to rename this via the translation tool POedit by changing “Search” to “Results” and “Place” to ” for”. However the colong is not shown in POedit (source text) so it the space and colon must come from a template file

    Please dont be confused by the fact that I said I created a German file and now I’m making English to English translations, this is just to demonstrate the problem (German prahses wouldnt help solving this). Eventually Results for will be something in German.

    #411649

    Guust
    Moderator
    Post count: 29970

    Normally, if searching for something, it is “Search [plural of CPT] For : ‘[search for term]’ ‘Near search term”
    For example: Search Events For : ‘party’ ‘Amsterdam’

    You can translate “Search” and “For :” separately, for example “Search” and “for:”, so the result becomes
    Search Events for: ‘party’ ‘Amsterdam’

    If you translate “Places” that will be translate “Places” on other pages too, so you should only translate it with something similar like “Businesses” or “Listings” etc.

    #411660

    David Sirius
    Expired Member
    Post count: 163

    You can translate “Search” and “For :” separately, for example “Search” and “for:”, so the result becomes Search Events for: ‘party’ ‘Amsterdam’

    OK. There was a also missunderstanding on my behalf then, I didnt know that “For :” is indeed an existing source text in POedit and thus translatable. I translated “For :” to “for:” but that didnt change eliminate the space. I presume its because I already translated “Search” “Places” to “Results” “for” and changing “For :” to “for:” would only change accordingly where “For :” is originally placed in the code but not layered on top via a language file.

    If you translate “Places” that will be translate “Places” on other pages too, so you should only translate it with something similar like “Businesses” or “Listings” etc

    Understood. The better solution would be then to not translate it via POedit but change the words in the code, i.e. find the PHP code that outputs “Search Places :” and replace it with “Results for:”. In which file would I find the code?

    #411672

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    If you change it in the code it will just be lost on the next update, the best option is to use translation.

    Thanks,

    Stiofan

    #411675

    David Sirius
    Expired Member
    Post count: 163

    Changing the code:
    Couldnt I just copy the file into my supreme directory folder and amend it there? I’m not planning to update the supreme directory theme as I have customised it extensively.

    Translation:
    As per above, the translation doesnt allow to eliminate the space between “Places” and “:” see again screenshot attached..

    #411725

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    It seems you are deleting language strings by substituting no value in your translation.

    We recommend using translation and provide support for bugs or issues related to translation.

    Dealing with the ‘space’ character in the manner you suggest would be a customization. Let us know how it goes.

Viewing 15 posts - 1 through 15 (of 21 total)

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

Open Support Ticket