PHPackages                             firewire/fluency - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. firewire/fluency

ActivePw-module[Localization &amp; i18n](/categories/localization)

firewire/fluency
================

The complete translation enhancement suite for ProcessWire

v2.3.0(4mo ago)27753[3 issues](https://github.com/SkyLundy/Fluency/issues)[1 PRs](https://github.com/SkyLundy/Fluency/pulls)GPL-3.0-or-laterPHPPHP &gt;=8.1.0

Since Mar 28Pushed 4mo ago2 watchersCompare

[ Source](https://github.com/SkyLundy/Fluency)[ Packagist](https://packagist.org/packages/firewire/fluency)[ Docs](https://processwire.com/modules/fluency/)[ RSS](/packages/firewire-fluency/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (0)

Fluency - The complete translation enhancement suite for ProcessWire
====================================================================

[](#fluency---the-complete-translation-enhancement-suite-for-processwire)

[![fluency_welcome](https://private-user-images.githubusercontent.com/61801600/292639230-21a9a94d-2f70-4ba7-901f-ac85760d60ae.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2MzkyMzAtMjFhOWE5NGQtMmY3MC00YmE3LTkwMWYtYWM4NTc2MGQ2MGFlLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NjUwMjA1ZTYwZmNhN2ZiMGZjYTM0NDIzMjNiNzgxMjhmYmE2NDJkOGZjNjYzZmUwNDUzYjNiNDVmYTJiZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QUCFUGwvsWRO0wSiemynOotbkUMtf-whLmXa6nnCTQU)](https://private-user-images.githubusercontent.com/61801600/292639230-21a9a94d-2f70-4ba7-901f-ac85760d60ae.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2MzkyMzAtMjFhOWE5NGQtMmY3MC00YmE3LTkwMWYtYWM4NTc2MGQ2MGFlLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI1NjUwMjA1ZTYwZmNhN2ZiMGZjYTM0NDIzMjNiNzgxMjhmYmE2NDJkOGZjNjYzZmUwNDUzYjNiNDVmYTJiZDcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.QUCFUGwvsWRO0wSiemynOotbkUMtf-whLmXa6nnCTQU)

Fluency is a feature-rich module for the [ProcessWire CMS/CMF](https://processwire.com/) that integrates third party translation services with a user-friendly interface for translating content in any multi-language field on any page. It also provides powerful tools to help developers create multi-language sites and apps faster.

Fluency can be used:

- While developing a new ProcessWire application
- When adding multi-language abilities to an existing ProcessWire application
- To add translation abilities to an existing multi-language ProcessWire application

You can help make Fluency better by filing Github issues when bugs are found, or submit a pull request with fixes.

**Notes on upgrading Fluency**Upgrading from earlier versions to 1.0.8 and earlier may cause errors to occur. It is recommended that versions prior to 1.0.9 be uninstalled and the latest version installed. This will not cause any content loss however the API key must be re-entered and module configuration be completed again.

For support and community discussion about Fluency, visit [the module thread in the ProcessWire forums](https://processwire.com/talk/topic/24567-fluency-the-complete-translation-enhancement-suite-for-processwire/).

**IMPORTANT**

Fluency v2.2.0 or greater is required when using DeepL as the translation service. DeepL changed their API authentication method in January of 2025 and deprecated the previous method. Translation via DeepL in versions earlier to 2.2.0 will no longer work and result in a translation service error in the UI.

Contents
--------

[](#contents)

- [Requirements](#requirements)
- [Installing](#installing)
    - [Configuring](#configuring)
    - [Translation Engines](#translation-engines)
    - [Localizing Fluency](#localizing-fluency)
    - [Theming Fluency](#theming-fluency)
    - [Upgrading or Removing](#upgrading-or-removing)
- [Features and Usage](#features-and-usage)
    - [Translating Inputfields](#translating-inputfields)
    - [Translating Templates and Modules](#translating-templates-and-modules)
    - [Disabling Translation For Individual Fields](#disabling-translation-for-individual-fields)
    - [Standalone Translator](#standalone-translator)
    - [Modified Content Indication](#modified-content-indication)
    - [Caching](#caching)
    - [Rendering Language Markup](#rendering-language-markup)
        - [Language ISO Codes](#language-iso-codes)
        - [Meta Link Tags](#meta-link-tags)
        - [Switch Page Language Select Element](#switch-page-language-select-element)
        - [Switch Page Language Links](#switch-page-language-links)
- [Using Fluency Programatically](#using-fluency-programatically)
    - [Translating Content](#translating-content)
    - [Get All Translation Service Languages](#get-all-translation-service-languages)
    - [Get All Configured Languages](#get-all-configured-languages)
    - [Translation Service API Usage](#translation-service-api-usage)
    - [Translation Engine Information](#translation-engine-information)
    - [Managing Cache](#managing-cache)
    - [Admin REST API Endpoints](#admin-rest-api-endpoints)
- [Error Handling and Logging](#error-handling-and-logging)
- [Hooking](#hooking)
- [Known Issues](#known-issues)
- [Contributing](#contributing)
    - [Coding Standards](#coding-standards)
- [Cost](#cost)
- [Supporting Module Development](#supporting-module-development)

Requirements
------------

[](#requirements)

- ProcessWire &gt;= 3.0.2
- PHP &gt;= 8.1
- Module dependencies
    - LanguageSupport
    - LanguageTabs
    - ProcessLanguage
- UIKit admin theme
- At least 2 languages configured in ProcessWire and Fluency to add translation to fields
- API key for the chosen third party translation service, free tiers are available

Installing
----------

[](#installing)

You can install Fluency by adding the module to your ProcessWire project using any of the three following methods.

**Method 1**: Within ProcessWire using 'Add Module From Directory' and the class name `Fluency`

**Method 2**: Via Composer with `composer require firewire/fluency`

**Method 3**: Download from this repository or the [Modules directory](https://processwire.com/modules/fluency/) and unzip the contents into `/site/modules/`

After adding the module, install in ProcessWire.

Configuring
-----------

[](#configuring)

1. Open the module configuration page, choose a Translation Engine, save
2. Complete the Translation Engine setup, save
3. Create language associations, save
4. Assign the `fluency-translate` permission where appropriate

That's it. All multi-language fields will now feature click to translate buttons and a translator tool available in the Admin menu bar. There is no limit on how many languages may be configured, and new languages can be added at any time.

If no langauges are present in ProcessWire or if languages are present and not configured with Fluency, it is still possible to use the translator tool in the Admin menu as long as a valid API key is present and the current user has the `fluency-translate` permission. Inputfield translation buttons will not render until languages have been configured in Fluency.

### Translation Engines

[](#translation-engines)

Fluency integrates third party translation services as "Translation Engines". When you configure Fluency, you'll choose which service to use. Currently the following translation services are availale:

- [DeepL](https://www.deepl.com/)
- [Google Cloud Translation](https://cloud.google.com/translate?hl=en)

Each translation service has their strengths, however not all features exist for all engines as Fluency relies on what abilities are available via each translation service, so review each and choose the one that is right for your project.

If you're interested in contributing to Fluency by building a Translation Engine, see [Contributing](#Contributing) below.

### Localizing Fluency

[](#localizing-fluency)

[![fluency_localization](https://private-user-images.githubusercontent.com/61801600/292639446-2e0067a3-aaf3-42ea-89f5-e46994d478cd.jpg?jwt=ey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sPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI4M2MyNTcyMThkZTQ4ZTRhMGVmZmUyMWUyZjY4MmNmZDk0MjgzN2I4ZmYxNmVhY2VjMTcyMTM2YTUzMmFmOGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.7AHfBXW1zeMKsxBMtX8bDO5R3mJU0e9viHmzQ19bWXo)

All text for the Fluency UI elements can be translated including messages, errors, and elements users use to interact with Fluency. This is done through ProcessWire's language setup. In the Admin visit Setup-&gt;Languages, and the "Find Files To Translate" feature within the language management page.

All translatable texts are located in `Fluency/app/FluencyLocalization.php`

### Theming Fluency

[](#theming-fluency)

Fluency is styled to match and complement AdminThemeUikit which is active by default when you install ProcessWire. It is also configured to work with AdminThemUikit v3 which adds built-in customizability for theming. When you choose a main color, or choose a custom main color, Fluency will match your theme choices.

CSS for Fluency UI elements may be customized for some styles. Fluency uses [CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Cascading_variables/Using_custom_properties) for values such as color in some rules.

You can refrence the available custom properties that you can set values for in `Fluency/resources/css/global/ft_variables.css`

### Upgrading Or Removing

[](#upgrading-or-removing)

Adding, upgrading, or removing Fluency from your ProcessWire application will not affect content. At most, you *may* (but not always) need to update or reconfigure your Fluency module config. Settings are saved individually for each translation engine, so it is possible to switch between engines without losing your configurations for each.

When upgrading Fluency, check the Fluency config page to ensure that your settings are correct and to review any new features that may have been added.

Review the `CHANGELOG.md` file for an always up-to-date list of changes.

Features and Usage
------------------

[](#features-and-usage)

### Translating Inputfields

[](#translating-inputfields)

[![fluency_translating_inputfields](https://private-user-images.githubusercontent.com/61801600/292640769-09345468-7e39-4287-8e9a-37291edd8e5f.jpg?jwt=eyJ0eXAiO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UFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE5MDRhMjdhMDBkYjM1MTZkNGY2MjA2ZmI5MWEwZDkwMTc4ZGRmM2I2ODM3ZDM3OWU5MTcxNWVhOGFlNTIxYjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MCkqpdUy0B-99cdhScBIE9KqYreqiUqqh7jNomxcCPI)

Fluency can translate content in any type of field on any page. These include:

- Plain textarea or text
- CKEditor content (Regular, Inline)
- TinyMCE content (Regular, Inline)
- Image/file descriptions
- Page names/URLs
- Tables
- Repeater/repeater matrix

Fluency is designed so that any multi-language field in any location or combination/nesting with other fields will be translatable.

When translating content within a TinyMCE or CKEditor field that contains links to other pages, the URLs will also be converted to links in that language automatically.

### Translating Templates and Modules

[](#translating-templates-and-modules)

[![fluency_templates_and_modules](https://private-user-images.githubusercontent.com/61801600/292640510-261dedb2-4c88-429b-81c8-96fbc7d16c2b.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDA1MTAtMjYxZGVkYjItNGM4OC00MjliLTgxYzgtOTZmYmM3ZDE2YzJiLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmNjE2MzAwNjBlZWZiNmQ2YTdiODg3YjM1NGQxMzYzOTc0MTZkZjA1MDY4MTdjMGVmYmQ1OTcyOTU1ZjBjNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IWSY_WGH83DnPO4gLufhjLplhMX49cBYXKMj-i2C3ts)](https://private-user-images.githubusercontent.com/61801600/292640510-261dedb2-4c88-429b-81c8-96fbc7d16c2b.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDA1MTAtMjYxZGVkYjItNGM4OC00MjliLTgxYzgtOTZmYmM3ZDE2YzJiLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTRmNjE2MzAwNjBlZWZiNmQ2YTdiODg3YjM1NGQxMzYzOTc0MTZkZjA1MDY4MTdjMGVmYmQ1OTcyOTU1ZjBjNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.IWSY_WGH83DnPO4gLufhjLplhMX49cBYXKMj-i2C3ts)

Fluency integrates with ProcessWire's native translator pages where you can select files to translate. These include:

- Templates that contain strings are wrapped in the `__()` function
- Core modules
- Site modules that contain strings wrapped in the `__()` function

In your ProcessWire admin, navigate to a langauge page, use the "Find Files To Translate Button", select your files, and edit the translations. The field for each value will have a button which translates the string above the field to the language you are currently editing. For extra speed, use the "Click To Translate All" button at the top. This will translate all values on the page simultaneously in seconds.

**Note:** Please keep in mind that translating site and core modules *may* be relatively expensive operations with respect to your API usage. It is recommended that you identify and prioritize the files/modules that are used in your ProcessWire site/app.

### Disabling Translation For Individual Fields

[](#disabling-translation-for-individual-fields)

There may be individual fields that are multi-language but translation is not desired. These could be fields that need different values for each language but contain content not suitable for translating such as URLs, phone numbers, email addresses, etc. To disable translation individually, navigate to the Details tab of a multi-language field and check the "Disable translation for this field" checkbox. This can be modified at any time without affecting content or other functionality.

### Standalone Translator

[](#standalone-translator)

[![fluency_translator](https://private-user-images.githubusercontent.com/61801600/292639760-4e0e7ab8-41f8-4d5e-82b4-ad344b1c61b3.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2Mzk3NjAtNGUwZTdhYjgtNDFmOC00ZDVlLTgyYjQtYWQzNDRiMWM2MWIzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0MzA2YTMwYmIxNjYxMzIyMDAxMDc2ZTI2MWEwZmI0ZTM2MjM4MmI5MzIwNGNiMTJhYjhjMmUyMTJlZWU0OGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aN-nlxxLICDVvpb-lzt2b6PSVTw4klf5pXKVbIfDUqY)](https://private-user-images.githubusercontent.com/61801600/292639760-4e0e7ab8-41f8-4d5e-82b4-ad344b1c61b3.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2Mzk3NjAtNGUwZTdhYjgtNDFmOC00ZDVlLTgyYjQtYWQzNDRiMWM2MWIzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA0MzA2YTMwYmIxNjYxMzIyMDAxMDc2ZTI2MWEwZmI0ZTM2MjM4MmI5MzIwNGNiMTJhYjhjMmUyMTJlZWU0OGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.aN-nlxxLICDVvpb-lzt2b6PSVTw4klf5pXKVbIfDUqY)

Fluency also provides a standalone translation located as an item in the admin menu bar that can be accessed from any page, or by clicking the translation icon next to the translate buttons located under fields. This does not require that ProcessWire languages are configured in Fluency, only that the Translation Engine is configured to use a third party service.

To use the standalone translator, users must be assigned the `fluency-translate` permission.

### Modified Content Indication

[](#modified-content-indication)

When content in a ProcessWire field changes, Fluency italicizes and adds a green line on the language tab for that field. If the content is reverted to it's original value, the green line is removed. This lets users who are editing and translating content know which fields have been changed without clicking to another language tab. This assists content input and helps prevent content deviation between languages.

[![fluency_modified_indicator](https://private-user-images.gith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wZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBiZGJkYWM1ODczNDdmN2Q2ODM1ZjYzZjcyN2Q4MWE4ZGM2OWIwYWJjMGE1Zjk1NmQ4MmE3MDAzNWIyNmI0OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.e_oIe3tvVpwn1z_J_hTWA3qRFejmLaTuWpvhYL8oPV0)

### Caching

[](#caching)

**Translations**

[![fluency_translation_caching](https://private-user-images.githubusercontent.com/61801600/292640113-605aa092-5f72-4eab-9593-e72724892c40.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDAxMTMtNjA1YWEwOTItNWY3Mi00ZWFiLTk1OTMtZTcyNzI0ODkyYzQwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFlZGE4MDlmMjEwNmI2OTI1OGEzNzliOGZlMjk2YjAxZGUzODg2Nzg3MWE1YmU5MzY5OGY0NTYwYTExMjBjNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.syVrWHYHj5dLKAtBHH5Oy_kwSAGCTENF7BcDozspvKo)](https://private-user-images.githubusercontent.com/61801600/292640113-605aa092-5f72-4eab-9593-e72724892c40.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDAxMTMtNjA1YWEwOTItNWY3Mi00ZWFiLTk1OTMtZTcyNzI0ODkyYzQwLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWFlZGE4MDlmMjEwNmI2OTI1OGEzNzliOGZlMjk2YjAxZGUzODg2Nzg3MWE1YmU5MzY5OGY0NTYwYTExMjBjNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.syVrWHYHj5dLKAtBHH5Oy_kwSAGCTENF7BcDozspvKo)

All translations are cached indefinitely. This helps reduce API account usage where the same content is translated more than once and significantly increases translation speed. Caching may be toggled on/off on the Fluency module config page. The translation cache can also be manually cleared either on the module config page, via the [Fluency module API](#managing-cache), or via an AJAX request using the [Fluency admin REST API](#admin-rest-api-endpoints).

Translation caching relies on *exact* value matching including punctuation, spelling, and capitalization. This ensures that an exact translation is always returned accurately. Translations that contain multiple strings are cached together.

**Translatable Languages**

[![fluency_translatable_languages_caching](https://private-user-images.githubusercontent.com/61801600/292640117-dd1ecf51-92d1-4d63-8a9c-49c69ddd0da3.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDAxMTctZGQxZWNmNTEtOTJkMS00ZDYzLThhOWMtNDljNjlkZGQwZGEzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0N2Q3N2Y0YmVkMzhjNDFhNTE0YTJkOGIwZWQ0MWIxMTAwN2EyMzRlOTU0YjJiNGE1NjA5Mzg2ODE3MjFjNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.J57oByCRCfJNLwzW54Q8_WxsR5gsvTVX_siFCH7jzKM)](https://private-user-images.githubusercontent.com/61801600/292640117-dd1ecf51-92d1-4d63-8a9c-49c69ddd0da3.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUxMDI1MjcsIm5iZiI6MTc3NTEwMjIyNywicGF0aCI6Ii82MTgwMTYwMC8yOTI2NDAxMTctZGQxZWNmNTEtOTJkMS00ZDYzLThhOWMtNDljNjlkZGQwZGEzLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjA0MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwNDAyVDAzNTcwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg0N2Q3N2Y0YmVkMzhjNDFhNTE0YTJkOGIwZWQ0MWIxMTAwN2EyMzRlOTU0YjJiNGE1NjA5Mzg2ODE3MjFjNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.J57oByCRCfJNLwzW54Q8_WxsR5gsvTVX_siFCH7jzKM)

Fluency uses lists of recognized languages from the selected third party translation service to determine what languages to make available when configuring and using Fluency.

**Note: This is cached forever until manually cleared** the first time that a translation engine is selected/configured to increase the speed of Fluency's operations.

Available languages are cached on a per-engine basis. This means that if a translation service adds additional translatable languages, this cache must be cleared on the module config page, via the [Fluency module API](#managing-cache), or via an AJAX request using the [Fluency admin REST API](#admin-rest-api-endpoints).

### Rendering Language Markup

[](#rendering-language-markup)

Fluency provides tools to help make building websites with multi-language capabilities faster and easier. There are HTML best practices that help users with accessibility and improve SEO performance, many of these are available out of the box with Fluency.

Language names and ARIA attributes are automatically localized when you configure Fluency and use the ProcessWire core translation pages to translate the module.

#### Language ISO Codes

[](#language-iso-codes)

Returns the target language ISO code provided by the third party service.

```
// Get the current language's ISO code
$fluency->getLanguageCode(); // => en-us

// Get the ISO code for another language using it's ProcessWire ID
$fluency->getLanguageCode(1034); // 'de'
```

*Tip:* Use this to indicate the current language of the page including the `lang` attribute on the `` tag.

```
