Add language
Add a New Language to the Identity Server Website
By default, the Identity Server website supports only the English language.
However, it is still possible to incorporate support for a new language by making modifications in the codebase of the project.
In the remainder of this article, we will explain the manual steps to enable support for a new language.
- Register the language in the Identity Server : Open the Identity Server solution and edit the
IdServerConfiguration.csfile. Add a new language to theLanguagesproperty and specify its English translation. For example, to support theFrenchlanguage, you can have the following configuration :
public static ICollection<Language> Languages => new List<Language>
{
LanguageBuilder.Build(Language.Default).AddDescription("English", "en").AddDescription("Anglais", "fr").Build(),
LanguageBuilder.Build("fr").AddDescription("Français", "fr").AddDescription("French", "en").Build()
};
- Register the Language in the Identity Server website : Open the Identity Server website solution and edit the
Program.csfile. Modify the callback function of theUseRequestLocalizationmethod and add the language code. For instance, to support theFrenchlanguage, use the following configuration:
app.UseRequestLocalization(e =>
{
e.SetDefaultCulture("en");
e.AddSupportedCultures("en", "fr");
e.AddSupportedUICultures("en", "fr");
});
- Resource file : Each SimpleIdServer project contain a
Global.resxfile with all theEnglishtranslations. To update the translation of the Identity Server website, create aGlobal.<two letter language code>.resxfile in theSimpleIdServer.IdServer.Website\Resourcesfolder.
If you feel comfortable, you can easily contribute to the project by adding a new language :)