1

Slack supports a limited amount of default workspace languages: https://get.slack.help/hc/en-us/articles/115004236403#/login

To customize a Slack app, I am looking to obtain their native language, even if it is not supported by Slack.

Slack API does provide certain calls such as users.info, users.list etc. with the include_locale parameter, but it is not enough.

Is there another method to obtain the Slack user's native language? Or perhaps country info?

edit: locale is not sufficient as it supports on the several languages Slack officially supports. And timezone is not accurate enough as many countries share TZ. Any clear and sure way?

Jay Jung
  • 1,805
  • 3
  • 23
  • 46
  • Is the `locale` field not enough because you want to do something like figure out their native language is Italian, even if they use Slack via `en-US`? – Colm Doyle Jan 24 '19 at 09:54

1 Answers1

2

locales

The locale feature is how you you determine the language of a user on Slack, e.g. calling users.info with include_locale = true will return the language of that user as IETF language code, e.g. en-US for US English or de-DE for German. This is how it works with normal browsers too, so pretty standard. For the full official documentation see Detecting the locale of users, channels, and other conversations.

timezone

Since you asked about the country: you can get an estimation of the users country / city from the timezone of the current user by calling users.info. Assuming the user has set it correctly in his profile of course.

Those two are all the options available. If this is not sufficient for your use case please specify in your question what exactly you are missing / want to achieve.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • Yes, `locale` is insufficient as it supports limited languages, and TZ often approximates--not exactly sure how this is decided, but i've noticed sometimes it will opt for the timezone of the more "popular" region in that zone? Is there a more surefire way? – Jay Jung Jan 25 '19 at 03:17
  • The TZ is set manually by the user. Usually by picking his country and/or a nearby major city from a list of options. – Erik Kalkoken Jan 25 '19 at 05:52