=== Brande Simple Translation ===
Contributors: brandewp
Tags: translation, multilingual, language switcher, languages, hreflang
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A lightweight WordPress translation plugin for Pages and Posts with clean language URLs and a simple language switcher.

== Description ==

Brande Simple Translation adds a clean Translations menu to the WordPress admin area and provides an SEO-friendly language URL structure.

Features:

* Separate Page translations and Post translations screens that work independently of the active content editor.
* Translations > Languages settings page.
* Translate shortcuts on the normal WordPress Pages and Posts lists.
* Translation panel on Page and Post edit screens.
* Translates visible Page and Post text only; the original layout, backgrounds, images, blocks, buttons, spacing and styling remain untouched.
* Reads text from the rendered Page or Post in the browser, with a saved-content fallback when a preview cannot be read.
* Server-side text replacement preserves SEO-visible translated text, with a small browser-side fallback for dynamically rendered text.
* Page and Post translations automatically appear on the matching language URL, with fallback to the default-language text when a translation is empty.
* Add language codes such as et, en, ru or en-gb.
* The first configured language is the default language and uses the normal site URL.
* Additional languages use clean subdirectory URLs such as /en/ and /ru/.
* Automatic frontend language switcher using the standard WordPress `wp_body_open` hook.
* Manual language switcher shortcode: `[brande_language_switcher]`.
* Compact language-prefixed rewrite rules for WordPress Pages and Posts.
* Automatic hreflang and x-default tags only for language versions that actually contain a saved translation.
* Language-aware canonical URLs for translated Pages and Posts, including compatibility filters for Yoast SEO, Rank Math and All in One SEO.
* The HTML lang attribute follows the active translated Page or Post language and safely falls back to the default language when a translation is missing.
* Old ?lang=en links are permanently redirected to the clean /en/ structure.
* No external services, tracking or third-party dependencies.
* Lightweight and developer-friendly.
* Unicode-aware visible-text detection for Latin, Cyrillic, Arabic, Hebrew, CJK and other writing systems.
* Configuration warnings for Plain permalinks, conflicting language-code Page or Post slugs and default-language changes.

Example with `et` as the first language:

* `https://example.com/` - Estonian homepage.
* `https://example.com/contact/` - Estonian page.
* `https://example.com/en/` - English homepage.
* `https://example.com/en/contact/` - English page.
* `https://example.com/ru/contact/` - Russian page.
* `https://example.com/blog-post/` - Default-language blog post.
* `https://example.com/en/blog-post/` - English blog post.

Permalinks must use any structure except "Plain" (?p=123), because the Plain structure does not support language subdirectory URLs such as /en/ or /ru/.

== Installation ==

1. Upload the `brande-simple-translation` folder to `/wp-content/plugins/` or install the ZIP file through Plugins > Add New > Upload Plugin.
2. Activate Brande Simple Translation.
3. Under Settings > Permalinks, use any permalink structure except Plain (?p=123).
4. Go to Translations > Languages.
5. Enter one language code per line and save the settings.

Saving the language settings automatically refreshes WordPress rewrite rules.

== Frequently Asked Questions ==

= Does this plugin use an external translation service? =

No. The plugin does not connect to external services.

= How are language URLs structured? =

The first configured language is the default language and has no URL prefix. Every additional language uses its language code as a clean URL prefix.

For example, if the configured languages are `et`, `en`, and `ru`, the URLs are `/`, `/en/`, and `/ru/`.

= What happens to old ?lang=en URLs? =

Valid old query-parameter language URLs are permanently redirected to their clean language-prefixed equivalent.

= Does the plugin add hreflang tags? =

Yes. It outputs alternate hreflang links only for the default content and secondary language versions that actually contain saved translations, plus an x-default link to the default-language content.

= Does it support posts, products or taxonomies? =

Brande Simple Translation translates standard WordPress Pages and Posts. Products, custom post types and taxonomies are not translated in the free version.

= Does it support SEO plugins? =

The plugin includes canonical URL filters for Yoast SEO, Rank Math and All in One SEO. Core WordPress canonical output is left intact and made language-aware for translated Pages and Posts.

= Where does the language switcher appear? =

It is rendered near the top of the page using the standard WordPress `wp_body_open` hook.

= Can I place the language switcher manually? =

Yes. Use `[brande_language_switcher]` in a Shortcode, Text or HTML area.

= What happens to my translations if I delete the plugin? =

Language settings and saved Page and Post translations are preserved in the WordPress database so they are available again after reinstalling the plugin. The uninstaller removes only Brande Simple Translation's internal runtime/version options and does not scan or modify data owned by WordPress, themes or other plugins.

= What language code format can I use? =

Standard short codes such as `et`, `en`, `ru`, and regional codes such as `en-gb` are supported.

== Changelog ==

= 1.0.0 =
* Initial public release.
