añadida validacion en el backend para datos generales

This commit is contained in:
Jaime Jiménez
2025-07-28 13:03:34 +02:00
parent 14f6633b83
commit 8b34d6dca9
44 changed files with 1138 additions and 308 deletions

View File

@ -0,0 +1,22 @@
package com.imprimelibros.erp.i18n;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class TranslationService {
@Autowired
private MessageSource messageSource;
public Map<String, String> getTranslations(Locale locale, List<String> keys) {
Map<String, String> translations = new HashMap<>();
for (String key : keys) {
translations.put(key, messageSource.getMessage(key, null, locale));
}
return translations;
}
}