mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-21 16:20:22 +00:00
añadida validacion en el backend para datos generales
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user