Translations
You would be happy to know that MultiGPT is a multilingual platform that means it support multiple languages. We have builtin translation support for that.
We have already added English, Bangla, Arabic, Dutch, Hindi, French. But you can also add new languages easily. If you want you can also remove one easily.
Understanding the language configuration
To understand the language configuration we 1st need to open the file named i18n.js. Here 1st then you will see the object called languages. You can use this to add or remove a language. Let's say I want to add italien as a language. So I'll add it:"italien" in this object and if I want to remove the french then I'll remove fr: "Français" from the object.
After we have added a language we need to created a folder with same language code inside ./src/locales. Here we have added it:"italien" so the folder name will be it. Then we will be needing to create a file called main.json that will contain all translated texts.
The new file will look like this
{
"home_seo_title": "",
"home_seo_description": "",
"command_seo_title": "",
"command_seo_description": "",
"404_seo_title": "",
"404_seo_description": "",
"input_placeholder": "",
"404": "",
"page_not_found": "",
"copyright": ""
}
And we need to fill it up. Here is an example for the english language.
{
"home_seo_title": "{{name}} - Let the AI handle it for you :)",
"home_seo_description": "",
"command_seo_title": "Command | {{name}}",
"command_seo_description": "",
"404_seo_title": "404 Page not found | {{name}}",
"404_seo_description": "",
"input_placeholder": "Ask me anything...",
"404": "404",
"page_not_found": "Page not found",
"copyright": "{{date}} {{name}}. All rights reserved."
}
Let's go deeper into the translation
| Key | Used For |
|---|---|
| home_seo_title | Title for the main index page. {{name}} is a variable render's your APP_NAME |
| home_seo_description | The SEO meta description text for home page |
| command_seo_title | Title for the command page |
| command_seo_description | The SEO meta description text for command page |
| 404_seo_title | Title for the 404 pages |
| 404_seo_description | The SEO meta description text for 404 pages |
| 404 | 404 Number |
| page_not_found | Page not found message |
| copyright | Your footer copyright. {{name}} is the APP_NAME and {{date}} is current year |
We are done here. Now let move on to the next part