Hi!
Since 10.5.1 it´s possible to "import" Custom Widgets into a ArcGIS for Portal.
In the past we developed Custom Widgets in WAB Developer Edition.
Now I got a problem with the webappviewer - the application that starts the webappbuilder apps in Portal for ArcGIS.
I got different classes (not only the Widget.js) in the Widget and every class has it´s own language file.
The WEB Developer edition has no problem to load an language ressource with
"dojo/i18n!./nls/ExtraClass"
When I start the Widget in an app in the WAB of the Portal for ArcGIS the dojo load says:
404 - [Widget]/nls/ExtraClass
there is no extension in the request!
I got a NLSTest Widget as attachment.
Now my question:
Is there a way to load these extra language files?
Or do I have to copy all language things to string.js?
Matthias,
I remember running into this issue with some of my widgets and I ended up just passing the nls object into the other files constructor instead of referencing it using the require array. For example in my main widget.js file it has no issue getting the nls file so when my widget.js required my singleParams file it passes the nls object to the single Params.js as one of it global variables.
Hi Robert,
thank you for this sugesstion. This would work!
Unforfunately our widgets also live as widgets outside the WAB. So I need to "require" the language files in case the widget starts outside the WA and pass the nls object in case the widget is in WAB. Hmmm..
I got a case at ESRI Inc. with this. So, let´s see what they will tell me to do.
Greetings.
Matthias