Search code examples
asp.net-coreaspnetboilerplate

How to pass the default language to the Registration page?


Is there a way to pass a specific UI language to the registration page? This is coming from the website and I want it to be the defaut option.


Solution

  • you can send the culture with these headers

    c=...
    uic=...
    

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Localization/AbpLocalizationHeaderRequestCultureProvider.cs#L12

    and for MVC use culture parameter like below

    /register?culture=tr  
    

    must be the first parameter of the query string


    and last option; you can always override AbpUserRequestCultureProvider

    https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.AspNetCore/AspNetCore/Localization/AbpUserRequestCultureProvider.cs

    UPDATE:

    According to the implementation it accepts query string parameters as culture like below

    ?culture=es-MX&ui-culture=es-MX
    

    See https://github.com/aspnetboilerplate/aspnetboilerplate/issues/2103