• ResolvedPlugin Author malaiac

    (@malaiac)


    This is regarding recent topics about Gutenberg and blocks.
    From @tidus457 @userphpgerm1 @nahuai

    A few facts :
    – The DeepL translation API (used by this plugin) handles complex HTML content pretty well and returns proper WP blocks. This is good news.
    – The Gutenberg Javascript API (also used by this plugin to get and update strings) is a mess. I wish it wasn’t.

    I’ve asked before ( https://ww.wp.xz.cn/support/topic/getting-and-modifying-gutenberg-post-content-with-javascript/ ) and more recently ( https://github.com/WordPress/gutenberg/issues/28488 ) for a simple way to update post_content within Gutenberg editor with no answer.

    Right now, I’m getting the translated post content from the API, splitting it in JS into more-or-less paragraphs and inserting paragraphs. That’s why you get a paragraph tags soup.

    Current solution : disable Gutenberg. Even the code editor view has no clear method to update post_content.

    Precision : the (paid) batch translation extension of this plugin works well, by fetching and updating the content directly from and into the database. It sends raw content to DeepL and get properly translated content and update the database.
    However, I’m not happy with this situation and do NOT want to push a paid extension to have this plugin working with Gutenberg.
    So my goal is to get this plugin able to work within Gutenberg without the need to purchase anything (which is not free for other reasons, eg the ability to translate multiple posts in batches)

    I’m actively working on this problem.

    • This topic was modified 5 years, 4 months ago by malaiac.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author malaiac

    (@malaiac)

    Addendum : there is one way to solve this problem. That would be forcing the post to be saved, then sending the user to a page like /wp-admin/post.php?post=66&action=translation which would fetch the post from the database, send it to DeepL for translation, get the translated strings back, updating the post in the database and redirecting to /wp-admin/post.php?post=66&action=edit hoping that all goes well.

    That seems simple but could lead to other issues (eg unsaved field modifications could be lost, silent errors from DeepL, etc.)

    I’m considering this solution. In the absence of a better one, I will code and launch it early February. And curse Gutenberg all the way to a special kind of h**l

    • This reply was modified 5 years, 4 months ago by malaiac.
    • This reply was modified 5 years, 4 months ago by malaiac.
    • This reply was modified 5 years, 4 months ago by malaiac.

    Hello,

    Just to make it clear: in my case, I wasn’t using Gutenberg, but classic editor (I hate Gutenberg editor, in shouldn’t be integrated in WordPress by default IMHO).

    Is what you are implementing for Gutenberg creating the issues?

    Plugin Author malaiac

    (@malaiac)

    The 1.5.5 update changes the way the content is inserted.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Regarding Gutenberg and blocks’ is closed to new replies.