Open raykai opened 4 years ago
+1 Support Oxygen for WPML plugin!
I've used WPML on an Oxygen site and it works pretty well, I'd say it's usable. If you rely on translators directly translating in WPML, Oxygen won't work for you.
oxygen_*
meta fields)Translatable - use translation if available or fallback to default language
) Bugfix: See https://github.com/soflyy/oxygen-bugs-and-features/issues/938#issuecomment-629234274?lang=
structure in WPML.Use Oxygen Gutenberg blocks, they can easily be cloned to the other language and edited. Giving you enough power to barely need to translate templates or navigate to the Oxygen builder.
WPML Oxygen CSS Caching support for duplicated pages as there's never a css cache generated for duplicated posts. Oxygen should block the builder from being used on duplicated pages when WPML support ships.
cache.php:297
...
// finally enqueue styles
foreach ($oxygen_vsb_css_files_to_load as $post_id) {
+ $post_id = apply_filters( 'wpml_master_post_from_duplicate', $post_id ) ?: $post_id;
if ( isset($files_meta[$post_id]) && isset($files_meta[$post_id]['success']) ) {
// cache file is present for this post
$url = $files_meta[$post_id]['url'];
$url = add_query_arg("cache", $files_meta[$post_id]['last_save_time'], $url);
$oxygen_vsb_css_styles->add("oxygen-cache-".$post_id, $url);
$oxygen_vsb_css_styles->enqueue(array("oxygen-cache-".$post_id));
}
...
In order to see translated templates when not logged in, modify /component-framework/admin/cpt-template.php
. Please note that this will make the templates publicly_queryable.
...
function ct_add_templates_cpt() {
- if(!oxygen_vsb_current_user_can_access()) {
- return;
- }
$labels = array(
'name' => _x( 'Templates', 'post type general name', 'component-theme' ),
'singular_name' => _x( 'Template', 'post type singular name', 'component-theme' ),
'menu_name' => _x( 'Templates', 'admin menu', 'component-theme' ),
'name_admin_bar' => _x( 'Template', 'add new on admin bar', 'component-theme' ),
'add_new' => _x( 'Add New Template', 'template', 'component-theme' ),
'add_new_item' => __( 'Add New Template', 'component-theme' ),
'new_item' => __( 'New Template', 'component-theme' ),
'edit_item' => __( 'Edit Template', 'component-theme' ),
'view_item' => __( 'View Template', 'component-theme' ),
'all_items' => __( 'Templates', 'component-theme' ),
'search_items' => __( 'Search Templates', 'component-theme' ),
'parent_item_colon' => __( 'Parent Templates:', 'component-theme' ),
'not_found' => __( 'No templates found.', 'component-theme' ),
'not_found_in_trash' => __( 'No templates found in Trash.', 'component-theme' )
);
...
Please make oxygen wpml compatible. Multilingual is so important...
very important!
UpVote, Very important to make oxygen works with WPML plugin.
It is a fundamental connection between one of the best construction kits and the IMHO best maintained Multilanguage building block.
can anyone help with the second language search page results template to pick up the duplicated main template? If I set the priority, then it also picked up in the first language.
Nearly nothings works. I had to duplicate all pages page per page. The management tool sucked totally. Some text fragments are displayed in the translation tool, but not displayed in the frontend.
It sucks!. It is absolutely the worst and most imaginable trashy peace of crappy software. The only thing which works is the Duplicate Page Plugin which the WPML guys have not developed.
But what option is better? I just hate to work with it in the combination with oxygenbuilder. But I have to make the page multilang.
Don't use oxygen with wpml for client or important production sites. I think it is the only option at the moment. If you now find a hacky solution it is not save for the future... I would not use it at the moment.
But I need a way to make it multilang!
Thanks to Kevin from Oxygen I was able to solve my task. To translate a page:
That's easy. I have some mixed Gutenberg/Oxygen Posts You can directly translate Gutenberg Posts with WPML. I have used the classic tool. The new sucks IMHO.
Do so like you would do with Pages
Don't use the duplicate plugin to copy templates as WPML proposes. Again here the adverts of WPML are wrong. That doesn't work at all. Only main and Pages do work this way. But what with 404, Posts, Search etc...?
I lost so much time with it. Here you go how to deal with the template task:
To get elements like fake breadcrumbs or footer elements (and all other individual stuff that brings you freedom to do as you want to) use conditions:
`<?php
/**
Check Language URL */ function check_language_url() {
$url = $_SERVER['REQUEST_URI'];
$language = "deutsch";
if (strpos($url, '/en/') !== false) { $language = "english"; } elseif (strpos($url, '/fr/') !== false) { $language = "french"; }
return $language;
}`
you may go into any one of your Oxygen templates and copy any elements you wish to translate and translate them within the editor
Finally, to set up the condition settings:
Select an element that you would like to show for a language Click the Condition Settings icon Click Set Conditions > Dynamic Data > PHP Function Return Value Enter "check_language_url" into the Function Name (without quotes) Enter the return value of the language you would like to display it for. You will need to set this up for all elements you would like to hide or show based on a language barrier.
That's it! I really can't find the words how I dislike to work with WPML but the job is done. Horrible usability with all pages manually duplicated and edited but it's possible.
Voting for full compatibility ASAP with WPML.
I am from the DIVI ( Bloated) world and am looking forward to have a good page builder like Oxygen compatible with WPML.
For does looking for some help on the subject:
For WPML config file to get some fields into translation:
<wpml-config>
<shortcodes>
<shortcode>
<tag>oxy_rich_text</tag>
</shortcode>
<shortcode>
<tag>ct_link_text</tag>
</shortcode>
<shortcode>
<tag>ct_link_button</tag>
</shortcode>
</shortcodes>
</wpml-config>
IF any body knows how to get the link to translation in any modules with links that would help! Maybe a attribute tag?
Thanks!
+1 for WPML support! Really needed!!!
+1 for WPML support!
+1 for WPML support please!
+1
+1
+1
+1 for WPML. If you are serious enough, we need WPML support! Templates would be a nice starting point.
+1 for WPML support!
Native support without tricks is vert very important.
+1
+1
+1
We really need a solution so we can use WPML's translation Editor instead of using manual translation as a workaround mentioned on https://wpml.org/errata/oxygen-builder-widget-and-link-translation-issues/
Can't get https://wpml.org/forums/topic/oxygen-builder-translation/#post-8600795 to work, but this can't be impossible to solve for the Oxygen/WPML devs.
+1
+1
+1 for WPML support!
+1 for WPML support!
+1! Support Oxygen for WPML plugin!!
+1! that's for sure
Yes, please +1
+1, please
Yess, WPML support for the win!
+1 for fully WPML support!
+1 for WPML support!
+1
🆙Vote, Very important to make oxygen works with WPML plugin.
+1 for WPML support! We are in 2022 - and no WPML fully support. That's a bad joke!
An interesting behavior/bug:
Try this on a staging site, on a translated page:
Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language.
Does the translated version of the page revert back all its content to the default language?
An interesting behavior/bug: Try this on a staging site, on a translated page: Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language. Does the translated version of the page revert back all its content to the default language?
Yes, that's tue. I can confirm also on my side. Just tested on one of my Site, and bug appears.
@madjedo interesting! We had the revert bug on some pages in a big project and could find the reason nor replicate it. But your finding is a valuable hint.
An interesting behavior/bug: Try this on a staging site, on a translated page: Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language. Does the translated version of the page revert back all its content to the default language?
In fact, that bug happens when you change styling by Oxygen (font size, or color on text), on default language - on the page. When you hit Save button after that - translation is lost on the page with additional language. The same bug appears when you change for instance the link on the button - on default language page.
@SinjoriS thats horrible!
+1 WPML support is buggy. I'm at a loss here. For some odd reason the translated template for Single product is correctly picked up only when logged in. When not logged in the default language of the template is always used, even if the content itself is translated (meaning the language is correctly detected). This is a quote from the WPML forums and it shows a major flaw in the coding of Oxygen builder. Instead of relying on standard WordPress mechanisms for hiding the templates from users, it uses some self-baked method, which in turn makes law-abiding plugins unable to properly interact with Oxygen's 'ct_template' objects. I'm sure there is a legit reason for this choice, but obviously it was not a good choice.
Hi,
I am Sumit from 2nd tier support.
The problem is in the Oxygen builder and we are in contact to fix this issue. However, if you pass the info the oxygen support this will help to speed up the process.
Problem ct_template post type registered only for logged-in users in \oxygen\component-framework\admin\cpt-templates.php so when non-logged-in users visit the site WPML does not filter the posts from unregistered post type and first template (from any language) is displayed for all posts.
Oxygen builder should use post capability argument instead of registering the CPT only for logged-in users. Ref hidden link
Workaround Meanwhile, you can use the workaround to make this work with WPML.
1 Manually Edit the translated post
2 Select the correct translated template from the Oxygen widget, not the Default option.
3 Update the post and check on the front-end. Please do this for all translated posts.
Thanks Their workaround does not work for any custom post type that is not using Oxygen for design. Nor does it work on 404, search etc.
@d-packs That workaround is how I translate my products, it works ok except a few quirks.
But interesting he mentions they are in contact with Oxygen team for this. @Spellhammer Are you perhaps in stealth working on a official integration? I know your policy is not too reveal any future work, but this one is important for a lot of businesses and their future direction on using Oxygen builder and WPML, especially for e-commerce sites.
+1. Need this one big time.
Thanks!
An interesting behavior/bug:
Try this on a staging site, on a translated page:
Select an element, Delete all styles from the id, Save page, Repeat, this time on same page, default language.
Does the translated version of the page revert back all its content to the default language?
Regarding this bug, here it is solution (answer) from WPML official support. They asked Oxygen support to check that. I hope somebody from Oxygen team will see this. I also sent them a ticked on their Site.
Open this file: wp-content\plugins\oxygen\component-framework\includes\wpml-support.php around the line 19 you will see the code:
add_filter( 'wpml_pb_shortcodes_save_translation', 'ct_wpml_filter_save_translation', 10, 3 ); function ct_wpml_filter_save_translation( $saved, $translated_post_id, $new_content ) { update_post_meta( $translated_post_id, "ct_builder_shortcodes", $new_content ); return true; }
Please, comment this line of code: //add_filter( 'wpml_pb_shortcodes_save_translation', 'ct_wpml_filter_save_translation', 10, 3 );
+1
Describe the feature you'd like to see included in Oxygen. Support for WPML https://wpml.org plugin would be good to have for Oxygen
What are the use cases for this feature? Language Accessibility
Examples of this feature or functionality. It would allow users to use more than one language on their sites when they build using Oxygen. I live in a country where we need two languages on our sites so having support for WPML is almost a must for us.