For a custom widget I want to show different labels and title of different layout items and widget label in different languages. I want my widget to be bilingual. I want all messages or labels to be shown according to the locale suppose locale is Arabic or English ar or en.
Hi @UbaidGul_opaz ,
Hope you find this document helpful https://developers.arcgis.com/experience-builder/guide/extend-base-widget/#i18n-support
Regards,
Shengdi
Thanks I already checked this documentation. What is not working with me is widget label is still in English and when you hover on the widget icon which inside widget controller its showing same English label also on the window of the widget.
Firstly, all your custom widget labels should read from translations folder. For example like follows
this.props.intl.formatMessage({id: 'str1', defaultMessage: defaultMessages.str1})
Secondly, you need to mention locale at the end of the url of your application. Then it will show you corresponding language labels.. You need to access your app something like follows.
https://localhost:3001/experience/1/?locale=ar
https://localhost:3001/experience/1/?locale=zh-cn
Thanks,
Ashok
I am able to use the code you referring the problem I have is widget label not changing according to locale I have attached a picture which shows the widget header which is not changing as locale changes to Arabic.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.