Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kodeflowstudios.com/llms.txt

Use this file to discover all available pages before exploring further.

Adding a language to Parley is fairly straight forwards, the steps below show you how to modify the supported languages.

1. Updating the ENUM

Open up the Localization.cs file located inside the Utilities folder of the Parley asset. You’ll find the LanguageID enum located near the top of the file, this is where your supported languages go. Add your desired language(s) to the enum. It should look something like this:
public enum LanguageID
{
    English,
    German,
}

2. Adding the info

Inside the Localizer class, you’ll find a dictionary called Languages. Create the language details pair like the english example or like the example below:
{
    LanguageID.LanguageIDFromLanguageIDEnum,
    new LanguageInfo("iso_code", "native_name", "english_name")
},
If you did things correctly, you should see something like the example below:
public static readonly Dictionary<LanguageID, LanguageInfo> Languages = new()
{
    {
        LanguageID.English,
        new LanguageInfo("en", "English", "English")
    },
    {
        LanguageID.German,
        new LanguageInfo("de", "Deutsch", "German")
    },
};
It is recommended to use ISO 639-1 codes for languages so that your naming is consistent, however, you can use whatever string you like in the iso_code field.
And with that, you have added a new language! Please note that text direction is handled at the start of your files, this is shown in the next section.