In the Supported languages section it says : "The language used by the app is determined by your browser's language setting."
Is there a way to control this?
I built the App in Hebrew and I want all the users to see it in Hebrew, no matter what their browser's setting is.
Is that possible?
Deshe.
Solved! Go to Solution.
well,
No one answered my question but I found the answer so I will share it with you:
In order to control the language you need to use the webappbuilder from your one server and add this code inside the file init.js : (after or instead of the original code. )
//override language and orientation
//*********************************************
dojoConfig.locale = "he";
window._setRTL(dojoConfig.locale);
//*********************************************
in file (init.js) find this line
dojoConfig.locale = navigator.language ? navigator.language : navigator.userLanguage;
and replace with this line :
dojoConfig.locale = "he" example -> dojoConfig.locale = "ar" this is Arabic app
well,
No one answered my question but I found the answer so I will share it with you:
In order to control the language you need to use the webappbuilder from your one server and add this code inside the file init.js : (after or instead of the original code. )
//override language and orientation
//*********************************************
dojoConfig.locale = "he";
window._setRTL(dojoConfig.locale);
//*********************************************
Hey Deshe Organization
I tried adding this line but it won't work for me. The Webappbuilder loader just keeps loading. When I replace the "he" with "en" it works.
Any idea what I could be doing wrong?
Here is my code:
if(allCookies.esri_auth){ /*jshint -W061 */ var userObj = eval('(' + unescape(allCookies.esri_auth)+ ')'); if(userObj.culture){ dojoConfig.locale = userObj.culture; } } if (allCookies.arcgisLocale) { dojoConfig.locale = allCookies.arcgisLocale.toLowerCase(); } if (allCookies.wab_locale) { dojoConfig.locale = allCookies.wab_locale.toLowerCase(); } if(!dojoConfig.locale){ dojoConfig.locale = navigator.language ? navigator.language : navigator.userLanguage; } dojoConfig.locale = dojoConfig.locale.toLowerCase(); dojoConfig.locale = "de"; window._setRTL(dojoConfig.locale); var resources = [ window.apiUrl + 'dojo/resources/dojo.css', window.apiUrl + 'dijit/themes/claro/claro.css', window.apiUrl + 'dojox/editor/plugins/resources/css/TextColor.css', window.apiUrl + 'dojox/editor/plugins/resources/editorPlugins.css', window.apiUrl + 'dojox/editor/plugins/resources/css/PasteFromWord.css', window.apiUrl + 'esri/css/esri.css', window.path + 'stemapp/jimu.js/css/jimu.css', window.path + 'builder/css/builder.css', window.path + 'builder/libs/ace/ace.js', window.path + 'builder/libs/thenBy.js' ];
Thanks,
Tim
Hi Tim,
This is my code. I think the difference starts in line 17 in your code.
try to replace lines 17-18-19 with the part in Bold:
if(allCookies.esri_auth){
/*jshint -W061 */
var userObj = eval('(' + unescape(allCookies.esri_auth)+ ')');
if(userObj.culture){
dojoConfig.locale = userObj.culture;
}
}
if(window.queryObject.mode){
if(allCookies.wab_locale){
dojoConfig.locale = allCookies.wab_locale;
}
}else{
if(allCookies.wab_app_locale){
dojoConfig.locale = allCookies.wab_app_locale;
}
}
if(!dojoConfig.locale){
dojoConfig.locale = navigator.language ? navigator.language : navigator.userLanguage;
}
dojoConfig.locale = dojoConfig.locale.toLowerCase();
window._setRTL(dojoConfig.locale);
//override language and orientation
//*********************************************
dojoConfig.locale = "he";
window._setRTL(dojoConfig.locale);
//*********************************************
resources = resources.concat([
window.apiUrl + 'dojo/resources/dojo.css',
window.apiUrl + 'dijit/themes/claro/claro.css',
window.apiUrl + 'esri/css/esri.css',
window.apiUrl + 'dojox/layout/resources/ResizeHandle.css',
window.path + 'jimu.js/css/jimu.css'
]);
I tried this and changed it in the inis.js located at client\stemapp and client\builder
but the webappbuilder just keeps loading
Tim
Tim Witt wrote:
I tried this and changed it in the inis.js located at client\stemapp and client\builder
but the webappbuilder just keeps loading
Tim
I have the same problem. page keeps loading.
Did you get any solution? Tim Witt
any solution tim ?
ty
I have followed the same solution but I'm getting the same result. The page keeps loading!
I'm trying to set the language to Arabic.
Any suggestions?