Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization - Facebook Messenger / Webchat #1056

Closed
NicolasHumann opened this issue Aug 22, 2016 · 7 comments

Comments

@NicolasHumann
Copy link

@NicolasHumann NicolasHumann commented Aug 22, 2016

Hi,

The current thread CurrentUICulture is not set with the user localization in Facebook Messenger and Webchat.
The default culture (en) is set whereas Facebook Messenger is in French (tested on mobile with full french (os + app) and in the web site). I have the same behavior in the Webchat iframe, it's always in english (the http header of the browser is also set in french).

Do I missed something ?

Thanks

@NicolasHumann

This comment has been minimized.

Copy link
Author

@NicolasHumann NicolasHumann commented Aug 23, 2016

Hi,

I found a workaround. The primary issue is the property activity.Locale is not set.
My workaround is to ask facebook to give me the user locale:

if (activity.ChannelId.Equals("facebook", StringComparison.InvariantCultureIgnoreCase)) { using (WebClient client = new WebClient()) { var json = await client.DownloadStringTaskAsync( $"https://graph.facebook.com/v2.6/{activity.From.Id}?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token=<PAGE_ACCESS_TOKEN>"); dynamic jObject = JObject.Parse(json); string locale = jObject.locale; activity.Locale = locale.Replace("_", "-"); } }

@willportnoy

This comment has been minimized.

Copy link
Member

@willportnoy willportnoy commented Aug 24, 2016

I think the feature request would be to "set the activity locale from the facebook user's profile".

@Andrea-Orimoto

This comment has been minimized.

Copy link
Contributor

@Andrea-Orimoto Andrea-Orimoto commented Aug 24, 2016

Added to our backlog for future consideration. Thanks!

@picatextra

This comment has been minimized.

Copy link

@picatextra picatextra commented Jan 3, 2017

Hello, it think still have this issue

@kevinport

This comment has been minimized.

Copy link

@kevinport kevinport commented Mar 27, 2017

me too

@sherifadel-msft

This comment has been minimized.

Copy link

@sherifadel-msft sherifadel-msft commented Oct 17, 2017

me as well

@AndreMantas

This comment has been minimized.

Copy link

@AndreMantas AndreMantas commented Oct 2, 2019

@Andrea-Orimoto what is the state of this task on your backlog after 3 years?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.