# LanguageManager

## Custom Translations

Custom Translations are useful for if you'd like your plugin to be available in multiple languages.

### Example: English and French

In this example, we'll support English and French. You can of course create as many language files as you'd like.

By default, users will only be able to see in languages that are supported by Saturn, but you could create your own settings file that supports more languages if you'd like.

{% code title="en-gb.json" %}

```json
{
  "Hello": "Hello",
  "ControlPanel": "Control Panel"
}
```

{% endcode %}

{% code title="fr.json" %}

```json
{
  "Hello": "Bonjour",
  "ControlPanel": "Panneau de commande"
}
```

{% endcode %}

{% code title="index.php" %}

```php
<?php
use Saturn\LanguageManager\Translation;
$Translation = new Translation('.../'.SATURN_LANGUAGE.'/.json');
?>
...

<h1><?= $Translation->$Translate('ControlPanel'); ?></h1>
<p><?= $Translation->$Translate('Hello'); ?></p>

...
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saturncms.net/1.0.0/dev/libraries-and-functions/languagemanager.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
