Translation of urls for customizable blocks
Tagged: customizer block, front page blocks, polylang, sliders, url translation
- This topic has 5 replies, 3 voices, and was last updated 5 years, 10 months ago by
jorgen.
-
AuthorPosts
-
December 15, 2017 at 5:16 pm #7112
jorgen
ParticipantFor Polylang I can edit the text for various text from Sliders, Front Page blocks, etc. But I cannot translate the urls for those parts. So the url is always the same for all languages. I have setup my site to create urls like http://www.domainname.com/en/page-url.
If the url was a translatable field, I could make different urls for each language.
Or is there another way?
December 15, 2017 at 5:44 pm #7113Zex
ModeratorHello, Jorgen!
According to the plugin authors, you will need:
Please check this.“One menu per language
In Appearance->menus, you have to create one menu per language. Let’s say ‘menu_en’ and ‘menu_fr’ if you have a site in English and French.
In ‘menu_en’, you add English pages other menu items. In ‘menu_fr’, you add French pages and other menu items.
Then, once menus are both saved, you click on ‘manage locations’ tab and you assign ‘menu_en’ to ‘Primary menu English’ and ‘menu_fr’ to ‘Primary menu Français’.The language switcher in the menu
You have the possibility to add a language switcher anywhere in a menu. Just click on the “Languages switcher” checkbox and then “Add to menu”. If you don’t see the language switcher metabox, check that it is not disabled in the screen options (on top right of the screen). You can then choose the options for the language switcher menu item:
If you uncheck both “Displays language names” and “Displays flags”, the language switcher will display language names.
If you check “Forces link to front page”, the language switcher will always send the visitor to the front page in the right language, otherwise, it will try to find the translated page (and link to the front page if none was found).
If you check “Hides the current language”, the language switcher will never display the current language.
Don’t forget to click on the ‘save menu’ button.”Best Regards
December 16, 2017 at 12:23 pm #7119jorgen
ParticipantHello Zex,
Perhaps I didn’t explained my problem well. I have no problems building menu’s for different languages. I have my site in three languages and therefor I have three menus. The problem I encounter is when I want to set the link for the Agama Pro Front Page boxes (and Sliders). When defining a Front Page Box, I can enter the title, box text, which I am able to translate in Polylang. But there I also need to set a hardcoded Url for linking the boxes to another page. That must be a http:// link to another page. So in that link, I am forced to also add the language parameter. Example: http://www.mydomain.com/en/another-page. But when I am on the German page, the german box will sent me to the English page, since I cannot set the correct URL like http://www.mydomain.com/de/andere-seite… After clicking the Front Box button link will sent me to a English page instead of German.
It would be great to “translate” the button-url field as well.
Best regards
December 16, 2017 at 2:49 pm #7121Jerry
KeymasterHello Jorgen,
We cannot help you too much with this since this question is more related to PolyLang plugin developers than us, we do not know 100% what’s PolyLang possibilities so we cannot suggest you what you should check or change to make your hard coded urls to work on way you need it.
I suggest you to write your case PolyLang plugin support forums which is located on next url:
https://wordpress.org/support/plugin/polylang
We can only help you with non url translations if you have any issues like with slider button title or something like that, for hard coded urls you need to contact plugin author to give you advice.
Thanks for your understating.
Best Regards
December 16, 2017 at 8:25 pm #7126jorgen
ParticipantHi Jerry,
I understand. Thank you for your support.
December 27, 2017 at 5:02 pm #7235jorgen
ParticipantUpdate for my solutions.
In the wpml-config.xml you can add keys with names of the fields. By adding for example
<key name="agama_slider_button_url_1" />
to the list you can now translate the button url for that particular field.By right clicking on the input field, in the HTML you can see the data attr with the id for that field.
Be aware that your wpml-config.xml will be overwritten with a theme update.
-
AuthorPosts
- You must be logged in to reply to this topic.