This approach supports only choosing the right language pack at the app initialize and does not support changing the language during application lifetime.

If your application does not use the Application Framework, the basic functions still can be used from the Framework core (the path is: '$MANAGER_WIDGET/Common/af/2.0.0/loader.js', it requires jquery to be included first). On the application init the SmartHub language can be checked using the function:

sf.core.getEnvValue('lang');

And after that, the proper language file can be included using

sf.core.loadJS(file,callback);

If there is a need to change the language during application lifetime, this can be done by simply loading another language file, which will overwrite the previous one. In this case however, the whole UI needs to be refreshed in the callback function.