=== Langloom ===
Contributors: simplelang
Tags: translation, multilingual, localization, i18n, language
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.2
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A modern, high-performance localization plugin. Translate your site without duplicate posts, and every language gets its own URL and full SEO support.

== Description ==

Langloom translates a WordPress site without creating duplicate posts. Translations live in dedicated database tables and are swapped in at request time via WordPress filters, so your post count stays clean and your database stays lean.

**Key features:**

* **No duplicate posts:** translations are stored in two custom tables, not as post copies
* **Clean URLs:** each language gets its own slug (e.g. `/fr/about/`) with proper `hreflang` and canonical tags
* **Visual translation editor:** click any text on the front-end to translate it inline, no Gutenberg required
* **AI translation:** one-click AI-assisted draft translations (requires an API key)
* **Full SEO support:** translated `<title>`, Open Graph tags, `<html lang>`, and XML sitemaps
* **Form element support:** placeholders, button labels, and select options are automatically detected and translatable
* **Query-string mode:** optional `?lang=fr_FR` routing for setups that can't use subdirectories
* **WordPress 6.5+ native:** uses `WP_HTML_Tag_Processor`; zero third-party dependencies

**Free vs Pro**

Langloom is fully functional for one additional language. The visual editor, AI translation, and the complete SEO stack (hreflang, canonical, sitemaps, translated title, meta description and Open Graph) are all included, with no metered character limits and no feature locked behind a paywall.

If you need more than one additional language, Langloom Pro is a separate add-on that raises that limit. It is not required for anything else, and the plugin is fully usable without it.

== Installation ==

1. Upload the `langloom-translation-manager` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Settings → Langloom** to enable languages and configure routing.
4. Visit any page on the front-end. The **Translate** button appears in the admin bar.

== Frequently Asked Questions ==

= Does this create extra posts for each language? =

No. Translations are stored in two custom database tables (`langloom_translations` for post fields, `langloom_strings` for everything else). Your post count is unchanged.

= Which URL structures are supported? =

Two modes: **subdirectory** (e.g. `/fr/about/`) and **query string** (e.g. `/about/?lang=fr_FR`). Subdirectory mode is recommended for SEO.

= Does it work with page builders and custom themes? =

Yes. The visual editor scans the live DOM, so it works with any theme or page builder that renders content to the browser. Form elements (placeholders, submit buttons, select options) are detected automatically via PHP output buffering.

= Can I translate custom post types? =

Yes. Any singular post type that WordPress treats as a `WP_Post` is supported.

= How many languages can I add for free? =

Your site's default language plus one additional language. Every other feature (the visual editor, AI translation, hreflang, sitemaps, and translated meta description / Open Graph tags) is included with no limits. If you need more languages, Langloom Pro is a separate add-on that raises the cap.

= Is the AI translation feature required? =

No. AI translation is an optional feature. The visual editor and all core translation functionality work without it.

== External services ==

Langloom works fully offline by default and does not contact any external service during normal site operation. No data is ever sent about your site's visitors.

The plugin can optionally connect to a third-party machine-translation service **only** to power the "AI translation" feature, and **only** when you have explicitly enabled it. To use it you must turn on AI Translation in **Settings → Langloom**, choose a provider, and paste your own API key. Nothing is sent until an administrator clicks **Translate** on a piece of content in the editor. Each request sends the text you chose to translate together with the source and target language codes and your API key. Your visitors never trigger these requests.

You can use either of the following providers:

**DeepL API**
Used to generate machine-translation suggestions for the text you are editing.
What is sent, and when: the selected text plus source/target language codes and your DeepL API key, sent only when an administrator clicks Translate with DeepL selected as the provider. Requests go to `https://api-free.deepl.com` (free keys) or `https://api.deepl.com` (paid keys).
Terms of Use: https://www.deepl.com/en/pro-license
Privacy Policy: https://www.deepl.com/en/privacy

**Google Gemini API**
Used to generate machine-translation suggestions for the text you are editing (works well for Asian and right-to-left languages).
What is sent, and when: the selected text plus source/target language codes and your Google API key, sent only when an administrator clicks Translate with Gemini selected as the provider. Requests go to `https://generativelanguage.googleapis.com`.
Terms of Use: https://ai.google.dev/gemini-api/terms
Privacy Policy: https://policies.google.com/privacy

== Privacy Policy ==

Langloom does not collect, store, or transmit any personal data about your site's visitors. The only outbound network requests are the optional, admin-initiated machine-translation calls described under **External services** above, which are made solely to the provider you configure with your own API key.

== Screenshots ==

1. Translate right on the page: hover any text in the visual editor, type the translation, and save. The side panel tracks progress block by block.
2. The Langloom settings screen in wp-admin, where you enable languages, set URL slugs, and switch on hreflang, canonical tags, translated titles and sitemaps.
3. One post, many languages: clean subdirectory URLs with automatic hreflang, plus a language switcher you can drop into any theme.

== Changelog ==

= 1.0.2 =
* Branding and admin asset refresh.

= 1.0.1 =
* Sitemap is now served dynamically at /langloom-sitemap.xml, so no file is written to the site root.
* Hardened output escaping for translated titles, content, excerpts, widgets, the site title/tagline, and the page <title>.
* Removed unused translation-file generation for a lighter, filesystem-free footprint.

= 1.0.0 =
* Initial release.
