diff --git a/Step/App_Start/Startup.cs b/Step/App_Start/Startup.cs index 982ae887..5807544c 100644 --- a/Step/App_Start/Startup.cs +++ b/Step/App_Start/Startup.cs @@ -54,7 +54,7 @@ namespace Step.App_Start if (!Directory.Exists(WEBSITE_DIRECTORY)) ExceptionManager.Manage(ERROR_LEVEL.FATAL, "Main window directory not found!"); - var options = new FileServerOptions() + var options = new FileServerOptions() { EnableDefaultFiles = !directoryBrowsing, EnableDirectoryBrowsing = directoryBrowsing, diff --git a/Step/Controllers/WebApi/LanguageController.cs b/Step/Controllers/WebApi/LanguageController.cs index 0f1ddb76..055eb880 100644 --- a/Step/Controllers/WebApi/LanguageController.cs +++ b/Step/Controllers/WebApi/LanguageController.cs @@ -260,6 +260,17 @@ namespace Step.Controllers.WebApi // default value translatedNames.Add("scada_label_" + label.Id, "scada_label_" + label.Id); } + + foreach (var button in layer.Buttons) + { + // Find selected language + var translatedValue = button.Label.TextContents.Where(y => y.LangKey == language).FirstOrDefault(); + if (translatedValue != null) + translatedNames.Add("scada_button_" + button.Id, translatedValue.TextContent); + else + // default value + translatedNames.Add("scada_button_" + button.Id, "scada_button_" + button.Id); + } } } diff --git a/Step/wwwroot/src/app_modules/scada/components/scada.vue b/Step/wwwroot/src/app_modules/scada/components/scada.vue index d9e82be1..04895469 100644 --- a/Step/wwwroot/src/app_modules/scada/components/scada.vue +++ b/Step/wwwroot/src/app_modules/scada/components/scada.vue @@ -66,7 +66,7 @@ padding: `0px` }" :disabled="!item.value.isEnabled" - >{{item.label.textContent}} + >{{"scada_button_" + item.id | localize('scada_button_' + item.id)}}