=== alinio ===
Contributors: gentlesource
Tags: translation, translate, multilingual, language switcher, machine translation
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Translate the website into many languages with the alinio widget.

== Description ==

Adds the alinio translation widget to all pages of the website. The widget translates the content and shows a language switcher.

For privacy the widget can be loaded only after a visitor chooses a language, optionally after a notice about the external service (setting "Load on request").

The plugin needs an account at the alinio translation service, see External services below.

Content marked with translate="no" or the class notranslate stays untranslated.

Settings:

* Enable alinio: Adds the widget script to the head of every frontend page.
* Load on request: "Off" loads the widget on every page. "Load on click" shows the language switcher with the website's languages and loads the widget only when a visitor chooses a language there, clicks an element with data-alinio-lang or opens a link with ?alinio_lang=. After that the widget is loaded on every page for this visitor until the original language is chosen again. "Load on click and confirmation" first shows a notice that the external service alinio is used, and loads the widget only when the visitor agrees. Browser language detection in the alinio dashboard only applies once the widget is loaded.
* Personal pages: No widget for logged-in users and on the WooCommerce cart, checkout and account pages. These pages can show names, addresses and orders. Developers can mark other pages with the filter alinio_personal_page, e.g. `add_filter('alinio_personal_page', fn ($personal) => $personal || is_page('members'));`.
* Site Key: The data-key from the alinio dashboard snippet. Without a site key no widget is added. When the settings are saved, the website's languages are loaded from alinio and listed below the key. Save the settings again after changing the languages in the alinio dashboard.
* Language Switcher: Where the language switcher appears (bottom right, bottom left, top right, top left, inline or none). Leave it at "Setting of the alinio dashboard" to use the position configured there. Inline shows the switcher above the content, None hides it.
* Container: Optional CSS selector, e.g. #language. The language switcher is shown inside this element instead of floating.

The inline language switcher is placed at the top of the page with the wp_body_open hook. Themes that do not call wp_body_open can use the Container setting instead.

The admin bar is marked translate="no".

The plugin adds a suggested text for the website's privacy policy to the Privacy Policy Guide under Settings / Privacy. It links the alinio website and its privacy policy (alinio.de for a German user interface).

== Installation ==

1. Install the plugin under Plugins / Add New Plugin (search for "alinio") and activate it.
2. Add the website in the alinio dashboard and list all its domains under "Allowed domains".
3. Enter the site key under Settings / alinio and enable the plugin.

== Frequently Asked Questions ==

= Can the widget be loaded only after the visitor's consent? =

Yes. Under Settings / alinio set "Load on request" to "Load on click and confirmation".

== Screenshots ==

1. Settings / alinio with the site key and the website's languages.
2. Language switcher before the widget is loaded ("Load on click").
3. Notice about the external service ("Load on click and confirmation").
4. Suggested text in the Privacy Policy Guide.

== External services ==

This plugin connects the website to the alinio translation service (https://alinio.app). The service translates the website content and provides the language switcher. Nothing is loaded from alinio until the plugin is enabled and a site key is entered under Settings / alinio.

When the settings are saved, the web server loads the website's languages and switcher position from https://alinio.app/api/v1/sites/ (identified by the site key). No visitor data is sent.

When the plugin is enabled, every visitor's browser:

* loads the widget script from https://alinio.app/widget.js on every frontend page (with "Load on request" only after the visitor has chosen a language, and confirmed the notice if set),
* loads the website's language settings from alinio.app, identified by the site key,
* sends the text of the page, the page path and the language to alinio.app when the page is shown in another language (chosen by the visitor, or detected from the browser language if this is enabled in the alinio dashboard), and receives the translations.

With every request alinio.app receives the IP address, the user agent and the requested URL. The alinio servers keep this technical data only for a short time. The widget script is loaded without cookies and without the page address as referrer. The widget sets no cookies. The chosen language and the received translations are stored in the visitor's browser (local storage).

* Terms of service: https://alinio.app/terms
* Privacy policy: https://alinio.app/privacy

== Changelog ==

= 1.2.0 =

* "Load on request" has three options: off, load on click, and load on click and confirmation. With confirmation a notice about the external service is shown before the widget is loaded.
* New setting "Personal pages": no widget for logged-in users and on the WooCommerce cart, checkout and account pages, extendable with the filter alinio_personal_page.
* The admin bar is marked translate="no".
* The widget script is loaded without cookies and without referrer, the badge link opens without referrer.
* The settings page shows a note when browser language detection is turned on in the alinio dashboard, and the suggested privacy policy text mentions it.
* The suggested privacy policy text is translatable.

= 1.1.0 =

* New setting "Load on request": the widget is only loaded when a visitor chooses a language.
* The website's languages are loaded from alinio when the settings are saved and shown below the site key.
* The inline slot is also added if the position "Inline" is set in the alinio dashboard.

= 1.0.0 =

First version.
