• Resolved jcocking

    (@jcocking)


    My WordPress site is the front end of a forum. We have have numerous inline html snippets used throughout the website. The inline html is updated every hour. The challenge is the translations is not catching the updates.

    I use the following block to insert the dynamic text: [inline_html file=”my-filename.php”]
    Sample page: https://lotuselan.net/lotus-elan-series-2/ Look at the Current Discussions in the right sidebar. When you switch between English and French: the French version was cached when the AI translation occurred. The English version is showing in real time.

    Is there a way to flag a dynamic insert not to be cached?
    Is there a way to flag a different inline html file based on desired language? i.e. if lang=ja file=myfile_ja
    Is there a way to flag a dynamic insert to be retranslated on a shorter cache duration than 14 days?

    Thank you

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Gerard Kanters

    (@gkanters)

    Hi,

    Thanks for the clear example — that behaviour is expected with how AI Translate works.

    English is the source language of the site. That version is not served from the translation cache, so WordPress runs [inline_html] on every request and you see the hourly update immediately.

    French (and any other translated language) is a full-page snapshot: the complete HTML, including the sidebar. That snapshot is reused until the cache expires (14 days by default) or the WordPress page itself is updated. Updating a PHP file on disk does not change the WordPress page, so the French sidebar stays frozen at the moment it was translated.

    There is no way to flag a single insert as “don’t cache”, “use another file per language”, or “shorter cache than 14 days”. The plugin caches whole pages, not fragments. A per-block exception would be a custom integration for one shortcode, and skipping cache for the whole page would retranslate the entire page on every visit — slow and expensive.

    The practical approach is to load that dynamic block after the page, for example with JavaScript/AJAX, instead of inserting it into the page HTML. Then it stays live in every language and is not part of the translation cache. Language-specific files (myfile_ja.php, etc.) would also belong in that loader / your shortcode, not in AI Translate.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.