Skip Navigation

[Resolved] Translate Footer Text and Return to top Link with WPML

This support ticket is created 7 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 9 replies, has 2 voices.

Last updated by Geoffrey Cleverley 7 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#511334
Screen Shot 2017-04-10 at 12.45.46 AM.png

Hey there.

I am working on a multilingual site. Using Toolset, Layouts, Genesis Integration and WPML.

I am not sure if I should be using the support forum there or here? So I posted to both.
https://wpml.org/forums/topic/translate-footer-text-and-return-to-top-link-with-wpml-toolset/

In the header and footer parent layout, in the footer, there is the credits and back to top link. I am having difficulty translating these elements with WPML.

1. When I set the credits to custom text and use [wpml-string] in the text field, it sometimes registers the string and sometimes doesn't. I have been making changes and the whole string translation breaks and stops working.

2. In the Back to top link, I can't use the [wpml-string] to register the string at all.

Thanks

Jeff

#511358

Dear Jeff,

Q1) When I set the credits to custom text and use [wpml-string] in the text field ...
It is abnormal, please check these first:
1) Make sure you are using the latest Toolset + WPML plugins,
2) deactivate other plugins and switch to wordpress default theme, and test again
3) Enable PHP debug mode, copy and paste the debug logs here
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

Q2) Are we talking about the "Genesis Footer" cell of "Toolset Genesis Integration" plugin?
Where do you want input the shortcode [wpml-string]? are you going to wrap the string "Return to top" with shortcode [wpml-string]?

#511653
5 - Return to top footer with wpml string..png
4 - Genesis Footer Layout Settings.png
3 - Return to Top - Footer Text.png
2 - Genesis Footer Integration.png
1 - Genesis Footer Integration.png

Hey Luo,

Thanks for your help.

1. I am using the latest Toolset and WPML Plugins

2. I have deactivated all the other plugins. I can't switch to default theme, as the translation problems I am having relates to the genesis footer integration with layouts, as part of the Layouts Genesis Integration plugin.
(please see screenshot 1 & 2)

3. I am still working on my local host. I have enabled PHP debugging in wp-config.php, and created the file in the wordpress root folder manually. I am using 'local by flywheel' on a mac, I would need some advise as to how to make it writable to apache from macOS on local server.

Also please be advised the following link is now 404 dead:
https://toolset.com/documentation/user-guides/debugging-types-and-views/

Q1 and Q2 are both related.

4.
Please see attached screenshot '3_Return_to_Top_-_Footer_Text.png'
This shows the footer text and the return to top link text that I want to translate.

I couldn't find it anywhere in the strings. I have scanned Layouts and Layouts Genesis integration plugin via WPML Themes and Plugins Localization, but no hits.

5.
Please see attached screenshot '4_Genesis_footer_layout_settings.png'
In the layout for header and footer, in the settings for the Genesis Footer Layout Integration you can see the two text content boxes I need help translating.

Since both of them will be custom text, I assumed that they wouldn't appear in the default strings and as such I would need to wrap the text in [wpml-string]'s

You can see in this screenshot the text fields with the strings wrapping the text I need to translate, code as such:

For custom credits text field:

WhyWhyArt ©[wpml-string context='whywhyart']2017 | All Rights Reserved[/wpml-string] 

For Back to Top link text field:

[wpml-string context='whywhyart']Return to Top[/wpml-string]

However when I do this, I don't get any strings to translate in the WPML string translations. At one point, with the custom credits text field, I got it to translate my initial test, but not since.

6.
Please see attached screenshot '5_return_to_top_footer_with_wpml_string.png'
Here you can see that the back to top link text field shows a duplicate of the text and cut off string, as follows:

Return to top of pageReturn to Top[/wpml-string]"]

Am I missing something, is there a straightforward way to translate these Genesis Layouts Footer settings text fields?

I am going to upload the install to a testing site, incase you want to have a better look.

Best

Jeff

#511665
Screen Shot 2017-04-10 at 3.06.08 PM.png
5 - Return to top footer with wpml string..png

Hey... I should leave it until I get some feedback from you, but I kept fiddling.

I mentioned initially that the top settings field - the credits custom text - occasionally worked. But with no pattern I could ascertain. I now have it translating the text that I want. The string appeared for translation and it's working. But I am fearful of making any change, as I am fairly certain it would only work intermittently, if I make a change I bet it would be back to square one.

In the back to top credit settings field - If I use the default text, it appears in English no matter the site language. If I try to wrap it in a string I get one of the two screenshots attached. A replication of English or Chinese + English.

I just need to be able to wrap whatever is put in those two fields in a [wpml-string] so I can easily translate the footer text and the back to top link text.

#511696

I uploaded from local to a test site:

hidden link

You can see the problem with the return to top link there, I'll give you admin to have a looksee in the header and footer layouts admin etc.

Nice one

Jeff

p.s apologies for my murdering 汉语/中文 ;)

#511928

Since it is a compatibility problem: WPML + Layouts + Genesis theme, please provide a copy of your website, we prefer to a simplest installation with same problem, I need to duplicate same problem and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#512115

In the meantime, since this is the only translation problem I need fixing before live. I will just replace that text with an arrow symbol. It will suffice for now.

Look forward to finding out how to translate those fields though.

#512444

Thanks for the details, I am downloading the files, will feedback if there is anything found

#512510
Genesis-Footer.JPG

Here is what I found, the "Genesis Footer" cell does not support to use WPML shortcodes directly [wpml-string], and there is a workaround, you can use a content template to replace it, for example:
1) Create a content template "all-rights-reserved", with below codes:

WhyWhyArt ©[wpml-string context='whywhyart']2017 | All Rights Reserved[/wpml-string] <div class="theme-integration-footer-backtotop theme-integration-footer-backtotop-fixed button"><a href="#wrap" rel="nofollow">[wpml-string context='whywhyart']Return to top of page[/wpml-string]</a></div>

2) Modify the parent layout "Layout for Header and Footer", Edit the "Genesis Footer" cell,
a) option "Credits:", use "Custom text", fill with Views shortcode:
[wpv-post-body view_template="all-rights-reserved"]
b) option "Back To Top Link", choose "no link"
see screenshot Genesis-Footer.JPG

3) Then translate those strings in Dashboard-> WPML-> String translation

#512753

Cheers Luo, works a treat. Great support thanks.

Jeff

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.