# Translation

This section will tell you how to translate the script

### Adding a New Language

There are 2 steps that you need to follow to add a new language to your script.

#### Step 1: Creating Language Files

- To add a new language, go to the root directory of your script (Usually `public_html`) and find the `lang` directory.
- Navigate into the `lang` directory and make a copy of the `en` folder and name it with the 2 letter language code (i.e. `fr`, `es`, etc)
- - For example, If you wanna add the language French, you will rename the copied folder to `fr`.
- Go into your newly made folder and open the PHP files to edit.
- Replace the English text on the right with your translated text.
- - DO NOT CHANGE THE TEXT ON THE LEFT SIDE

    <?php

        return [
            'hello' => 'Hello There!"
        ];

    ?>

Becomes:

    <?php

        return [
            'hello' => 'Bonjour!'
        ];

    ?>

#### Step 2: Adding Language to Script

- After you have created the language files, head over to your admin panel.
- Navigate to `Language Settings`
- Click on the `Add to Languages` button.
- - Enter the 2 letter language code in the `Language Code` Field (Same name as the directory for the Language Files.)
- - Enter the 2 letter country code for the Flag in the `Flag Code` Field (i.e. `US` for USA).
- - Enter the label for this language in the `Language Label` field. This will be shown in the Language Selector.
- - Specify whether the language is Left-to-Right or Right-to-Left.
- - - LTR / RTL modes aren’t implemented yet, however they will be released in a future update soon.

After following all of these steps, you should now have a new language that users can select. Your script should now be multi-lingual.

You can now translate the Static Pages from the Admin Panel as-well.

### Translating Pages

After you’ve added a new language to the script, you will see a Language Selector in the Top Right in the `Pages` section of the Admin Panel.

- You can use the selector to switch the language when Creating, Editing and Viewing Pages.
- This allows you to translate the pages into different languages as-well.

### Translating Tools

When you copy over the translation files, you will see a `tools` directory inside. This directory contains a different file for every tool in the script. You may edit these files to translate the tools.

Note: For this to work, The Option `Language Settings > Translate Tool Titles & Descriptions` must be Turned ON. Otherwise, the titles and descriptions inside the individual tool settings will be used.