# .net core lock language

**URL:** <https://community.auth0.com/t/net-core-lock-language/6541>\
**Category:** Get Help\
**Tags:** aspnet-core, lock\
**Created:** [May 9, 2017, 6:47am UTC](https://community.auth0.com/t/net-core-lock-language/6541 "2017-05-09T06:47:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [May 9, 2017, 6:47am UTC](https://community.auth0.com/t/net-core-lock-language/6541/1 "2017-05-09T06:47:17Z")

</div>

Hi, can anyone know how i can change lock language with .net core?

Thank you

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [May 9, 2017, 7:45am UTC](https://community.auth0.com/t/net-core-lock-language/6541/2 "2017-05-09T07:45:43Z")

</div>

The Lock language can be changed in the `options` object passed during Lock instantiation:

```
// Select a supported language
var options = {
  language: 'es'
};

// Initiating our Auth0Lock
var lock = new Auth0Lock(
  'CLIENT_ID',
  'TENANT.auth0.com',
  options
);

```

> **[Lock Internationalization](https://auth0.com/docs/customize/internationalization-and-localization/lock-internationalization)**
>
> Lock v11 supports multiple languages, and allows for the addition of other custom language files, as well as for customizing the values of specific pieces of text that are displayed in the Lock widget.

---

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [May 9, 2017, 7:53am UTC](https://community.auth0.com/t/net-core-lock-language/6541/3 "2017-05-09T07:53:23Z")

</div>

I don’t have this code, here is my .net core login screen init code:

```
public IActionResult Login()
        {
            return new ChallengeResult("Auth0", new AuthenticationProperties() { RedirectUri = "/" });
        }

```

---

<div class="post-metadata">

**Author:** ![joakim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joakim](https://community.auth0.com/u/joakim)\
**Post date:** [July 11, 2017, 5:04pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/4 "2017-07-11T17:04:44Z")

</div>

I’m seeking for an answer to this as well. Would be nice if properties added to the `Items` dictionary could be encoded in the url if a certain prefix is used, e.g. auth0\_lang would be added to the uri `&lang=sv` and then available in `config.lang`.

---

<div class="post-metadata">

**Author:** ![joakim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joakim](https://community.auth0.com/u/joakim)\
**Post date:** [July 13, 2017, 4:47pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/5 "2017-07-13T16:47:47Z")

</div>

@charettedavid Here is the solution

```
OnRedirectToIdentityProvider = context =>
{
// More dynamic approach would be using request context
var requestCulture = context.Request.HttpContext.Features.Get<IRequestCultureFeature>();
                        var code = requestCulture.RequestCulture.UICulture.TwoLetterISOLanguageName;
                        context.ProtocolMessage.SetParameter("lang", code);
// Here you can set additional parameters that will be appended to the query string and hence available in lock
return Task.CompletedTask;
}

```

You might need to parse the query strings in script section of login page the extract values if they are not default Auth0 config settings

---

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [July 13, 2017, 8:03pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/6 "2017-07-13T20:03:19Z")

</div>

Thank youi! very appreciated. Hope they will update the documentation.

---

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [July 21, 2017, 2:33am UTC](https://community.auth0.com/t/net-core-lock-language/6541/7 "2017-07-21T02:33:11Z")

</div>

Working, but param is : lang  
context.ProtocolMessage.SetParameter(“lang”, “fr”);

---

<div class="post-metadata">

**Author:** ![jerrie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerrie/32/5898_2.png) [@jerrie](https://community.auth0.com/u/jerrie)\
**Post date:** [August 26, 2017, 5:38pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/8 "2017-08-26T17:38:30Z")

</div>

Thanks for this. I have made a note that we get these additional parameters properly documented

---

<div class="post-metadata">

**Author:** ![joakim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joakim](https://community.auth0.com/u/joakim)\
**Post date:** [August 28, 2017, 2:50pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/9 "2017-08-28T14:50:20Z")

</div>

Is there any link on how to migrate to [ASP.NET](http://ASP.NET) Core 2.0? The authetication modules have changed quite a bit!

Great job

---

<div class="post-metadata">

**Author:** ![jerrie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerrie/32/5898_2.png) [@jerrie](https://community.auth0.com/u/jerrie)\
**Post date:** [August 28, 2017, 3:39pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/10 "2017-08-28T15:39:09Z")

</div>

I used the info over here to migrate our own samples:  
[https://github.com/aspnet/Announcements/issues/262](https://github.com/aspnet/Announcements/issues/262)

---

<div class="post-metadata">

**Author:** ![jerrie](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jerrie/32/5898_2.png) [@jerrie](https://community.auth0.com/u/jerrie)\
**Post date:** [August 28, 2017, 3:40pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/11 "2017-08-28T15:40:51Z")

</div>

You can also review the V2 branch of our samples repo:  
[https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/tree/v2](https://github.com/auth0-samples/auth0-aspnetcore-mvc-samples/tree/v2)

---

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [May 9, 2017, 7:53am UTC](https://community.auth0.com/t/net-core-lock-language/6541/12 "2017-05-09T07:53:23Z")

</div>

I don’t have this code, here is my .net core login screen init code:

```
public IActionResult Login()
        {
            return new ChallengeResult("Auth0", new AuthenticationProperties() { RedirectUri = "/" });
        }

```

---

<div class="post-metadata">

**Author:** ![joakim](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@joakim](https://community.auth0.com/u/joakim)\
**Post date:** [July 11, 2017, 5:04pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/13 "2017-07-11T17:04:44Z")

</div>

I’m seeking for an answer to this as well. Would be nice if properties added to the `Items` dictionary could be encoded in the url if a certain prefix is used, e.g. auth0\_lang would be added to the uri `&lang=sv` and then available in `config.lang`.

---

<div class="post-metadata">

**Author:** ![charettedavid](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charettedavid/32/7135_2.png) [@charettedavid](https://community.auth0.com/u/charettedavid)\
**Post date:** [July 13, 2017, 8:03pm UTC](https://community.auth0.com/t/net-core-lock-language/6541/14 "2017-07-13T20:03:19Z")

</div>

Thank youi! very appreciated. Hope they will update the documentation.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/net-core-lock-language/6541/15 "2018-03-02T05:53:47Z")

</div>


