=== TeknoTok AI Translator ===
Contributors: teknotok, teknotoksoft
Tags: translate, translation, multilingual, woocommerce, ai
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.56
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Translate your WordPress website into a multilingual site with one click using artificial intelligence.

== Description ==

TeknoTok AI Translator is a lightweight, high-performance plugin that uses advanced Artificial Intelligence to translate your WordPress pages, posts, menus, categories, and tags automatically in the background.

Unlike traditional translation plugins that bloat your pages and slow down your server, TeknoTok AI Translator processes translations asynchronously in small batches and caches the results in a local translation memory database table. This ensures maximum page load speeds, reduced server resource usage, and significant token cost savings.

This plugin connects to the secure **TeknoTok Translation Gateway** (https://soft.teknotok.com), the official TeknoTok API for processing translation requests and returning natural-sounding translations tailored to your target locale.

### Key Features:
* **One-Click Setup:** Automatically detects your site's default language and guides you through configuring target languages.
* **Background Queue:** No timeouts or browser freezes! Translations are processed in background tasks using WordPress Action Scheduler or WP Cron.
* **Translation Memory:** Saves translated content segments locally. If content doesn't change, the plugin never calls the API again, keeping your translation costs low.
* **Elegant Language Switcher:** Display a floating switcher in the bottom-right or bottom-left of the page, hook it into your header/footer, or insert it anywhere via the `[teknotok_language_switcher]` shortcode.
* **Browser Language Detection:** Offers a polite suggestion banner or redirect option if a visitor's browser language matches one of your translated languages.
* **Full WooCommerce & SEO Support:** Seamlessly translates WooCommerce products, attributes, cart pages, and checkout flows, and integrates with popular SEO plugins (Yoast, Rank Math, SEOPress) out-of-the-box.
* **TeknoTok Support:** Visit our website for more WordPress, WooCommerce, and AI solutions, or contact us about a custom project.

### Third-Party Service Disclosure
This plugin relies on the **TeknoTok Translation Gateway** (https://soft.teknotok.com) to process translations. 
* **Terms of Service:** https://soft.teknotok.com/terms/
* **Privacy Policy:** https://soft.teknotok.com/privacy/
* **Free Quota:** The plugin provides a free translation quota upon activation. If you exceed this quota, you can purchase a Pro license key at soft.teknotok.com with 1000,000 AI translated words per year.

### License, Support, and Custom Projects
* **Get License Key:** https://soft.teknotok.com/teknotok-translator-pro/
* **Website:** https://soft.teknotok.com/
* **Email:** teknotok@teknotok.com

Contact TeknoTok Soft if you need a custom WordPress plugin, WooCommerce automation, AI integration, multilingual setup, or a private project built for your business.

== Installation ==

1. Upload the entire `teknotok-ai-translator` directory to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Access the 'AI Translator' menu in your WordPress dashboard to run the setup wizard and select your target language.

== Frequently Asked Questions ==

= Does this plugin translate WooCommerce products? =
Yes, WooCommerce product, attributes, cart parameters, and checkout page translation is fully supported and enabled out-of-the-box while preserving stock/pricing states.

= How do I get a Pro license key? =
Open AI Translator > License Settings in your WordPress dashboard and click "Get License Key", or visit https://soft.teknotok.com/teknotok-translator-pro/.

= Do I need an OpenAI API key? =
No. The current customer setup path uses the TeknoTok Translation Gateway and does not require you to enter an OpenAI API key.

= How can I contact TeknoTok Soft? =
You can visit https://soft.teknotok.com/ or email teknotok@teknotok.com for support, premium questions, or custom WordPress, WooCommerce, and AI project requests.

= Where are my translations stored? =
Translations are stored in a custom local database table (`wp_teknotok_translations`). This means they are served instantly from your own database on page loads without any external API latency.

= What languages are supported? =
TeknoTok AI Translator supports 100+ languages through the TeknoTok Translation Gateway. Available target languages are shown in the plugin settings and may vary by license, quota, and gateway configuration.

= Will this slow down my website? =
No. All translation jobs are sent to a background worker queue, meaning page editing and visitor browsing are never blocked. The front-end switcher is styled with vanilla CSS and is optimized for performance.

== Screenshots ==

1. Setup Wizard with target language selection.
2. Main Settings dashboard and language switcher controls.
3. Floating language switcher design preview on the frontend.
4. Language switcher search field in RTL (Arabic) mode.
5. The Advanced design controls in Settings.
6. Diagnostics and system status screen.
7. Language translation dashboard with multiple target options.
8. Frontend language switcher on a product page.
9. Checkout and WooCommerce translation status view.

== Changelog ==

= 1.1.56 =
* Fixed the frontend language switcher search field so its placeholder follows the active visitor language, including RTL direction for Arabic and other right-to-left languages.
* Fixed theme-applied borders and external accent rings around the floating language switcher.

= 1.1.55 =
* Saves language switcher design changes from the admin screen without starting translation.

= 1.1.54 =
* Improves the language switcher designer preview with real flags and adds a save-only settings button for design changes.

= 1.1.53 =
* Adds customer-configurable language switcher design presets, colors, opacity, shape, border size, and flag visibility controls.

= 1.1.52 =
* Adds a Pro-only setting to hide the switcher attribution and makes the free attribution a smaller single-line link.

= 1.1.51 =
* Redirects stale removed-language 404 URLs to the clean source-language URL, preserving indexed links without serving deleted translations.

= 1.1.50 =
* Keeps local/staging `TEKNOTOK-TEST-*` license translations clean by no longer exposing `[MOCK xx]` prefixes to visitors.

= 1.1.49 =
* Deletes saved translation memory for a target language when that language is removed from Settings, and cancels unfinished jobs for that language.

= 1.1.48 =
* Fixed a fatal error on translated pages caused by recursive URL checks while localizing internal links.

= 1.1.47 =
* Fixed translated post and page content so same-site internal links keep the active language prefix, while external links and WordPress internal endpoints remain unchanged.

= 1.1.46 =
* Fixed language-prefixed paginated blog archive requests for static posts pages, preventing newly added language URLs such as `/ms/blog/page/2/` from hitting the wrong WordPress query path.

= 1.1.45 =
* Added queue controls to cancel jobs for removed languages and reset unfinished waiting jobs without deleting completed translation memory.
* Automatically cancels unfinished jobs when a target language is removed from Settings, preventing removed languages from continuing to consume queue work.
* Improved frontend warmup handling so failed warmup jobs remain retryable without blocking unrelated translation jobs.

= 1.1.34 =
* Improved admin language selection, translation memory editing, diagnostics, and license screens so large language lists and responsive layouts are easier to use.
* Improved the frontend language switcher with priority-sorted languages, keyboard accessibility, mobile-safe dropdown sizing, and a clearer "Powered by TeknoTok" referral link.
* Fixed frontend switcher interactions on themes that do not expose jQuery globally.

= 1.1.33 =
* Fixed localized frontend rendering so saved block post content translations are used even when WordPress changes the rendered content string.
* Fixed WooCommerce product short and long descriptions in product getters and Store API product responses by reading the saved raw product field translations.
* Replaces cached post/product body fields inside localized HTML and embedded WooCommerce block JSON before output.

= 1.1.32 =
* Fixed queue processing so post, product, taxonomy, and warmup jobs run before the next string batch instead of staying pending behind shared strings.
* Queued taxonomy terms and common WooCommerce product-page labels during target-language warmup.
* Automatically hides the setup wizard once at least one valid target language is configured.
* Added a quota endpoint compatibility fallback for free users when the license server still needs the License Manager update.

= 1.1.31 =
* Added support for TeknoTok License Manager quota fields and the new quota endpoint.
* Updated license screens to show Free and Pro word usage instead of unlimited wording.
* Improved quota-exceeded messages so existing translations continue to be described as available while new translations pause.

= 1.1.30 =
* Repaired already-cached translated HTML so inline links regain missing spaces next to surrounding words.

= 1.1.29 =
* Fixed missing spaces around inline links and other inline elements after translated text is inserted into HTML.

= 1.1.28 =
* Fixed WooCommerce Blocks cart and checkout display translations so dynamic block updates remain translated without touching commerce data.
* Fixed empty translation memory rows so they no longer block fresh translation jobs.
* Queued shared frontend strings once after plugin upgrades so common checkout, header, footer, and theme labels can be translated for configured target languages.

= 1.1.24 =
* Fixed language switcher URLs on the homepage and other frontend pages when a static front page and static posts page are configured.
* Built switcher URLs from the actual browser request path instead of WordPress's posts-page query context.
