# i18n – Multilingual Content Manager for MODX

i18n is a powerful internationalization (i18n) component for MODX Revolution 3. It allows developers and editors to manage translations of site content through unique language keys. Translations are stored in the database and can be retrieved dynamically via snippet calls.

---

## Features

- **Key-based translations**: define a translation key manually or leave it blank for auto-generation; specify a group or use the default one set in System Settings.
- **Dynamic placeholders**: support for placeholder substitution using `{{name}}`, `{{city}}`, etc.
- **Automatic language detection**: via URL prefix, session, or cookie.
- **Language routing plugin**: enables clean `/en/`, `/ru/`, `/de/` prefixes with canonical redirects and fallback to `/`.
- **MODX Manager interface**: visual tabbed UI for editing translation keys and values.
- **Import/export**: manage large translation datasets with CSV or JSON.
- **Usage index tracking**: logs where and when translation keys are used in templates/resources.
- **Floating widget**: quick-access translation key search directly in MODX input fields.
- **Flexible config**: customize languages, key group defaults, fallback behavior, and more.

---

## Requirements

- MODX Revolution 3.x or higher  
- PHP 7.3 or higher  
- **ionCube Loader** v10.2 or higher (**required**)
- **libsodium PHP extension** (ext-sodium) (**required**)
- MySQL or compatible database  
- Apache/Nginx with `friendly_urls` enabled  
- .htaccess file in place (`ht.access` → `.htaccess` in site root)

> ⚠️ Without ionCube Loader, the module will not function.

---

## Installation

1. Download the i18n package (ZIP) from Gren Studio, ModStore, CodeCanyon, or GitHub.  
2. In MODX Manager: go to **Package Management → Add New Package**, upload ZIP and install.  
3. Ensure `friendly_urls = true` is enabled in System Settings.  
4. Rename `ht.access` to `.htaccess` in your site root if needed.  
5. Enable the **i18nLangRoute** plugin for automatic language routing.  
6. (Optional) Disable the language route plugin or Manager widget via System Settings.  
7. Activate your license key via **Extras → i18n** in MODX Manager.

---

## Usage

- **Output current language**:  
  ```
  [[!i18nGetLang]]
  ```

- **Basic translation call**:  
  ```
  [[!i18nKey? &key=`site.title`]]
  ```

- **With placeholders**:  
  ```
  [[!i18nKey? &key=`greeting` &placeholders=`{"name":"John"}`]]
  ```  
  Translation string: `Hello, my name {{name}} and it's a test message.`  
  Output: `Hello, my name John and it's a test message.`

- **Force specific language**:  
  ```
  [[!i18nKey? &key=`site.title` &lang=`en`]]
  ```

- **Auto-detect language with routing**:  
  ```
  [[!i18nKey? &key=`site.title` &lang=`[[!i18nGetLang]]`]]
  ```

---

## Key Management Features

- Keys and groups can be set manually or generated automatically.
- When a key or group is renamed, all usage references are automatically updated across content and templates to reduce maintenance overhead.

---

## License & Purchase

This component is distributed under a commercial license. You may use i18n on **one production domain** per license. Redistribution, code modification, or public publication is prohibited.

- Includes 1 year of updates and support.  
- Read full terms in the LICENSE file.

Purchase at: [https://gren.studio](https://gren.studio)

---

## Support

- Website: https://gren.studio  
- Email: info@gren.studio  
- GitHub Issues: https://github.com/RedFall/i18n

---

## Demo & Promotion

Want to test i18n before buying? Request a trial license on our website.  
Launch a multilingual MODX site in minutes — no context duplication, no Babel overhead.

---

© Gren Studio. All rights reserved.