'Forge Viewer_Languages
I would like to know how to change the language of the toolbar in the Forge viewer buttons, depending on the language chosen by the user. For example, being able to switch between Spanish, English, or Italian, etc.
Thanks.
Solution 1:[1]
According to the documentation you can change the language when initialising the viewer. If the language is not found it will fall back to the default which is English.
function launchViewer(urn) {
var options = {
env: 'AutodeskProduction',
getAccessToken: getForgeToken,
language: <enter your language code here e.g. 'es', 'fr', 'it' ... >
};
Autodesk.Viewing.Initializer(options, () => {
viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('forgeViewer'), { extensions: [ 'Autodesk.DocumentBrowser'] });
viewer.start();
var documentId = 'urn:' + urn;
Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);
});
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | AlexAR |
