Added Multilanguage on scada buttons

This commit is contained in:
Lucio Maranta
2019-07-30 11:58:11 +02:00
parent ffa880adfb
commit 08038c33d0
3 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -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)"