How to make one language file take precedence over another for the same locale and the same library?
Hi! I need to customize some UI messages in the HTML5 viewer 2.7, and keep the web site simple for future viewer upgrade, so I created an additional language file to keep the custom strings for some specific locale keys, and hopping it can work together with the out-of-box one.
I updated desktop.json.js to refer to both files in the following way, without changing the out-of-box Mapping.en-US.json.js file:
{
"id": "Mapping",
"uri": "Resources/Compiled/Mapping.js",
"locales": [
{
"locale": "en-US",
"uri": "Resources/Locales/Mapping.en-US.json.js"
},
{
"locale": "en-US",
"uri": "Resources/Locales/Custom.en-US.json.js"
}
]
}
I found that the some times our website displays string from one file and some time for another, from the same key.
Is there anyway I can set the precedence of these two files?
Thank you!
0
-
Hi Sui,
When there are duplicate language keys provided, the last one downloaded by the system wins.
To do this reliably you would likely need to use a custom module that listens for the "ViewerLibrariesDownloadedEvent" event and then injects your language strings using this.app.injectLibraryResources(...). Or we would need to make a change to the software to support this sort of override of existing strings.
To change the software you would need to request the change in our "Ideas" section.
Please let me know if you have any questions.
Regards.
Wayne Richard
Latitude Geographics Group Ltd.
Head Office: 300 – 1117 Wharf Street Victoria, BC Canada V8W 1T7
Tel: (250) 381-8130 | Fax: (250) 381-8132 | wrichard@latitudegeo.com
Developers of Geocortex web-based mapping software | www.geocortex.com
An Esri Platinum Business Partner
.0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar