Marzouk
Marzouk

Reputation: 2714

How to implement identity server 3 localization

I have an identityserver3 as a separate server for authenticating multiple client.

I want to localize it and i used IdentityServer3.Contrib.Localization for that, now i know that this is it's usage:

  var options = new LocaleOptions { Locale = "nb-NO" };
  var localizationService = new GlobalizedLocalizationService(options);

In IdentityServer startUp class, i have a services factory like:

 idServerServiceFactory.Register(new Registration<ApplicationDbContext>());
            idServerServiceFactory.UserService = new Registration<IUserService, UserService>();
            idServerServiceFactory.Register(new Registration<UserManager>());
            idServerServiceFactory.Register(new Registration<UserStore>());

And in options:

    var options = new IdentityServerOptions
            {
                Factory = idServerServiceFactory,
                SiteName = .....

I try to register the localization service to the identityserver servicesFactory but it didn't works correctly also i didn't find and samples on how to use it, can any one help in this?

Upvotes: 3

Views: 1075

Answers (1)

Scott Brady
Scott Brady

Reputation: 5598

According to the documentation you need to register your ILocalizationService, like so:

factory.LocalizationService = 
   new Registration<ILocalizationService>(localizationService);

I don't see that in your example code.

If you already have that you might want to explain how it isn't working and expand on your code samples.

Upvotes: 3

Related Questions