=== Next Translate – Multilingual Content & Media ===
Contributors: themedev
Tags: translation, multilingual, gutenberg, media, cache
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create multilingual WordPress posts and pages, correct translations in Gutenberg, replace media per language, and cache translated HTML files.

== Description ==

Next Translate creates language-prefixed versions of WordPress posts and pages while keeping the original page path. It supports automatic translation through TranslateX or Google Cloud Translation and provides a Gutenberg editing workflow for human corrections.

Each translated post or page is stored as a linked WordPress translation record. This means corrections are saved in the WordPress database and are not lost when HTML cache files are cleared.

= Gutenberg translation workflow =

* Open an existing post or page.
* Use the Next Translate panel to create a language version.
* Next Translate generates the initial title, excerpt, and block content with the selected translation API.
* Edit the translated blocks with Gutenberg.
* Choose a translated featured image or replace images inside translated blocks.
* Save or review the translation.
* Next Translate updates the language content snapshot and clears the rendered page cache.

= Translation statuses =

* Automatic: generated by the selected translation API.
* Edited: changed by a WordPress editor in Gutenberg.
* Reviewed: manually checked and approved.
* Needs update: the original post or page changed after the translation was created or reviewed.

= Main features =

* Gutenberg-editable translations for WordPress posts and pages
* TranslateX API support
* Google Cloud Translation Basic v2 support
* Automatic, Edited, Reviewed, and Needs update statuses
* Translation revisions through the WordPress revisions system
* Language-specific featured images
* Language-specific images, galleries, videos, and files inside Gutenberg content
* Same-page language URLs such as /de/blog/example-post/
* Automatic header language switcher
* Arabic and other RTL language support
* Hreflang and canonical URL output
* Persistent translated content snapshots
* Persistent rendered-page HTML cache
* Optional WordPress object-cache layer
* Cache lifetime and stale-cache fallback settings
* Clear all, clear expired, and individual page-cache deletion
* Configurable daily automatic translation limit, set to 10 by default
* No frontend JavaScript required for page translation
* No WordPress transients used for translated HTML

= File storage =

Gutenberg translation content is exported immediately to:

`wp-content/cache/next-translate/{post-id}_{language}.html`

Example:

`wp-content/cache/next-translate/123_de.html`

Complete rendered page HTML is cached separately at:

`wp-content/cache/next-translate/pages/{post-id}_{language}.html`

The WordPress translation record is the source of truth. Cache files can be deleted and regenerated without deleting manual corrections.

= Supported content =

Version 1.2 supports standard WordPress posts and pages. Automatic page-output translation may also translate other public frontend output, but the Gutenberg translation-record workflow is currently limited to posts and pages.

== Installation ==

1. Upload the plugin ZIP from Plugins > Add New > Upload Plugin.
2. Activate Next Translate.
3. Open Next Translate in the WordPress admin menu.
4. Select TranslateX or Google Translation.
5. Add the API key for the selected provider.
6. Select the target languages and save settings.
7. Go to Settings > Permalinks and click Save Changes if language-prefixed URLs return 404.
8. Edit a post or page and use the Next Translate panel to create a translation.

== Frequently Asked Questions ==

= Can I correct an automatic translation with Gutenberg? =

Yes. Every post and page translation is stored as a Gutenberg-editable WordPress translation record. Edit the title, blocks, excerpt, and featured image, then update the translation.

= Will clearing the cache delete my corrections? =

No. Manual corrections are stored in the WordPress database. The HTML files are generated snapshots and rendered-page caches.

= What happens when the original English content changes? =

Linked translations are marked Needs update and their rendered page caches are cleared. Existing translated content is kept until an editor updates or refreshes it.

= Can each language use different images? =

Yes. Select a different featured image in the translation editor. Images, galleries, videos, and downloadable files inside the translated Gutenberg content can also be replaced independently.

= Where are translated HTML files saved? =

Editable-content snapshots use `wp-content/cache/next-translate/{post-id}_{language}.html`. Complete rendered pages use the `pages` subdirectory.

= Does the plugin use JavaScript to translate the frontend? =

No. Translation and HTML generation happen on the WordPress server. The block editor itself uses WordPress's standard Gutenberg interface.

= Does the plugin use transients for translated pages? =

No. It uses persistent HTML files and can optionally use the WordPress object cache as a faster first layer.

= Do Google or TranslateX require an account? =

Yes. You must obtain and configure an API key from the provider you select. Provider pricing, quotas, and account requirements are controlled by that provider.

== External services ==

Next Translate connects to an external translation provider only when a translation must be generated or refreshed. The active provider is selected by a WordPress administrator.

= TranslateX =

When TranslateX is selected, text extracted from the page, post, title, excerpt, or block content is sent to the TranslateX API together with the configured API key and source and target language codes.

* Service: https://translatex.com/
* API documentation: https://translatex.com/api-documentation
* Terms: https://translatex.com/terms
* Privacy policy: https://translatex.com/privacy-policy

= Google Cloud Translation =

When Google Cloud Translation is selected, text extracted from the page, post, title, excerpt, or block content is sent to the Google Cloud Translation Basic v2 endpoint together with the configured API key and source and target language codes.

* Service documentation: https://cloud.google.com/translate/docs
* Cloud terms: https://cloud.google.com/terms
* Google privacy policy: https://policies.google.com/privacy

Next Translate does not send plugin analytics or telemetry to ThemeDev.

== Changelog ==

= 1.2.0 =
* Added Gutenberg-editable translation records for posts and pages.
* Added Automatic, Edited, Reviewed, and Needs update statuses.
* Added automatic source-change detection.
* Added language-specific featured images and Gutenberg media editing.
* Added translated content snapshots named with the post ID and language code.
* Moved complete rendered page cache files into the pages subdirectory.
* Added translation management filters and status columns.
* Preserved Gutenberg block comments and markup during automatic content translation.
* Added translation revisions and source/translation edit links.

= 1.1.0 =
* Replaced transient translation cache with WordPress object cache plus persistent HTML files.
* Added Google Cloud Translation Basic v2.
* Added provider controls for Google and TranslateX.
* Added a full-width modern administration interface.
* Added cache statistics and management.
* Added a configurable daily limit.

= 1.0.1 =
* Improved language URL request detection.
