LanguageSelector

The LanguageSelector widget is used to allow a user to set the language of your app. The LanguageSelector widget shows the currently selected language and opens up a list of all languages (that you support) when you tap on it.

For example, you can use the LanguageSelector widget on the onboarding screen to let users choose the app language.

Adding LanguageSelector to Your Project

Let's build an example of adding the LanguageSelector and see how the app language changes when selecting a different language from the LanguageSelector. Here's how it looks:

To add LanguageSelector to your project:

  1. Make sure you have added multi-language support to your app. If you haven't already done so, find the instructions here.

  2. First, drag the Column widget from the Layout Elements tab (in the Widget Panel).

  3. Now, add the LanguageSelector widget (inside Column) by dragging it from the Base Elements tab or adding it directly from the widget tree. Align it in the center.

  4. Add the Text widget to show the text.

  5. Translate the text by navigating to Settings and Integration -> General -> Languages -> App Content Translations -> Page Name -> Your Text.

  6. Find the language dropdown above the canvas and try changing it to other languages and see the translated text appear on the canvas.

Changing the properties

The Properties Panel can be used to customize the behavior of your widget.

Add Padding

Here are the instructions on how to add padding.

Adjust The Alignment

Here are the instructions on adjusting the alignment.

Changing the Size

To change the size of the LanguageSelector:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. There are three ways to change the size:

    • To set to an exact size, select PX and enter the desired values.

    • To set the dimensions as a percent of the screen size, select % and enter the desired value.

Changing Color

You can change the background color of the LanguageSelector and a dropdown icon color.

To change the color:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. To change the background color of the dropdown button, find the Background Color property, click on the box next to Black, select the color, and then click Use Color or click on Black and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

  4. To change the dropdown icon color, find the Dropdown Icon Color property, click on the box next to the already selected color, select the color, and then click Use Color or click on the already selected color and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

Set color dynamically

See how to set a color from variable to any color property of this widget.

Customizing Border

To customize the border such as changing its color and radius:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. Find the Border Color property, click on the box next to the already selected color, select the color, and then click Use Color or click on an already selected color and enter a Hex Code directly. You can also choose the color by clicking on the Palette and Simple button.

  4. Now, find the Border Radius property below, enter the value 50. By default, the value 50 will be set for all corners.

Customizing Flag

By default, the LanguageSelector widget shows the country flag before the language name. You can change the flag's size, adjust the spacing between flag and language name or completely hide the flag.

Changing Flag Size

To change the flag size:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. Find the Flag Size property and enter the value.

Adding Space between Flag and Text

To add some space between the flag and the language name:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. Find the Flag & Text Gap property and enter the value.

Hiding the Flag

To hide the flag:

  1. Select the LanguageSelector widget from the widget tree or from the canvas area.

  2. Move to the Property Editor (on the right side of your screen) and scroll down to the Language Selector section.

  3. Checkmark the Hide Flags property to hide the flag (click on it).

Styling the Text

You may want to customize the text style to match your design. Various properties under the Text Style section help you customize the text.

Here are the instructions on styling the Text.

Show/Hide LanguageSelector

Please find the instructions to show/hide the widget here

Last updated