Yes. A couple of Slack API methods have an optional locale feature. By calling them with the include_locale
property set to true
they will return the locale information.
The locale field is a string containing a IETF language code, such as en-US
, fr-FR
, es-ES
, or de-DE
, and other future values.
Here is a list of Slack API methods supporting the locale feature:
channels.info
conversations.info
groups.info
im.info
im.open
rtm.start
users.info
users.list
So for your case you would first call users.info
for the user to find out his correct locale and then compose your text accordingly.
Check out this offical post for full details on locale support by the Slack API.