isRTL property Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/isrtl-property/ Microsoft Dynamics CRM . Microsoft Power Platform Tue, 09 Mar 2021 11:02:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 isRTL property Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/isrtl-property/ 32 32 176351444 isRTL property of UserSettings API in PCF Control to Determine Language within Dynamics 365 CRM http://microsoftdynamics.in/2021/03/09/isrtl-property-of-usersettings-api-in-pcf-control-to-determine-language-within-dynamics-365-crm/ Tue, 09 Mar 2021 11:02:08 +0000 https://www.inogic.com/blog/?p=27237 Introduction As we know, PCF control can be run in multiple languages. Each language has a script to be written and it will be written with a direction. Some languages are written in the left-to-right direction, whereas some are written in the right-to-left. For example, English language script is written left to write, whereas Arabic...

The post isRTL property of UserSettings API in PCF Control to Determine Language within Dynamics 365 CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
Introduction

As we know, PCF control can be run in multiple languages. Each language has a script to be written and it will be written with a direction. Some languages are written in the left-to-right direction, whereas some are written in the right-to-left. For example, English language script is written left to write, whereas Arabic language script is written in the right-to-left direction.

In PCF control, when the user interface language is set to Arabic, then the direction of the user interface will be switched in the right-to-left direction. To handle this situation in PCF control, we can use userSettings API of Power Apps. This API helps us to identify whether the user interface language is written in right-to-left or not and makes it easy to change the user interface on the basis of the language.

Please find the code below:

//function that returns the value of isRTL property
isRTL(context: ComponentFramework.Context<IInputs>) {
return context.userSettings.isRTL;
}

For example, we have field type PCF control in which the field returns the value of isRTL property. We have set the user interface language is English, that’s why isRTL returns false as seen in the screenshot below.

isRTL property of UserSettings API in PCF Control

In the below example, we have set the Arabic language as a user interface language, hence isRTL shows true.

isRTL property of UserSettings API in PCF Control

Conclusion

By using UserSettings API, we can easily get the direction in which the language is to be written and make the required changes in the user interface.

Go to Source and hit them a thumps up

The post isRTL property of UserSettings API in PCF Control to Determine Language within Dynamics 365 CRM appeared first on Microsoft Dynamics 365 Blog.

]]>
4326