From 84b3c57087bddbfe7873c31e261e2ccd109e39e6 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:20:11 -0700 Subject: [PATCH] docs: add setLanguage method to user identification documentation (#6670) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Johannes --- .../website-app-surveys/user-identification.mdx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/xm-and-surveys/surveys/website-app-surveys/user-identification.mdx b/docs/xm-and-surveys/surveys/website-app-surveys/user-identification.mdx index fa7bf9e790..87413257ad 100644 --- a/docs/xm-and-surveys/surveys/website-app-surveys/user-identification.mdx +++ b/docs/xm-and-surveys/surveys/website-app-surveys/user-identification.mdx @@ -65,6 +65,20 @@ formbricks.setAttributes({ to 150 attributes per environment. +### Setting User Language + +Use the `setLanguage` function to set the user's preferred language for surveys. This allows you to display surveys in the user's language when multi-language surveys are enabled. You can pass either the ISO language code (e.g., "de", "fr", "es") or the language alias you configured in your project settings. + +```javascript Setting User Language +formbricks.setLanguage("de"); // ISO identifier or Alias set when creating language +``` + + + If a user has a language assigned, a survey has multi-language activated and it is missing a translation in + the language of the user, the survey will not be displayed. Learn more about [Multi-language Surveys](/docs/xm-and-surveys/surveys/general-features/multi-language-surveys). + + + ### Logging Out Users When a user logs out of your webpage, also log them out of Formbricks to prevent activity from being linked to the wrong user. Use the logout function: