# WordPress multi-language site (As SSO Provider) with use locale Discourse instances

**URL:** <https://meta.discourse.org/t/wordpress-multi-language-site-as-sso-provider-with-use-locale-discourse-instances/107491>\
**Category:** WordPress\
**Created:** [1월 25, 2019, 2:39오전 UTC](https://meta.discourse.org/t/wordpress-multi-language-site-as-sso-provider-with-use-locale-discourse-instances/107491 "2019-01-25T02:39:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [1월 31, 2019, 6:52오후 UTC](https://meta.discourse.org/t/wordpress-multi-language-site-as-sso-provider-with-use-locale-discourse-instances/107491/5 "2019-01-31T18:52:57Z")

</div>

> [@Umashankar\_Ankuri](#):
>
> I’m able to find the filter for adding sso params, is this the right one to add

Yes, that is the correct filter. For updating the locale of users who already exist on your system, you also need to pass the `locale_force_update` parameter. This code example will update a user’s locale to ‘fr’:

```plaintext
add_filter( 'wpdc_sso_params', 'wpdc_custom_sso_params' );
function wpdc_custom_sso_params( $params) {
    $params['locale_force_update'] = 'true';
	$params['locale'] = 'fr';

	return $params;
}

```

The WordPress `get_locale()` function is going to be unreliable to use for this. On my site that function returns `"en_CA"`. Discourse doesn’t accept this as a valid locale. It wants the string `"en"`.

Here’s the full list of locales that Discourse will accept:

```plaintext
ar, bg, bs_BA, ca, cs, da, de, el, en, es, et, fa_IR, fi, fr, gl, he, hu, id, it, ja, ko, lt, lv, nb_NO, nl, pl_PL, pt, pt_BR, ro, ru, sk, sl, sq, sr, sv, sw, te, th, tr_TR, uk, ur, vi, zh_CN, zh_TW

```

> [@Umashankar\_Ankuri](#):
>
> Also I didn’t find filter to force login user to particular discourse url,

I think what you want is a URL in this form:

```plaintext
<a href="https://forum.example.com/session/sso?return_path=https://forum.example.com/your-discourse-endpoint">Link Text</a>

```

The user will be taken to the URL set in the `return_path` parameter. Let me know if that isn’t what you are looking for.

---

_[View the full topic](https://meta.discourse.org/t/wordpress-multi-language-site-as-sso-provider-with-use-locale-discourse-instances/107491)._
