Site logo

Archived topic

Translation of new Element Hooks

11 replies · Started by Dani on August 21, 2018

Viewing posts 1–12 of 12

I updated GP with the new elements and followed your migrating guide. All worked fine, but now there is a problem with the translation. I’m not able to get the admin_text strings in the WPML anymore. Luckily I've not migrated the hooks in my bilingual shop yet, just in the other shop, where I currrently only display the main language to customers.

I saw that the new elements is not part of your wpml-config.xml. I already tried generatepress_hooks, elements, generate_elements and generatepress_elements, but it’s not working. I must be missing something. The admin_text string cannot be found. Can you please help?

Hi Tom,
unfortunately not working. When I create a translation of the hook as I would with any other custom post, it shows both languages on entire site.
For example I created a hook before footer that is supposed to show in the entire site:
German:

<i class="fa fa-euro fa-lg" aria-hidden="true"></i> Bequeme Zahlung</br>
Kreditkarte, PayPal, Vorkasse uvm</br><p></p>
<i class="fa fa-lock fa-lg" aria-hidden="true"></i> Sicherer Einkauf</br>
100% ssl verschlüsselt</br><p></p>
<i class="fa fa-clock-o fa-lg" aria-hidden="true"></i> Schnelle Lieferung</br>
In der Regel 2-5 Tage</br><p></p>
<i class="fa fa-truck fa-lg" aria-hidden="true"></i> Versandkostenfrei</br>
Innerhalb Deutschland ab 50 €</br><p></p>

English:

<i class="fa fa-truck fa-lg" aria-hidden="true"></i> Free Delivery</br>
Orders over 50 € within Germany</br><p></p>
<i class="fa fa-clock-o fa-lg" aria-hidden="true"></i> Fast Delivery</br>
International orders 2-10 days</br><p></p>
<i class="fa fa-lock fa-lg" aria-hidden="true"></i> Secure Shopping</br>
100% ssl connection</br><p></p>
<i class="fa fa-euro fa-lg" aria-hidden="true"></i> Comfortable Payment</br>
Credit card, PayPal, SEPA etc.</br><p></p>

If I then go to the website, I see the hook showing in both languages. :(

Same with this after content hook:
German:
<?php if ( is_product () || is_cart() || is_checkout ()) : ?><p style="text-align:right; color:#333333; font-size:0.9em; padding:10px 0 0 0"> *Gilt für Standardversand innerhalb Deutschland. Bei Expressversand gilt 1 Werktag. Lieferzeiten für EU Länder findest du hier: Versand</p><?php endif; ?>

English:
<?php if ( is_product () || is_cart() || is_checkout ()) : ?><p style="text-align:right; color:#333333; font-size:0.9em;"padding:10px 0 0 0"> *Applies to int. shipping to EU countries. Delivery times for Germany can be found here: Shipping </p><?php endif; ?>

I copied the codes from the old GP hooks I used

Maybe it has to do with the display rule?

Strange - I would have to know more about how WPML decides which one to display. It may be worth asking them - I'd be happy to work with them to make sure Elements is compatible.

I just did a back-up and I'll leave the old GP hooks for now, which are working perfect for me. Yes, WPML is very helpful and they might have a solution, but I'm really a bit too busy at the moment. :( If I contact WPML that means creating a staging site again, delete all customers from database (GDPR) give them logins, many emails back and forth... As soon as I find more time, I'll contact WPML. I'll let you know if there's a solution.

Thanks! We'll try to get it tested ASAP as well.

Awesome, thank you! I'll keep an eye on that topic, and hopefully they know they can reach out to me at any time :)

Hi Tom,

you might already know this if you followed my post on WPML, but I thought just in case you didn't, they found a fix :)

https://gist.github.com/srdjan-jcc/00ee8d15afb3c6c1497af5ff92d32a8e

I still had some difficulties, but I assume it was because I didn't deaktivate GP hooks. Now it seems to work.

Have a good Sunday!

Awesome! Thanks so much for letting me know :)

This archived topic is closed to new replies.