doesn’t work with WPML
-
I wonder why, went to WPML -> Settings under
Post Types Translation
enabled theForm Templates (em-form-template)
now the flags of countries do appear like any other post type, but when I try to create a new translation by pressing the plus button under the flag I get this error : WPML didn’t manage to translate this page—–
Update fixed it via:
https://wpml.org/forums/topic/wpml-didnt-manage-to-translate-this-page-49/-
This topic was modified 2 years, 5 months ago by
stevemoretz.
-
This topic was modified 2 years, 5 months ago by
-
Well it still doesn’t work though, I mean
post_content
column of wp_posts is translated successfully but it still showed the original language email.Then I traced your code and you use
_elementor_data
meta key to save your stuff and you don’t even usepost_content
.Here’s the meta value example:
[{"id":"9bh3mgi","elType":"section","settings":{"structure":"30","section_background_image":{"url":"","id":""}},"elements":[{"id":"63c00d0","elType":"column","settings":{"_column_size":33,"_inline_size":31.161},"elements":[{"id":"c3fd4c3","elType":"widget","settings":{"void_email_image":{"id":422,"url":"http:\/\/oscarexchange-local.com\/wp-content\/uploads\/2022\/09\/Group-755.png"},"width":{"unit":"%","size":50,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"0","bottom":"15","left":"20","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-image"}],"isInner":false},{"id":"a74778b","elType":"column","settings":{"_column_size":33,"_inline_size":32.67},"elements":[{"id":"c1cfbcb","elType":"widget","settings":{"title":"01 January 2021","align":"center","title_color":"#1E1E1E","heading_font_size":{"unit":"px","size":10,"sizes":[]},"heading_line_height":{"unit":"px","size":20,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"28","right":"0","bottom":"15","left":"0","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-heading"}],"isInner":false},{"id":"65ae0a7","elType":"column","settings":{"_column_size":33,"_inline_size":35.5},"elements":[{"id":"1405be5","elType":"widget","settings":{"socials_link":[{"social_link":{"url":"https:\/\/facebook.com","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Facebook","_id":"570c390"},{"select_social_media":"twitter","social_link":{"url":"https:\/\/twitter.com","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Twitter","_id":"40a99dc"},{"select_social_media":"linkedin","social_link":{"url":"https:\/\/linkedin.com","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"LinkedIn","_id":"982c3d3"},{"select_social_media":"pinterest","social_link":{"url":"#","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Pinterest","_id":"e41d55c"},{"select_social_media":"youtube","social_link":{"url":"#","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Youtube","_id":"174668e"}],"text_align":"right","size":{"unit":"px","size":24,"sizes":[]},"horizontal_space":{"unit":"px","size":2,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"20","bottom":"15","left":"0","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-social"}],"isInner":false}],"isInner":false},{"id":"xqu9bz4","elType":"section","settings":{"structure":"30","section_background_color":"#FFB66D","section_background_image":{"url":"","id":""}},"elements":[{"id":"8dd9ae7","elType":"column","settings":{"_column_size":33,"_inline_size":null},"elements":[{"id":"59aee31","elType":"widget","settings":{"title":"Business News","title_color":"#000000","heading_font_size":{"unit":"px","size":12,"sizes":[]},"heading_line_height":{"unit":"px","size":22,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"0","bottom":"20","left":"20","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-heading"}],"isInner":false},{"id":"c140f85","elType":"column","settings":{"_column_size":33,"_inline_size":null},"elements":[{"id":"f21e23c","elType":"widget","settings":{"title":"Sport News","align":"center","title_color":"#000000","heading_font_size":{"unit":"px","size":12,"sizes":[]},"heading_line_height":{"unit":"px","size":24,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"0","bottom":"20","left":"0","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-heading"}],"isInner":false},{"id":"4cbda02","elType":"column","settings":{"_column_size":33,"_inline_size":null},"elements":[{"id":"a239081","elType":"widget","settings":{"title":"Business News","align":"right","title_color":"#000000","heading_font_size":{"unit":"px","size":12,"sizes":[]},"heading_line_height":{"unit":"px","size":24,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"20","bottom":"20","left":"0","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-heading"}],"isInner":false}],"isInner":false},{"id":"lz1rxs1","elType":"section","settings":{"section_background_image":{"url":"","id":""}},"elements":[{"id":"bcc6cbc","elType":"column","settings":{"_column_size":100,"_inline_size":null},"elements":[{"id":"85da42f","elType":"widget","settings":{"title":"{{title}}","title_color":"#000000","heading_font_size":{"unit":"px","size":22,"sizes":[]},"heading_line_height":{"unit":"px","size":34,"sizes":[]},"advance_margin":{"unit":"px","top":"30","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"0","right":"0","bottom":"0","left":"20","isLinked":false},"advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-heading"}],"isInner":false}],"isInner":false},{"id":"bouw9kc","elType":"section","settings":{"section_background_image":{"url":"","id":""}},"elements":[{"id":"addd3c4","elType":"column","settings":{"_column_size":100,"_inline_size":null},"elements":[{"id":"a290498","elType":"widget","settings":{"text_editor":"<p>{{content}}<\/p>"},"elements":[],"widgetType":"elemailer-text-editor"},{"id":"91ea0eb","elType":"widget","settings":{"socials_link":[{"social_link":{"url":"https:\/\/facebook.com","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Facebook","_id":"a9e642b"},{"select_social_media":"twitter","social_link":{"url":"https:\/\/twitter.com","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Twitter","_id":"6d5fc25"},{"select_social_media":"instagram","social_link":{"url":"https:\/\/www.instagram.com\/","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Instagrm","_id":"2dbba00"},{"select_social_media":"pinterest","social_link":{"url":"https:\/\/www.pinterest.com\/","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"pinterest","_id":"b89fb98"},{"select_social_media":"youtube","social_link":{"url":"https:\/\/www.youtube.com\/","is_external":true,"nofollow":true,"custom_attributes":""},"social_name":"Youtybe","_id":"519d32d"}],"social_icon_style":"solid\/dark-","text_align":"center","size":{"unit":"px","size":25,"sizes":[]},"advance_margin":{"unit":"px","top":"25","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"0","bottom":"0","left":"0","isLinked":false},"advance_background_color":"#F2F2F2","advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-social"},{"id":"af93f2f","elType":"widget","settings":{"footer_address":"\u00a9 Elemailer. | House No. 08 ( 2nd floor ) | Road No. 2, Jahrul Islam City, Block C, Dhaka","ft_color":"#4A4A4A","ft_font_size":{"unit":"px","size":9,"sizes":[]},"unsbscribe_text":"Email Preferences","manage_sbscription_text":"Privacy Policy","unsubscribe_color":"#4A4A4A","unsubscribe_font_size":{"unit":"px","size":8,"sizes":[]},"advance_margin":{"unit":"px","top":"0","right":"0","bottom":"0","left":"0","isLinked":false},"advance_padding":{"unit":"px","top":"20","right":"0","bottom":"21","left":"0","isLinked":false},"advance_background_color":"#F2F2F2","advance_background_image":{"url":"","id":""}},"elements":[],"widgetType":"elemailer-footer"}],"isInner":false}],"isInner":false}]
You probably need to support it this way:
https://wpml.org/documentation/support/language-configuration-files/#2-1-translating-sub-keys-in-custom-fieldsacf repeater example:
https://wpml.org/forums/topic/xml-config-option-to-translate-repeater-custom-fields/depending on your implementation you’d need something like that, you just need to know under which json keys you put the text parts?
I tried with:
`<wpml-config>
<custom-fields>
<custom-field action=”translate”>_elementor_data</custom-field>
</custom-fields><custom-fields-texts>
<key name=”_elementor_data”>
<key name=”*”>
<key name=”elements”>
<key name=”*”>
<key name=”elements”>
<key name=”*”>
<key name=”settings”>
<key name=”title”/>
</key>
</key>
</key>
</key>
</key>
</key>
</key>
</custom-fields-texts>
</wpml-config>But couldn’t get it working, you need to investigate this with wpml support.
Remember all the huge websites are multilingual, so you wanna become huge too, don’t miss this important feature.
For now I can make different emails templates for different languages it sucks but it’s a workaround.
I can suggest you another way of doing this as well, just get everything translatable (texts) and put them in post_content and put some space between those lines, also you can put {{whatever}} in there and the translation will ignore that, there you can put your id or a delimiter or whatever you need, and upon grabbing the meta value just grab these text parts from post_content and combine it.
Probably this is the best and easiest way.
But still I don’t know how you have implemented this, why post_content is even full do you even use that? do you save the values from there once? if you do you can do the same for all the languages.
Let me know if you need help, I don’t have a lot of time to go through your code though.
-
This reply was modified 2 years, 5 months ago by
stevemoretz.
-
This reply was modified 2 years, 5 months ago by
stevemoretz.
Thanks for your detailed comment. We will look into this and see what can be done.
Hi,
Thank you for providing the details. We will look into this for future improvement. For now, it’s easy enough just to create templates for different languages for use cases.
As for your query regarding post content- we don’t change anything from how Elementor works here actually. Elementor doesn’t use the post content table rather uses the meta field as you have mentioned. But Can you also provide an example why translation would be needed for email and how it would be used in general? ( Workflow )?
Regards,
-
This reply was modified 2 years, 5 months ago by
- The topic ‘doesn’t work with WPML’ is closed to new replies.