WAIT: Translations removed from qTranslate-XT translations shortcode after editing page

Browser: DuckDuckGo Browser Version 1.38.2 (24)
OS: OS X 10.15.7
Bricks Version: 1.9.9

I am using a plugin for translation called qTranslate-XT. The way I have been translating text in Bricks is
coding the translation as so

[:en]English Text[:ja]Japanese Text[:]

I then save the Bricks page and then exit the editor.
Afterwards, I view the page on the front end. I look at both the English and Japanese versions and it renders each perfectly. Viewing the english site shows…

“English Text”
… and then switching to Japanese shows …
“Japanese Text”

…which is the expected behavior.

What is not expected is when I want to make an edit to the page. When I re-open the Bricks editor after it was fully closed, it loads up the bricks editor as normal. Once the editor has loaded, the content of the website is shown on the editor screen. Once this occurs, the translated text fields now have been stripped of the english text and any of the shortcode tags. The text…

[:en]English Text[:ja]Japanese Text[:]

… now becomes …

Japanese Text

This is not expected behavior.

The expected behavior is that the original string of …
[:en]English Text[:ja]Japanese Text[:]

… is kept as the content inside of the bricks component.

If I do not make any edits to the page and I click the save button, viewing the page on the front end shows …

“Japanese Text”

… on both the english version and the Japanese version.

If I place a shortcode block in the Bricks editor and place the same text in it, the shortcode component block also has this issue so it has nothing to do with using shortcode tags outside of a shortcode component block.

It should be noted that in the wordpress admin page when I am setting the title of the page, if I use the same string …

[:en]English Text[:ja]Japanese Text[:]

…as the tile of the page, it does not get transformed in any form. This is expected behavior. This indicates that the issue is a Bricks related one.

Link to Plugin in question (I am using the latest stable release v3.15.2): GitHub - qtranslate/qtranslate-xt: qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.

Hi @rendev,

thank you for your report. I installed the plugin locally and tested it the way you do, and it happens the way you describe it.

I think it’s because once you refresh the page, qTranslate-XT translates the text on the canvas and then when you change something, that translated text gets saved. I also check what happens in the DB and it’s exactly that. Once I refreshed the page, and I changed something, in the DB, there was only text from one language.

I don’t know the plugin in detail, but if there is a way to exclude a page from being translated, maybe you can try that and exclude it if there is ?bricks=run parameter in the URL. That would probably help.

Otherwise, you can add qTranslate-XT compatibility to the idea board.

Best regards,
M

Thank you for investigating this. I have made a feature request on qTranslate-XT regarding this issue. I have asked them to provide a method to exclude translation from URL’s ending with a certain string. The link to the GitHub issue is here. If the developers say they are not going to implement this feature then I will add it to the idea board. Thanks for your help!

Thank you for reporting back.
Please let us know in any case. :slight_smile:

Best regards,
M

I have found a “band-aid” solution to my issue. I don’t know how to program in PHP but I kinda just guessed what to do and came up with my own solution by editing the code of qtranslate-xt. Again, I never learned PHP but kinda just figured it out so there is a possibility I messed up somewhere but it allows the website to function with bricks compatibility.

I have included a link to the github comment I posted with the code to make the plugin function with bricks.

https://github.com/qtranslate/qtranslate-xt/issues/1412#issuecomment-2392382151

I think we can close this ticket for now seeing as people can use my code to make this plugin work with bricks.