1.8 KiB
How to add a new language to your ABP project?
Adding a new language to your ABP project is pretty simple. Let's add the German language to our ABP project:
-
Go to your solution's root folder and write the following CLI command. This command will generate an empty translation file from English.
abp translate -c de-DECheck out for the complete supported culture codes. (For internal development
D:\Github\abpandD:\Github\volo\abp) -
Fill the
targetfields in your target language. -
Copy
abp-translation.jsonyour solution's root folder (Do not change the filename!) -
Run the following command. This command will create the necessary
jsonfiles.abp translate --apply -
Open your solution and add the new language to the language list. To do this;
- open
MyProjectNameDomainModule.csand inConfigureServicesyou'll findConfigure<AbpLocalizationOptions>. If you haveHttpApi.Hostproject then you need to add this inMyProjectNameHttpApiHostModule.cs
options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsch", "de"));The last parameter is the flag icon. You can find the list of flag icons on https://flagicons.lipis.dev/
- open
-
The last step is running the DbMigrator project. It will seed the database for the new language.

Close the IIS Express / Kestrel to invalidate the language cache and run the project. You will see the new language on your website.


