Localize the file content using configuration resources
Level: advanced
1. Create a module with localizable resources
If you want to translate resources to other languages, we recommend using a separate module with localizable resources. Create the module using the built-in Creatio tools in the Configuration section.
Module with localizable resources
define("Module1", ["Module1Resources"], function (res) {
return res;
});
2. Import the module with localizable resources
To access the module with localizable resources from the client module, import the module with localizable resources to the client module as a dependency.
Connect the needed resources to the module
define("MyPackage-MyModule", ["Module1"], function (module1) {
console.log(module1.localizableStrings.MyString);
});