Skip navigation

Эта тема содержит 0 ответов, имеет 1 голос.

Последнее обновление: Sietse 2 месяца, 3 недели назад.

При содействии: Nicolas V..

Автор Записи
4 октября, 2024 на 12:56 пп #16254281

Sietse

Background of the issue:
I would like to target the strings inside a custom HTML email template. A template is being used in GravityForms to override the HTML style of the outgoing email HTML. Here is a snippet of that code, including the strings: Fake Address 101 0011 AB Netherlands T — 030 21 203 54 W — test-domain.com. How do I mark these strings so that I can load them in my WPML editor and translate them? So to be clear, I have a template like this: add_filter( 'gform_html_message_template_pre_send_email', 'notification_template' ); function notification_template( $template ) { $template = '{subject} {message} '; return $template; } And inside the body, I have an email signature that I would like to have translated. I found this documentation: https://wpml.org/documentation/support/enabling-text-translation-for-themes-not-compatible-with-wpml/ but is it as easy as doing this: Here’s how you can make the code ready for translation with WPML by replacing the actual text with placeholder dummy text while ensuring the strings are translation-ready.

Symptoms:
I am struggling with preparing my custom HTML template to be translatable. I can use the {message} field inside GravityForms but want to make it clean without HTML inside that message tab. I also struggle with targeting the right text-domain, as GravityForms generates a text domain for each form.

Questions:
How do I target all the forms (text-domain) without needing to target each form individually with the _1 addition?
How do I prepare my HTML code so it is ready for translation?