Skip to content
FacebookYouTubeX (Twitter)

Setting Language Filters in a Block

This guide will help you set up language filters for text fields in a block, ensuring that users see content in their preferred language based on their browser settings. For a quick setup, you can import a Multilingual Chatbot template or create your own using the steps below.

If you’re looking for a simpler but effective Multilingual Bot, you can also try uploading a JSON structure for your translations using the globals section to host all the translations in one place.

  1. Open the Block:

    • Navigate to the block where you want to set the language filters
    • Click inside the block on the text field
  2. Find the Filter Option:

    • Look above the text field within the block for the filter option
    • Click on the filter icon to open the filtering settings

Language Filter Icon

Step 2: Set the Filter for English (Pivot Language)

Section titled “Step 2: Set the Filter for English (Pivot Language)”
  1. Choose the Attribute:

    • From the list of attributes, select user_language
  2. Set the Condition:

    • Set the condition to contains ignore case
  3. Enter the Value (ISO code “en”):

    • This ensures that only users with their browser language set to English will see this text
  4. Pivot Language Configuration:

    • Add another condition by selecting the “OR” option
    • The alternative condition should match a regex value containing the ISO codes for your other filtered languages

We used the regex:

^((?!it|es).)*$

We use this regex to get a “true” condition when the user language is different from the other two that we know are supported. As you can see, the languages are represented by their ISO codes “it” and “es”. If you support other languages different from the pivot one, you should add them as below:

^((?!it|es|fr|ru).)*$

English Language Filter Configuration

Step 3: Add Filters for Additional Languages

Section titled “Step 3: Add Filters for Additional Languages”
  1. Add a New Text Field:

    • Add another text field to the block for the next language translation
  2. Repeat Filter Setup:

    • Click on the filter option above the new text field
    • Choose the user_language attribute again
    • Set the condition to contains ignore case
  3. Enter the Language Value:

    • For Italian, enter it in the value field
    • Repeat these steps for other languages by adding more text fields and setting the appropriate language codes (e.g., es for Spanish, fr for French)

Additional Language Filters

Common language ISO codes you can use:

  • en - English
  • es - Spanish
  • fr - French
  • de - German
  • it - Italian
  • pt - Portuguese
  • ru - Russian
  • zh - Chinese
  • ja - Japanese
  • ko - Korean

Only the text fields that meet the conditions set by their respective filters will be displayed to the user. Ensure each text field is correctly set up with the user_language attribute and the appropriate condition. By following these steps, you can effectively manage multilingual content in your blocks, ensuring users see content in their preferred language based on their browser settings.

For any feedback, don’t be shy, shoot us an email at support@pingstreams.io 🧡