in seatunnel-server/seatunnel-dynamicform/src/main/java/org/apache/seatunnel/app/dynamicforms/FormStructureValidate.java [79:137]
private static List<String> validateLocaleOption(@NonNull FormStructure formStructure) {
List<String> errorMessageList = new ArrayList();
FormLocale locales = formStructure.getLocales();
formStructure
.getForms()
.forEach(
formOption -> {
if (formOption.getLabel().startsWith(FormLocale.I18N_PREFIX)) {
String labelName =
formOption.getLabel().replace(FormLocale.I18N_PREFIX, "");
validateOneI18nOption(
locales,
formOption.getLabel(),
"label",
labelName,
errorMessageList);
}
if (formOption.getDescription().startsWith(FormLocale.I18N_PREFIX)) {
String description =
formOption
.getDescription()
.replace(FormLocale.I18N_PREFIX, "");
validateOneI18nOption(
locales,
formOption.getLabel(),
"description",
description,
errorMessageList);
}
if (formOption.getPlaceholder().startsWith(FormLocale.I18N_PREFIX)) {
String placeholder =
formOption
.getPlaceholder()
.replace(FormLocale.I18N_PREFIX, "");
validateOneI18nOption(
locales,
formOption.getLabel(),
"placeholder",
placeholder,
errorMessageList);
}
AbstractValidate validate = formOption.getValidate();
if (validate != null
&& validate.getMessage().startsWith(FormLocale.I18N_PREFIX)) {
String message =
validate.getMessage().replace(FormLocale.I18N_PREFIX, "");
validateOneI18nOption(
locales,
formOption.getLabel(),
"validateMessage",
message,
errorMessageList);
}
});
return errorMessageList;
}