Archived topic
Copyright and menu labels in multi language site
19 replies · Started by Branislav Pakic on March 31, 2016
I have a multi language site (English and Serbian) where I use Polylang. I also have GP Premium. My problem is that I don't know how to translate the Menu Plus Mobile Menu Label and Copyright text to both languages. Can that be done?
Hi there,
Let me look at their documentation to see if there's something I can do to allow the plugin to recognize those custom strings.
I'll update this thread.
Thanks!
Out of curiosity, can you see if this plugin works?: https://wordpress.org/plugins/polylang-theme-strings/
It doesn't do anything out of the box. Maybe the copyright text and menu plus label need to be registered as strings in function.php? If that makes sense how can I do that?
Been working on this.
Can you try this PHP?: https://gist.github.com/generatepress/c662c1002e66f86a7cf42e084305a4db
If it works, I'll add the other strings and make it compatible in core.
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
It works!
I can now translate the menu label.
I know I'm not the first to say it, but your support is top-notch!
Awesome, I'll work towards adding compatibility to core :)
Thanks!
Hello, Tom!
I've faced the same issue with translating copyright section with polylang. After adding your code (https://gist.github.com/generatepress/c662c1002e66f86a7cf42e084305a4db) in code snippet I've found only GeneratePress Mobile Menu string in polylang settings.
Is there a way to translate the copyright?
I just made some changes to work with the new Customizer copyright field: https://gist.github.com/generatepress/c662c1002e66f86a7cf42e084305a4db
Let me know how it goes :)
Tom, this is great!
Everything works fine. Thank you a lot!
UPD
I've rushed a liitle bit with this. I can see the copyright string in polylang settings, but it seems like copyright in customizer overrides this. When I'm cleaning copyright text in wordpress customizer it drops to default (generatepress etc) and ignores what I'd put in polylang.
You're welcome :)
I'm sorry, not sure if you're rieciving updates from edited messages. Can you please check the previous message?
So you're clearing the value from the Customizer? Wouldn't you add the copyright to the Customizer, and then adjust that string in Polylang for multiple languages?
Okay, I did some tests :)
Seems like using %copy% or %current_year% and inline style breaks translation. If I put these into customizer languages aren't swithching for copyright section. For instance:
<a href="http://tsu.ru/">TSU</a> Institute of the Human of the Digital Era - works
<div style="text-align: left;">%current_year% %copy% <a href="http://en.tsu.ru/">TSU</a> Institute of the Human of the Digital Era</div> - nope
UPD
Inline styles are fine. Only code like %copy% is causing troubles.