Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Languages and localisation guide

Maciej Gomoła edited this page Aug 24, 2023 · 1 revision

Intro

Bard's core feature is the configurability which users can use to really make Bard their own.

To feel more comfortable with the bot, you would probably want to change the language to the one you and your friends use most. This is possible using our highly extendable localisation support. Bard let's you translate the bot yourself without even knowing to code! This page will teach you step by step on how to implement your own language to our bot.

Guide

JSON customisation

If you ever looked into the organisation of Bard's files, you've probably noticed one folder: lang. That's where we keep all of the languages available to use. Currently we support English (en_GB) and Polish (pl_PL) by default. In the lang directory you should notice files with a .json extension corresponding to the languages mentioned above.

You should duplicate one of the files that contains the most friendly language to you. Then you just have to translate all strings to your desired language and save the file under some simple name. We prefer ICU locales (e.g. en_GB or pl_PL) but you can use anything you want as long as it doesn't include spaces. Remember to keep the .json extension though!

If you are not familiar with JSON, here are some helpful tips on how to properly edit and save your language file:

  • After opening the JSON file, you've probably noticed the way it's formatted. The only thing you should touch is the content in the second set of quotation marks in each line e.g. "doNotTouchThis": "You can translate this part",.
  • Changing the order of items in the JSON file will not impact the bot in any way.

.env language configuration

Now that you've successfully created and customised your language file, there's just one more thing to do. Open your .env file* located in Bard's root directory and insert your language file name without the .json extension in the LANGUAGE property. After doing so, you just need to restart the bot and everything should be just fine!

* If you didn't create a .env file yet, please refer to Getting started page

Clone this wiki locally