Added Multilanguage on scada buttons
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
padding: `0px`
|
||||
}"
|
||||
:disabled="!item.value.isEnabled"
|
||||
>{{item.label.textContent}}</button>
|
||||
>{{"scada_button_" + item.id | localize('scada_button_' + item.id)}}</button>
|
||||
|
||||
<div class="event-transparent"
|
||||
v-for="(item, idx) in labels(layer)"
|
||||
|
||||
Reference in New Issue
Block a user