Renaming search page title
This topic contains 20 replies, has 4 voices, and was last updated by David Sirius 7 years, 2 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
January 6, 2018 at 8:39 am #411607
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
DavidJanuary 6, 2018 at 11:32 am #411611Can you post the URL so we can inspect the code?
You can do that in a private message if you like.January 6, 2018 at 11:41 am #411614Hi Guust,
Unfortunately, the website is currently only on localhost. I hope there is still a solution?
Many thanks,
DavidJanuary 6, 2018 at 12:03 pm #411617What theme are you using?
January 6, 2018 at 12:48 pm #411633The regular supreme directory theme.
January 6, 2018 at 12:53 pm #411634Both theses issues can be solved by translating the following string ‘ For :’ (note the space at the start)
Thanks,
Stiofan
January 6, 2018 at 1:24 pm #411639I’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.
January 6, 2018 at 1:36 pm #411640I 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.
January 6, 2018 at 1:43 pm #411642What u are looking for is ” For :” and u would want to change it to ” for:”
(i’m not sure what u did…)Stiofan
January 6, 2018 at 1:54 pm #411644I 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 filePlease 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.
January 6, 2018 at 2:17 pm #411649Normally, 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.
January 6, 2018 at 3:12 pm #411660You 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?
January 6, 2018 at 4:11 pm #411672If you change it in the code it will just be lost on the next update, the best option is to use translation.
Thanks,
Stiofan
January 6, 2018 at 4:18 pm #411675Changing 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..January 6, 2018 at 7:45 pm #411725Hello!
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.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket