i18n #99
48
src/main/java/fr/titionfire/ffsaf/UserInfoProvider.java
Normal file
48
src/main/java/fr/titionfire/ffsaf/UserInfoProvider.java
Normal file
@ -0,0 +1,48 @@
|
||||
package fr.titionfire.ffsaf;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import jakarta.ws.rs.container.ContainerRequestContext;
|
||||
import jakarta.ws.rs.container.ContainerRequestFilter;
|
||||
import jakarta.ws.rs.container.PreMatching;
|
||||
import jakarta.ws.rs.ext.Provider;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@Provider
|
||||
@PreMatching
|
||||
public class UserInfoProvider implements ContainerRequestFilter {
|
||||
|
||||
private static final List<Locale> SUPPORTED_LANGUAGES = Arrays.asList(
|
||||
Locale.FRENCH,
|
||||
Locale.ENGLISH
|
||||
);
|
||||
|
||||
@Override
|
||||
public void filter(ContainerRequestContext requestContext) {
|
||||
List<Locale> acceptableLanguages = requestContext.getAcceptableLanguages();
|
||||
Locale selectedLocale = findFirstSupportedLanguage(acceptableLanguages);
|
||||
|
||||
if (selectedLocale == null)
|
||||
selectedLocale = TradService.fallbackLocale;
|
||||
requestContext.setProperty("userLocale", selectedLocale);
|
||||
}
|
||||
|
||||
private Locale findFirstSupportedLanguage(List<Locale> acceptableLanguages) {
|
||||
for (Locale acceptableLanguage : acceptableLanguages) {
|
||||
// Vérifie si la langue est dans la liste des langues supportées
|
||||
if (SUPPORTED_LANGUAGES.contains(acceptableLanguage)) {
|
||||
return acceptableLanguage;
|
||||
}
|
||||
// Vérifie aussi par tag de langue (ex: "fr-FR" -> "fr")
|
||||
String languageTag = acceptableLanguage.getLanguage();
|
||||
for (Locale supportedLanguage : SUPPORTED_LANGUAGES) {
|
||||
if (supportedLanguage.getLanguage().equals(languageTag)) {
|
||||
return supportedLanguage;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -79,6 +79,9 @@ public class AffiliationService {
|
||||
@ConfigProperty(name = "notif.affRequest.mail")
|
||||
List<String> mails;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public Uni<List<AffiliationRequestModel>> getAllReq() {
|
||||
return repositoryRequest.listAll();
|
||||
}
|
||||
@ -92,7 +95,7 @@ public class AffiliationService {
|
||||
return Uni.createFrom().item(affModel)
|
||||
.invoke(Unchecked.consumer(model -> {
|
||||
if (model.getSaison() != currentSaison && model.getSaison() != currentSaison + 1) {
|
||||
throw new DBadRequestException("Saison non valid");
|
||||
throw new DBadRequestException(trad.t("saison.non.valid"));
|
||||
}
|
||||
}))
|
||||
.chain(() -> ((affModel.getState_id().charAt(0) == 'W') ? stateIdService.get_rna(
|
||||
@ -110,7 +113,7 @@ public class AffiliationService {
|
||||
out, affModel.getSaison()))
|
||||
.onItem().invoke(Unchecked.consumer(count -> {
|
||||
if (count != 0 && unique) {
|
||||
throw new DBadRequestException("Demande d'affiliation déjà existante");
|
||||
throw new DBadRequestException(trad.t("demande.d.affiliation.deja.existante"));
|
||||
}
|
||||
}))
|
||||
)
|
||||
@ -118,28 +121,28 @@ public class AffiliationService {
|
||||
repository.count("club = ?1 and saison = ?2", club, affModel.getSaison())))
|
||||
.onItem().invoke(Unchecked.consumer(count -> {
|
||||
if (count != 0) {
|
||||
throw new DBadRequestException("Affiliation déjà existante");
|
||||
throw new DBadRequestException(trad.t("affiliation.deja.existante"));
|
||||
}
|
||||
}))
|
||||
.map(o -> affModel)
|
||||
.call(model -> ((model.getM1_lincence() != -1) ? combRepository.find("licence",
|
||||
model.getM1_lincence()).count().invoke(Unchecked.consumer(count -> {
|
||||
if (count == 0) {
|
||||
throw new DBadRequestException("Licence membre n°1 inconnue");
|
||||
throw new DBadRequestException(trad.t("licence.membre.n.1.inconnue"));
|
||||
}
|
||||
})) : Uni.createFrom().nullItem())
|
||||
)
|
||||
.call(model -> ((model.getM2_lincence() != -1) ? combRepository.find("licence",
|
||||
model.getM2_lincence()).count().invoke(Unchecked.consumer(count -> {
|
||||
if (count == 0) {
|
||||
throw new DBadRequestException("Licence membre n°2 inconnue");
|
||||
throw new DBadRequestException(trad.t("licence.membre.n.2.inconnue"));
|
||||
}
|
||||
})) : Uni.createFrom().nullItem())
|
||||
)
|
||||
.call(model -> ((model.getM3_lincence() != -1) ? combRepository.find("licence",
|
||||
model.getM3_lincence()).count().invoke(Unchecked.consumer(count -> {
|
||||
if (count == 0) {
|
||||
throw new DBadRequestException("Licence membre n°3 inconnue");
|
||||
throw new DBadRequestException(trad.t("licence.membre.n.3.inconnue"));
|
||||
}
|
||||
})) : Uni.createFrom().nullItem())
|
||||
);
|
||||
@ -148,7 +151,7 @@ public class AffiliationService {
|
||||
public Uni<?> saveEdit(AffiliationRequestForm form) {
|
||||
return pre_save(form, false)
|
||||
.chain(model -> repositoryRequest.findById(form.getId())
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Demande d'affiliation non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("demande.d.affiliation.non.trouve")))
|
||||
.chain(origine -> {
|
||||
origine.setName(model.getName());
|
||||
origine.setAddress(model.getAddress());
|
||||
@ -201,7 +204,7 @@ public class AffiliationService {
|
||||
LOGGER.debug(form.toString());
|
||||
|
||||
return repositoryRequest.findById(form.getId())
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Demande d'affiliation non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("demande.d.affiliation.non.trouve")))
|
||||
.map(model -> {
|
||||
model.setName(form.getName());
|
||||
model.setState_id(form.getState_id());
|
||||
@ -306,7 +309,7 @@ public class AffiliationService {
|
||||
LOGGER.debug(form.toString());
|
||||
|
||||
return repositoryRequest.findById(form.getId())
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Demande d'affiliation non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("demande.d.affiliation.non.trouve")))
|
||||
.chain(req ->
|
||||
clubRepository.find("StateId = ?1", form.getState_id()).firstResult()
|
||||
.chain(model -> (model == null) ? acceptNew(form, req) : acceptOld(form, req, model))
|
||||
@ -398,7 +401,7 @@ public class AffiliationService {
|
||||
|
||||
public Uni<SimpleReqAffiliation> getRequest(long id) {
|
||||
return repositoryRequest.findById(id).map(SimpleReqAffiliation::fromModel)
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Demande d'affiliation non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("demande.d.affiliation.non.trouve")))
|
||||
.call(out -> clubRepository.find("StateId = ?1", out.getStateId()).firstResult().invoke(c -> {
|
||||
if (c != null) {
|
||||
out.setClub(c.getId());
|
||||
@ -422,7 +425,7 @@ public class AffiliationService {
|
||||
|
||||
public Uni<List<SimpleAffiliation>> getAffiliation(long id) {
|
||||
return clubRepository.findById(id)
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Club non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("club.non.trouve")))
|
||||
.call(model -> Mutiny.fetch(model.getAffiliations()))
|
||||
.chain(model -> repositoryRequest.list("state_id = ?1", model.getStateId())
|
||||
.map(reqs -> reqs.stream().map(req ->
|
||||
@ -434,11 +437,11 @@ public class AffiliationService {
|
||||
|
||||
public Uni<SimpleAffiliation> setAffiliation(long id, int saison) {
|
||||
return clubRepository.findById(id)
|
||||
.onItem().ifNull().failWith(new DNotFoundException("Club non trouvé"))
|
||||
.onItem().ifNull().failWith(new DNotFoundException(trad.t("club.non.trouve")))
|
||||
.call(model -> Mutiny.fetch(model.getAffiliations()))
|
||||
.invoke(Unchecked.consumer(club -> {
|
||||
if (club.getAffiliations().stream().anyMatch(affiliation -> affiliation.getSaison() == saison)) {
|
||||
throw new DBadRequestException("Affiliation déjà existante");
|
||||
throw new DBadRequestException(trad.t("affiliation.deja.existante"));
|
||||
}
|
||||
}))
|
||||
.chain(club ->
|
||||
|
||||
@ -45,10 +45,13 @@ public class CategoryService {
|
||||
@Inject
|
||||
CompetitionGuestRepository competitionGuestRepository;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public Uni<CategoryData> getByIdAdmin(SecurityCtx securityCtx, CompetitionSystem system, Long id) {
|
||||
return repository.find("systemId = ?1 AND system = ?2", id, system)
|
||||
.firstResult()
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException("Category not found"))
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException(trad.t("categorie.non.trouver")))
|
||||
.call(data -> permService.hasAdminViewPerm(securityCtx, data.getCompet()))
|
||||
.map(CategoryData::fromModel);
|
||||
}
|
||||
@ -64,7 +67,7 @@ public class CategoryService {
|
||||
.chain(o -> {
|
||||
if (o == null) {
|
||||
return competRepository.findById(data.getCompet())
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException("Competition not found"))
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException(trad.t("competition.not.found")))
|
||||
.call(o2 -> permService.hasEditPerm(securityCtx, o2))
|
||||
.chain(competitionModel -> {
|
||||
CategoryModel model = new CategoryModel();
|
||||
@ -139,7 +142,7 @@ public class CategoryService {
|
||||
.onItem().ifNotNull().call(o2 -> permService.hasEditPerm(securityCtx, o2.getCompet()))
|
||||
.onItem().ifNull().switchTo(
|
||||
() -> competRepository.findById(data.getCompet())
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException("Compet not found"))
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException(trad.t("competition.not.found")))
|
||||
.call(o -> permService.hasEditPerm(securityCtx, o))
|
||||
.map(o -> {
|
||||
CategoryModel model = new CategoryModel();
|
||||
@ -256,7 +259,7 @@ public class CategoryService {
|
||||
|
||||
public Uni<?> delete(SecurityCtx securityCtx, CompetitionSystem system, Long id) {
|
||||
return repository.find("systemId = ?1 AND system = ?2", id, system).firstResult()
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException("Category not found"))
|
||||
.onItem().ifNull().failWith(() -> new RuntimeException(trad.t("categorie.non.trouver")))
|
||||
.call(o -> permService.hasEditPerm(securityCtx, o.getCompet()))
|
||||
.call(o -> Mutiny.fetch(o.getTree())
|
||||
.call(o2 -> o2.isEmpty() ? Uni.createFrom().nullItem() :
|
||||
|
||||
@ -63,6 +63,9 @@ public class ClubService {
|
||||
@Inject
|
||||
LoggerService ls;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public SimpleClubModel findByIdOptionalClub(long id) throws Throwable {
|
||||
return VertxContextSupport.subscribeAndAwait(
|
||||
() -> Panache.withTransaction(() -> repository.findById(id).map(SimpleClubModel::fromModel)));
|
||||
@ -130,7 +133,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
}))
|
||||
.map(MembreModel::getClub)
|
||||
.call(club -> Mutiny.fetch(club.getContact()));
|
||||
@ -150,7 +153,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
if (!securityCtx.isInClubGroup(m.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
}))
|
||||
@ -166,7 +169,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
if (!securityCtx.isInClubGroup(m.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
}))
|
||||
@ -183,7 +186,7 @@ public class ClubService {
|
||||
ls.logUpdate("Contact(s)...", club);
|
||||
club.setContact(MAPPER.readValue(form.getContact(), typeRef));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new DBadRequestException("Erreur de format des contacts");
|
||||
throw new DBadRequestException(trad.t("erreur.de.format.des.contacts"));
|
||||
}
|
||||
|
||||
ls.logChange("Lieux d'entrainements", club.getTraining_location(), form.getTraining_location(),
|
||||
@ -233,7 +236,7 @@ public class ClubService {
|
||||
ls.logUpdate("Contact(s)...", m);
|
||||
m.setContact(MAPPER.readValue(input.getContact(), typeRef));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new DBadRequestException("Erreur de format des contacts");
|
||||
throw new DBadRequestException(trad.t("erreur.de.format.des.contacts"));
|
||||
}
|
||||
}
|
||||
return Panache.withTransaction(() -> repository.persist(m)).call(() -> ls.append());
|
||||
|
||||
@ -97,6 +97,9 @@ public class CompetitionService {
|
||||
@CacheName("have-access")
|
||||
Cache cacheNoneAccess;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public Uni<CompetitionData> getById(SecurityCtx securityCtx, Long id) {
|
||||
return permService.hasViewPerm(securityCtx, id).map(cm -> {
|
||||
CompetitionData out = CompetitionData.fromModelLight(cm);
|
||||
@ -192,7 +195,7 @@ public class CompetitionService {
|
||||
.invoke(Unchecked.consumer(combModel -> {
|
||||
if (!securityCtx.getRoles().contains("create_compet") && !securityCtx.getRoles()
|
||||
.contains("federation_admin"))
|
||||
throw new DForbiddenException("Vous ne pouvez pas créer de compétition");
|
||||
throw new DForbiddenException(trad.t("vous.ne.pouvez.pas.creer.de.competition"));
|
||||
}))
|
||||
.map(MembreModel::getClub)
|
||||
.chain(clubModel -> {
|
||||
@ -223,7 +226,8 @@ public class CompetitionService {
|
||||
keycloakService.getUser(data.getOwner()).map(UserRepresentation::getId).orElse(null))
|
||||
.invoke(Unchecked.consumer(newOwner -> {
|
||||
if (newOwner == null)
|
||||
throw new DBadRequestException("User " + data.getOwner() + " not found");
|
||||
throw new DBadRequestException(
|
||||
String.format(trad.t("user.not.found"), data.getOwner()));
|
||||
if (!newOwner.equals(model.getOwner())) {
|
||||
if (!securityCtx.roleHas("federation_admin")
|
||||
&& !securityCtx.roleHas("safca_super_admin")
|
||||
@ -342,7 +346,7 @@ public class CompetitionService {
|
||||
|| !securityCtx.isClubAdmin())
|
||||
throw new DForbiddenException();
|
||||
if (new Date().before(cm.getStartRegister()) || new Date().after(cm.getEndRegister()))
|
||||
throw new DBadRequestException("Inscription fermée");
|
||||
throw new DBadRequestException(trad.t("inscription.fermee"));
|
||||
}))
|
||||
.chain(c -> findComb(data.getLicence(), data.getFname(), data.getLname())
|
||||
.call(combModel -> Mutiny.fetch(combModel.getLicences()))
|
||||
@ -350,8 +354,7 @@ public class CompetitionService {
|
||||
if (!securityCtx.isInClubGroup(model.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
if (c.getBanMembre().contains(model.getId()))
|
||||
throw new DForbiddenException(
|
||||
"Vous n'avez pas le droit d'inscrire ce membre (par décision de l'administrateur de la compétition)");
|
||||
throw new DForbiddenException(trad.t("insc.err1"));
|
||||
}))
|
||||
.chain(combModel -> updateRegister(data, c, combModel, false)))
|
||||
.map(r -> SimpleRegisterComb.fromModel(r, r.getMembre().getLicences()));
|
||||
@ -361,13 +364,12 @@ public class CompetitionService {
|
||||
if (cm.getRegisterMode() != RegisterMode.FREE)
|
||||
throw new DForbiddenException();
|
||||
if (new Date().before(cm.getStartRegister()) || new Date().after(cm.getEndRegister()))
|
||||
throw new DBadRequestException("Inscription fermée");
|
||||
throw new DBadRequestException(trad.t("inscription.fermee"));
|
||||
}))
|
||||
.chain(c -> membreService.getByAccountId(securityCtx.getSubject())
|
||||
.invoke(Unchecked.consumer(model -> {
|
||||
if (c.getBanMembre().contains(model.getId()))
|
||||
throw new DForbiddenException(
|
||||
"Vous n'avez pas le droit de vous inscrire (par décision de l'administrateur de la compétition)");
|
||||
throw new DForbiddenException(trad.t("insc.err2"));
|
||||
}))
|
||||
.chain(combModel -> updateRegister(data, c, combModel, false)))
|
||||
.map(r -> SimpleRegisterComb.fromModel(r, List.of()));
|
||||
@ -380,8 +382,7 @@ public class CompetitionService {
|
||||
.map(Unchecked.function(r -> {
|
||||
if (r != null) {
|
||||
if (!admin && r.isLockEdit())
|
||||
throw new DForbiddenException(
|
||||
"Modification bloquée par l'administrateur de la compétition");
|
||||
throw new DForbiddenException(trad.t("insc.err3"));
|
||||
r.setWeight(data.getWeight());
|
||||
r.setOverCategory(data.getOverCategory());
|
||||
r.setCategorie(
|
||||
@ -424,17 +425,17 @@ public class CompetitionService {
|
||||
return combRepository.find("licence = ?1", licence).firstResult()
|
||||
.invoke(Unchecked.consumer(combModel -> {
|
||||
if (combModel == null)
|
||||
throw new DForbiddenException("Licence " + licence + " non trouvé");
|
||||
throw new DForbiddenException(String.format(trad.t("licence.non.trouve"), licence));
|
||||
}));
|
||||
} else {
|
||||
if (fname == null || lname == null)
|
||||
return Uni.createFrom().failure(new DBadRequestException("Nom et prénom requis"));
|
||||
return Uni.createFrom().failure(new DBadRequestException(trad.t("nom.et.prenom.requis")));
|
||||
return combRepository.find("unaccent(lname) ILIKE unaccent(?1) AND unaccent(fname) ILIKE unaccent(?2)",
|
||||
lname,
|
||||
fname).firstResult()
|
||||
.invoke(Unchecked.consumer(combModel -> {
|
||||
if (combModel == null)
|
||||
throw new DForbiddenException("Combattant " + fname + " " + lname + " non trouvé");
|
||||
throw new DForbiddenException(String.format(trad.t("combattant.non.trouve"), fname, lname));
|
||||
}));
|
||||
}
|
||||
}
|
||||
@ -461,12 +462,12 @@ public class CompetitionService {
|
||||
|| !securityCtx.isClubAdmin())
|
||||
throw new DForbiddenException();
|
||||
if (new Date().before(cm.getStartRegister()) || new Date().after(cm.getEndRegister()))
|
||||
throw new DBadRequestException("Inscription fermée");
|
||||
throw new DBadRequestException(trad.t("inscription.fermee"));
|
||||
}))
|
||||
.call(cm -> membreService.getById(combId)
|
||||
.invoke(Unchecked.consumer(model -> {
|
||||
if (model == null)
|
||||
throw new DNotFoundException("Membre " + combId + " n'existe pas");
|
||||
throw new DNotFoundException(String.format(trad.t("le.membre.n.existe.pas"), combId));
|
||||
if (!securityCtx.isInClubGroup(model.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
})))
|
||||
@ -478,7 +479,7 @@ public class CompetitionService {
|
||||
if (cm.getRegisterMode() != RegisterMode.FREE || !Objects.equals(model.getId(), combId))
|
||||
throw new DForbiddenException();
|
||||
if (new Date().before(cm.getStartRegister()) || new Date().after(cm.getEndRegister()))
|
||||
throw new DBadRequestException("Inscription fermée");
|
||||
throw new DBadRequestException(trad.t("inscription.fermee"));
|
||||
})))
|
||||
.chain(c -> deleteRegister(combId, c, false));
|
||||
}
|
||||
@ -486,7 +487,7 @@ public class CompetitionService {
|
||||
private Uni<Void> deleteRegister(Long combId, CompetitionModel c, boolean admin) {
|
||||
if (admin && combId < 0) {
|
||||
return competitionGuestRepository.find("competition = ?1 AND id = ?2", c, combId * -1).firstResult()
|
||||
.onFailure().transform(t -> new DBadRequestException("Combattant non inscrit"))
|
||||
.onFailure().transform(t -> new DBadRequestException(trad.t("combattant.non.inscrit")))
|
||||
.call(Unchecked.function(
|
||||
model -> Panache.withTransaction(() -> competitionGuestRepository.delete(model))
|
||||
.call(r -> c.getSystem() == CompetitionSystem.INTERNAL ?
|
||||
@ -495,10 +496,10 @@ public class CompetitionService {
|
||||
.replaceWithVoid();
|
||||
}
|
||||
return registerRepository.find("competition = ?1 AND membre.id = ?2", c, combId).firstResult()
|
||||
.onFailure().transform(t -> new DBadRequestException("Combattant non inscrit"))
|
||||
.onFailure().transform(t -> new DBadRequestException(trad.t("combattant.non.inscrit")))
|
||||
.call(Unchecked.function(registerModel -> {
|
||||
if (!admin && registerModel.isLockEdit())
|
||||
throw new DForbiddenException("Modification bloquée par l'administrateur de la compétition");
|
||||
throw new DForbiddenException(trad.t("insc.err3"));
|
||||
return Panache.withTransaction(() -> registerRepository.delete(registerModel))
|
||||
.call(r -> c.getSystem() == CompetitionSystem.INTERNAL ?
|
||||
sRegister.sendRegisterRemove(c.getUuid(), combId) : Uni.createFrom().voidItem());
|
||||
@ -533,7 +534,7 @@ public class CompetitionService {
|
||||
return permService.hasEditPerm(securityCtx, id)
|
||||
.invoke(Unchecked.consumer(cm -> {
|
||||
if (cm.getSystem() != CompetitionSystem.INTERNAL)
|
||||
throw new DBadRequestException("Competition is not INTERNAL");
|
||||
throw new DBadRequestException(trad.t("competition.is.not.internal"));
|
||||
}))
|
||||
.chain(competitionModel -> {
|
||||
SimpleCompetData data = SimpleCompetData.fromModel(competitionModel);
|
||||
@ -559,7 +560,7 @@ public class CompetitionService {
|
||||
return permService.hasEditPerm(securityCtx, data.getId())
|
||||
.invoke(Unchecked.consumer(cm -> {
|
||||
if (cm.getSystem() != CompetitionSystem.INTERNAL)
|
||||
throw new DBadRequestException("Competition is not INTERNAL");
|
||||
throw new DBadRequestException(trad.t("competition.is.not.internal"));
|
||||
}))
|
||||
.chain(cm -> vertx.getOrCreateContext().executeBlocking(() -> {
|
||||
ArrayList<String> admin = new ArrayList<>();
|
||||
@ -567,13 +568,13 @@ public class CompetitionService {
|
||||
for (String username : data.getAdmin()) {
|
||||
Optional<UserRepresentation> opt = keycloakService.getUser(username);
|
||||
if (opt.isEmpty())
|
||||
throw new DBadRequestException("User " + username + " not found");
|
||||
throw new DBadRequestException(String.format(trad.t("user.not.found"), username));
|
||||
admin.add(opt.get().getId());
|
||||
}
|
||||
for (String username : data.getTable()) {
|
||||
Optional<UserRepresentation> opt = keycloakService.getUser(username);
|
||||
if (opt.isEmpty())
|
||||
throw new DBadRequestException("User " + username + " not found");
|
||||
throw new DBadRequestException(String.format(trad.t("user.not.found"), username));
|
||||
table.add(opt.get().getId());
|
||||
}
|
||||
|
||||
@ -623,13 +624,13 @@ public class CompetitionService {
|
||||
for (String username : data.getAdmin()) {
|
||||
Optional<UserRepresentation> opt = keycloakService.getUser(username);
|
||||
if (opt.isEmpty())
|
||||
throw new DBadRequestException("User " + username + " not found");
|
||||
throw new DBadRequestException(String.format(trad.t("user.not.found"), username));
|
||||
admin.add(UUID.fromString(opt.get().getId()));
|
||||
}
|
||||
for (String username : data.getTable()) {
|
||||
Optional<UserRepresentation> opt = keycloakService.getUser(username);
|
||||
if (opt.isEmpty())
|
||||
throw new DBadRequestException("User " + username + " not found");
|
||||
throw new DBadRequestException(String.format(trad.t("user.not.found"), username));
|
||||
table.add(UUID.fromString(opt.get().getId()));
|
||||
}
|
||||
|
||||
|
||||
@ -47,6 +47,9 @@ public class LicenceService {
|
||||
@Inject
|
||||
CheckoutService checkoutService;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public Uni<List<LicenceModel>> getLicence(long id, Consumer<MembreModel> checkPerm) {
|
||||
return combRepository.findById(id).invoke(checkPerm)
|
||||
.chain(combRepository -> Mutiny.fetch(combRepository.getLicences()));
|
||||
@ -157,7 +160,7 @@ public class LicenceService {
|
||||
return repository.list("membre.id IN ?1 AND saison = ?2 AND pay = FALSE", ids, Utils.getSaison())
|
||||
.invoke(Unchecked.consumer(models -> {
|
||||
if (models.size() != ids.size())
|
||||
throw new DBadRequestException("Erreur lors de la sélection des membres");
|
||||
throw new DBadRequestException(trad.t("erreur.lors.de.la.selection.des.membres"));
|
||||
}))
|
||||
.call(models -> {
|
||||
Uni<?> uni = Uni.createFrom().nullItem();
|
||||
@ -174,7 +177,7 @@ public class LicenceService {
|
||||
.call(__ -> checkoutService.canDeleteLicence(id)
|
||||
.invoke(Unchecked.consumer(b -> {
|
||||
if (!b) throw new DBadRequestException(
|
||||
"Impossible de supprimer une licence pour laquelle un paiement est en cours");
|
||||
trad.t("licence.rm.err1"));
|
||||
})))
|
||||
.call(model -> ls.logADelete(model))
|
||||
.chain(model -> Panache.withTransaction(() -> repository.delete(model)));
|
||||
@ -186,7 +189,7 @@ public class LicenceService {
|
||||
return repository.find("saison = ?1 AND membre = ?2", Utils.getSaison(), membreModel).count()
|
||||
.invoke(Unchecked.consumer(count -> {
|
||||
if (count > 0)
|
||||
throw new DBadRequestException("Licence déjà demandée");
|
||||
throw new DBadRequestException(trad.t("licence.deja.demandee"));
|
||||
})).chain(__ -> combRepository.findById(id).chain(membreModel2 -> {
|
||||
LicenceModel model = new LicenceModel();
|
||||
model.setClub_id((membreModel2.getClub() == null) ? null : membreModel2.getClub().getId());
|
||||
@ -215,13 +218,13 @@ public class LicenceService {
|
||||
.call(__ -> checkoutService.canDeleteLicence(id)
|
||||
.invoke(Unchecked.consumer(b -> {
|
||||
if (!b) throw new DBadRequestException(
|
||||
"Impossible de supprimer une licence pour laquelle un paiement est en cours");
|
||||
trad.t("licence.rm.err1"));
|
||||
})))
|
||||
.invoke(Unchecked.consumer(licenceModel -> {
|
||||
if (licenceModel.isValidate())
|
||||
throw new DBadRequestException("Impossible de supprimer une licence déjà validée");
|
||||
throw new DBadRequestException(trad.t("impossible.de.supprimer.une.licence.deja.validee"));
|
||||
if (licenceModel.isPay())
|
||||
throw new DBadRequestException("Impossible de supprimer une licence déjà payée");
|
||||
throw new DBadRequestException(trad.t("impossible.de.supprimer.une.licence.deja.payee"));
|
||||
}))
|
||||
.call(model -> ls.logADelete(model))
|
||||
.chain(__ -> Panache.withTransaction(() -> repository.deleteById(id)));
|
||||
|
||||
@ -62,6 +62,9 @@ public class MembreService {
|
||||
@Inject
|
||||
LoggerService ls;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public SimpleCombModel find(int licence, String np) throws Throwable {
|
||||
return VertxContextSupport.subscribeAndAwait(() -> Panache.withTransaction(() ->
|
||||
repository.find(
|
||||
@ -177,7 +180,7 @@ public class MembreService {
|
||||
|
||||
Sort sort = getSort(order);
|
||||
if (sort == null)
|
||||
return Uni.createFrom().failure(new DInternalError("Erreur lors calcul du trie"));
|
||||
return Uni.createFrom().failure(new DInternalError(trad.t("erreur.lors.calcul.du.trie")));
|
||||
|
||||
String finalSearch = search;
|
||||
return getLicenceListe(licenceRequest, payState)
|
||||
@ -196,7 +199,7 @@ public class MembreService {
|
||||
.call(result -> query.count().invoke(result::setResult_count))
|
||||
.call(result -> query.pageCount()
|
||||
.invoke(Unchecked.consumer(pages -> {
|
||||
if (page > pages) throw new DBadRequestException("Page out of range");
|
||||
if (page > pages) throw new DBadRequestException(trad.t("page.out.of.range"));
|
||||
}))
|
||||
.invoke(result::setPage_count))
|
||||
.call(result -> query.page(Page.of(page, limit)).list()
|
||||
@ -241,8 +244,8 @@ public class MembreService {
|
||||
for (MembreModel membreModel : membres) {
|
||||
if (!Objects.equals(membreModel.getClub(), clubModel.get())) {
|
||||
LOGGER.info("Similar membres found: " + membreModel);
|
||||
throw new DForbiddenException(
|
||||
"Le membre n°" + membreModel.getLicence() + " n'appartient pas à votre club");
|
||||
throw new DForbiddenException(String.format(trad.t("le.membre.appartient.pas.a.votre.club"),
|
||||
membreModel.getLicence()));
|
||||
}
|
||||
}
|
||||
Uni<Void> uniResult = Uni.createFrom().voidItem();
|
||||
@ -269,7 +272,8 @@ public class MembreService {
|
||||
if (model.getLicence() != null && !model.getLicence().equals(dataIn.getLicence())) {
|
||||
LOGGER.info("Similar membres found: " + model);
|
||||
throw new DBadRequestException(
|
||||
"Email '" + model.getEmail() + "' déja utilisé par " + model.getFname() + " " + model.getFname());
|
||||
String.format(trad.t("email.deja.utilise.par"), model.getEmail(),
|
||||
model.getFname(), model.getLname()));
|
||||
}
|
||||
|
||||
if (StringSimilarity.similarity(model.getLname().toUpperCase(),
|
||||
@ -277,7 +281,8 @@ public class MembreService {
|
||||
model.getFname().toUpperCase(), dataIn.getPrenom().toUpperCase()) > 3) {
|
||||
LOGGER.info("Similar membres found: " + model);
|
||||
throw new DBadRequestException(
|
||||
"Email '" + model.getEmail() + "' déja utilisé par " + model.getFname() + " " + model.getFname());
|
||||
String.format(trad.t("email.deja.utilise.par"), model.getEmail(),
|
||||
model.getFname(), model.getLname()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,8 +293,8 @@ public class MembreService {
|
||||
model.getFname().toUpperCase(), dataIn.getPrenom().toUpperCase()) > 3)) {
|
||||
LOGGER.info("Similar membres found: " + model);
|
||||
throw new DBadRequestException(
|
||||
"Pour enregistrer un nouveau membre, veuillez laisser le champ licence vide. (tentative de changement non-autotiser de nom sur la licence "
|
||||
+ model.getLicence() + " pour " + model.getFname() + " " + model.getFname() + ")");
|
||||
String.format(trad.t("try.edit.licence"), model.getLicence(), model.getFname(),
|
||||
model.getFname()));
|
||||
}
|
||||
|
||||
ls.logChange("Nom", model.getLname(), dataIn.getNom().toUpperCase(), model);
|
||||
@ -363,7 +368,7 @@ public class MembreService {
|
||||
.call(__ -> repository.count("email LIKE ?1 AND id != ?2", membre.getEmail(), id)
|
||||
.invoke(Unchecked.consumer(c -> {
|
||||
if (c > 0 && !membre.getEmail().isBlank())
|
||||
throw new DBadRequestException("Email déjà utilisé");
|
||||
throw new DBadRequestException(trad.t("email.deja.utilise"));
|
||||
})))
|
||||
.chain(membreModel -> clubRepository.findById(membre.getClub())
|
||||
.map(club -> new Pair<>(membreModel, club)))
|
||||
@ -385,7 +390,7 @@ public class MembreService {
|
||||
.call(__ -> repository.count("email LIKE ?1 AND id != ?2", membre.getEmail(), id)
|
||||
.invoke(Unchecked.consumer(c -> {
|
||||
if (c > 0 && !membre.getEmail().isBlank())
|
||||
throw new DBadRequestException("Email déjà utilisé");
|
||||
throw new DBadRequestException(trad.t("email.deja.utilise"));
|
||||
})))
|
||||
.invoke(Unchecked.consumer(membreModel -> {
|
||||
if (!securityCtx.isInClubGroup(membreModel.getClub().getId()))
|
||||
@ -394,7 +399,7 @@ public class MembreService {
|
||||
membre.getLname().toUpperCase()) > 3 || StringSimilarity.similarity(
|
||||
membreModel.getFname().toUpperCase(), membre.getFname().toUpperCase()) > 3) {
|
||||
throw new DBadRequestException(
|
||||
"Pour enregistrer un nouveau membre, veuillez utilisez le bouton prévue a cette effet.");
|
||||
trad.t("regiter.new.membre"));
|
||||
}
|
||||
}))
|
||||
.invoke(Unchecked.consumer(membreModel -> {
|
||||
@ -403,7 +408,7 @@ public class MembreService {
|
||||
else if (securityCtx.roleHas("club_secretaire")) source = RoleAsso.SECRETAIRE;
|
||||
else if (securityCtx.roleHas("club_respo_intra")) source = RoleAsso.MEMBREBUREAU;
|
||||
if (!membre.getRole().equals(membreModel.getRole()) && membre.getRole().level >= source.level)
|
||||
throw new DForbiddenException("Permission insuffisante");
|
||||
throw new DForbiddenException(trad.t("permission.insuffisante"));
|
||||
}))
|
||||
.onItem().transform(target -> {
|
||||
if (!securityCtx.getSubject().equals(target.getUserId())) {
|
||||
@ -477,7 +482,7 @@ public class MembreService {
|
||||
.call(__ -> repository.count("email LIKE ?1", input.getEmail())
|
||||
.invoke(Unchecked.consumer(c -> {
|
||||
if (c > 0 && input.getEmail() != null && !input.getEmail().isBlank())
|
||||
throw new DBadRequestException("Email déjà utilisé");
|
||||
throw new DBadRequestException(trad.t("email.deja.utilise"));
|
||||
})))
|
||||
.chain(clubModel -> {
|
||||
MembreModel model = getMembreModel(input, clubModel);
|
||||
@ -493,7 +498,7 @@ public class MembreService {
|
||||
return repository.find("userId = ?1", subject).firstResult()
|
||||
.call(__ -> repository.count("email LIKE ?1", input.getEmail())
|
||||
.invoke(Unchecked.consumer(c -> {
|
||||
if (c > 0) throw new DBadRequestException("Email déjà utilisé");
|
||||
if (c > 0) throw new DBadRequestException(trad.t("email.deja.utilise"));
|
||||
})))
|
||||
.call(membreModel ->
|
||||
repository.count(
|
||||
@ -501,7 +506,7 @@ public class MembreService {
|
||||
input.getLname(), input.getFname(), membreModel.getClub())
|
||||
.invoke(Unchecked.consumer(c -> {
|
||||
if (c > 0)
|
||||
throw new DBadRequestException("Membre déjà existent");
|
||||
throw new DBadRequestException(trad.t("membre.deja.existent"));
|
||||
})))
|
||||
.chain(membreModel -> {
|
||||
MembreModel model = getMembreModel(input, membreModel.getClub());
|
||||
@ -534,13 +539,13 @@ public class MembreService {
|
||||
.invoke(Unchecked.consumer(membreModel -> {
|
||||
if (membreModel.getLicence() != null) {
|
||||
throw new DBadRequestException(
|
||||
"Impossible de supprimer un membre qui a déjà un numéro de licence");
|
||||
trad.t("membre.rm.err1"));
|
||||
}
|
||||
}))
|
||||
.call(membreModel -> licenceRepository.find("membre = ?1", membreModel).count()
|
||||
.invoke(Unchecked.consumer(l -> {
|
||||
if (l > 0)
|
||||
throw new DBadRequestException("Impossible de supprimer un membre avec des licences");
|
||||
throw new DBadRequestException(trad.t("membre.rm.err2"));
|
||||
})))
|
||||
.call(membreModel -> (membreModel.getUserId() != null) ?
|
||||
keycloakService.removeAccount(membreModel.getUserId()) : Uni.createFrom().nullItem())
|
||||
@ -586,7 +591,7 @@ public class MembreService {
|
||||
public Uni<MeData> getMembre(String subject) {
|
||||
MeData meData = new MeData();
|
||||
return repository.find("userId = ?1", subject).firstResult()
|
||||
.invoke(meData::setMembre)
|
||||
.invoke(m -> meData.setMembre(m, trad))
|
||||
.call(membreModel -> Mutiny.fetch(membreModel.getLicences())
|
||||
.map(licences -> licences.stream().map(SimpleLicence::fromModel).toList())
|
||||
.invoke(meData::setLicences))
|
||||
|
||||
@ -46,6 +46,9 @@ public class PDFService {
|
||||
@ConfigProperty(name = "pdf-maker.sign-file")
|
||||
String sign_file;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
|
||||
public Uni<Response> getLicencePdf(String subject) {
|
||||
return getLicencePdf(combRepository.find("userId = ?1", subject).firstResult()
|
||||
@ -58,7 +61,7 @@ public class PDFService {
|
||||
LicenceModel licence = m.getLicences().stream()
|
||||
.filter(licenceModel -> licenceModel.getSaison() == Utils.getSaison() && licenceModel.isValidate())
|
||||
.findFirst()
|
||||
.orElseThrow(() -> new DNotFoundException("Pas de licence pour la saison en cours"));
|
||||
.orElseThrow(() -> new DNotFoundException(trad.t("pas.de.licence.pour.la.saison.en.cours")));
|
||||
|
||||
try {
|
||||
byte[] buff = make_pdf(m, licence);
|
||||
@ -119,7 +122,7 @@ public class PDFService {
|
||||
combRepository.find("userId = ?1", subject).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
}))
|
||||
.map(MembreModel::getClub)
|
||||
.call(m -> Mutiny.fetch(m.getAffiliations())));
|
||||
@ -130,7 +133,7 @@ public class PDFService {
|
||||
clubRepository.findById(id)
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
}))
|
||||
.call(m -> Mutiny.fetch(m.getAffiliations())));
|
||||
}
|
||||
@ -141,7 +144,7 @@ public class PDFService {
|
||||
.map(Unchecked.function(m -> {
|
||||
if (m.getAffiliations().stream()
|
||||
.noneMatch(licenceModel -> licenceModel.getSaison() == Utils.getSaison()))
|
||||
throw new DNotFoundException("Pas d'affiliation pour la saison en cours");
|
||||
throw new DNotFoundException(trad.t("pas.d.affiliation.pour.la.saison.en.cours"));
|
||||
|
||||
try {
|
||||
byte[] buff = make_pdf(m);
|
||||
|
||||
@ -45,7 +45,8 @@ public class ResultService {
|
||||
@Inject
|
||||
MatchRepository matchRepository;
|
||||
|
||||
private static final ResourceBundle BUNDLE = ResourceBundle.getBundle("lang.String");
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
private static final HashMap<Long, String> combTempIds = new HashMap<>();
|
||||
|
||||
@ -289,17 +290,17 @@ public class ResultService {
|
||||
if (register.isPresent()) {
|
||||
categorie = register.get().getCategorie2();
|
||||
ClubModel club = register.get().getClub2();
|
||||
clubName = (club == null) ? BUNDLE.getString("no.licence") : club.getName();
|
||||
clubName = (club == null) ? trad.t("no.licence") : club.getName();
|
||||
} else if (comb instanceof CompetitionGuestModel guestModel) {
|
||||
categorie = guestModel.getCategorie();
|
||||
clubName = guestModel.getClub();
|
||||
} else if (comb instanceof MembreModel model) {
|
||||
categorie = model.getCategorie();
|
||||
clubName = (model.getClub() == null) ? BUNDLE.getString(
|
||||
"no.licence") : model.getClub().getName();
|
||||
clubName = (model.getClub() == null) ? trad.t("no.licence")
|
||||
: model.getClub().getName();
|
||||
}
|
||||
|
||||
builder2.cat((categorie == null) ? "---" : categorie.getName(BUNDLE));
|
||||
builder2.cat((categorie == null) ? "---" : categorie.getName(trad));
|
||||
builder2.name(comb.getName(membreModel, ResultPrivacy.REGISTERED_ONLY));
|
||||
builder2.w(w.get());
|
||||
builder2.l(l.get());
|
||||
@ -364,7 +365,7 @@ public class ResultService {
|
||||
|
||||
Long id = getCombTempId(combTempId);
|
||||
if (id == null) {
|
||||
return Uni.createFrom().failure(new DForbiddenException("Comb not found"));
|
||||
return Uni.createFrom().failure(new DForbiddenException(trad.t("comb.not.found")));
|
||||
}
|
||||
|
||||
Uni<List<MatchModel>> uni;
|
||||
@ -373,13 +374,13 @@ public class ResultService {
|
||||
uuid, privacy).firstResult()
|
||||
.chain(Unchecked.function(registerModel -> {
|
||||
if (registerModel == null)
|
||||
throw new DBadRequestException("Combattant non inscrit");
|
||||
throw new DBadRequestException(trad.t("combattant.non.inscrit"));
|
||||
|
||||
builder.name(Utils.getFullName(registerModel.getMembre()));
|
||||
builder.club((registerModel.getClub2() == null) ? BUNDLE.getString(
|
||||
"no.licence") : registerModel.getClub2().getName());
|
||||
builder.cat((registerModel.getCategorie2() == null) ? "---" : registerModel.getCategorie2()
|
||||
.getName(BUNDLE));
|
||||
builder.club((registerModel.getClub2() == null) ? trad.t("no.licence") :
|
||||
registerModel.getClub2().getName());
|
||||
builder.cat((registerModel.getCategorie2() == null) ? "---" :
|
||||
registerModel.getCategorie2().getName(trad));
|
||||
|
||||
return matchRepository.list("category.compet.uuid = ?1 AND (c1_id = ?2 OR c2_id = ?2)", uuid,
|
||||
registerModel.getMembre());
|
||||
@ -389,8 +390,8 @@ public class ResultService {
|
||||
.chain(guestModel -> {
|
||||
builder.name(Utils.getFullName(guestModel));
|
||||
builder.club(guestModel.getClub());
|
||||
builder.cat((guestModel.getCategorie() == null) ? "---" : guestModel.getCategorie()
|
||||
.getName(BUNDLE));
|
||||
builder.cat(
|
||||
(guestModel.getCategorie() == null) ? "---" : guestModel.getCategorie().getName(trad));
|
||||
|
||||
return matchRepository.list("category.compet.uuid = ?1 AND (c1_guest = ?2 OR c2_guest = ?2)",
|
||||
uuid, guestModel);
|
||||
@ -529,13 +530,13 @@ public class ResultService {
|
||||
if (id < 0) {
|
||||
String clubName = getClubTempId(id);
|
||||
if (clubName == null) {
|
||||
return Uni.createFrom().failure(new DForbiddenException("Club not found"));
|
||||
return Uni.createFrom().failure(new DForbiddenException(trad.t("club.not.found")));
|
||||
}
|
||||
|
||||
return competitionGuestRepository.list("competition.uuid = ?1 AND club = ?2", uuid, clubName)
|
||||
.call(list -> {
|
||||
if (list.isEmpty())
|
||||
return Uni.createFrom().failure(new DBadRequestException("Club not found"));
|
||||
return Uni.createFrom().failure(new DBadRequestException(trad.t("club.not.found")));
|
||||
return Uni.createFrom().voidItem();
|
||||
})
|
||||
.chain(guests -> matchRepository.list(
|
||||
@ -584,7 +585,7 @@ public class ResultService {
|
||||
categorie = model.getCategorie();
|
||||
}
|
||||
|
||||
builder2.cat((categorie == null) ? "---" : categorie.getName(BUNDLE));
|
||||
builder2.cat((categorie == null) ? "---" : categorie.getName(trad));
|
||||
builder2.name(comb.getName(membreModel, ResultPrivacy.REGISTERED_ONLY));
|
||||
builder2.w(w.get());
|
||||
builder2.l(l.get());
|
||||
@ -668,7 +669,8 @@ public class ResultService {
|
||||
uuid, securityCtx.getSubject())
|
||||
.chain(c2 -> {
|
||||
if (c2 > 0) return Uni.createFrom().item(m);
|
||||
return Uni.createFrom().failure(new DForbiddenException("Access denied"));
|
||||
return Uni.createFrom().failure(new DForbiddenException(
|
||||
trad.t("access.denied")));
|
||||
});
|
||||
});
|
||||
} else {
|
||||
@ -676,7 +678,7 @@ public class ResultService {
|
||||
securityCtx.getSubject())
|
||||
.chain(c2 -> {
|
||||
if (c2 > 0) return Uni.createFrom().item(m);
|
||||
return Uni.createFrom().failure(new DForbiddenException("Access denied"));
|
||||
return Uni.createFrom().failure(new DForbiddenException(trad.t("access.denied")));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package fr.titionfire.ffsaf.domain.service;
|
||||
|
||||
import jakarta.enterprise.context.RequestScoped;
|
||||
import jakarta.enterprise.inject.Instance;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.container.ContainerRequestContext;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
@RequestScoped
|
||||
public class TradService {
|
||||
|
||||
@Inject
|
||||
Instance<ContainerRequestContext> requestContextInstance;
|
||||
|
||||
public static final Locale fallbackLocale = Locale.FRANCE;
|
||||
|
||||
public String t(String key) {
|
||||
return translate(key);
|
||||
}
|
||||
|
||||
public String translate(String key) {
|
||||
ContainerRequestContext requestContext = requestContextInstance.get();
|
||||
Locale userLocale = (Locale) requestContext.getProperty("userLocale");
|
||||
|
||||
|
||||
try {
|
||||
ResourceBundle messages = ResourceBundle.getBundle("lang.messages", userLocale);
|
||||
return messages.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
try {
|
||||
ResourceBundle fallbackMessages = ResourceBundle.getBundle("lang.messages", fallbackLocale);
|
||||
return fallbackMessages.getString(key);
|
||||
} catch (MissingResourceException ex) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
package fr.titionfire.ffsaf.rest;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.rest.client.SirenService;
|
||||
import fr.titionfire.ffsaf.rest.client.StateIdService;
|
||||
import fr.titionfire.ffsaf.rest.data.AssoData;
|
||||
import fr.titionfire.ffsaf.rest.exception.DNotFoundException;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import org.eclipse.microprofile.openapi.annotations.Operation;
|
||||
@ -19,6 +21,9 @@ public class AssoEndpoints {
|
||||
@RestClient
|
||||
SirenService sirenService;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
@GET
|
||||
@Path("state_id/{stateId}")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@ -28,9 +33,9 @@ public class AssoEndpoints {
|
||||
stateId).chain(stateIdService::getAssoDataFromUnit)).onFailure().transform(throwable -> {
|
||||
if (throwable instanceof WebApplicationException exception) {
|
||||
if (exception.getResponse().getStatus() == 404)
|
||||
return new DNotFoundException("Service momentanément indisponible");
|
||||
return new DNotFoundException(trad.t("service.momentanement.indisponible"));
|
||||
if (exception.getResponse().getStatus() == 400)
|
||||
return new DNotFoundException("Asso introuvable");
|
||||
return new DNotFoundException(trad.t("asso.introuvable"));
|
||||
}
|
||||
return throwable;
|
||||
});
|
||||
|
||||
@ -3,6 +3,7 @@ package fr.titionfire.ffsaf.rest;
|
||||
import fr.titionfire.ffsaf.data.model.ClubModel;
|
||||
import fr.titionfire.ffsaf.domain.service.ClubService;
|
||||
import fr.titionfire.ffsaf.domain.service.PDFService;
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.domain.service.VirusScannerService;
|
||||
import fr.titionfire.ffsaf.net2.data.SimpleClubModel;
|
||||
import fr.titionfire.ffsaf.rest.data.*;
|
||||
@ -53,6 +54,9 @@ public class ClubEndpoints {
|
||||
@ConfigProperty(name = "upload_dir")
|
||||
String media;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
Consumer<ClubModel> checkPerm = Unchecked.consumer(clubModel -> {
|
||||
if (!securityCtx.roleHas("federation_admin") && !securityCtx.isInClubGroup(clubModel.getId()))
|
||||
throw new DForbiddenException();
|
||||
@ -84,7 +88,7 @@ public class ClubEndpoints {
|
||||
@Operation(summary = "Renvoie les types de contacts pour les clubs", description = "Renvoie la liste des types de " +
|
||||
"contacts possibles pour les clubs")
|
||||
public Uni<HashMap<String, String>> getConcatType() {
|
||||
return Uni.createFrom().item(Contact.toSite());
|
||||
return Uni.createFrom().item(Contact.toSite(trad));
|
||||
}
|
||||
|
||||
@GET
|
||||
@ -125,7 +129,7 @@ public class ClubEndpoints {
|
||||
public Uni<SimpleClub> getById(
|
||||
@Parameter(description = "Identifiant de club") @PathParam("id") long id) {
|
||||
return clubService.getById(id).onItem().invoke(checkPerm).map(SimpleClub::fromModel)
|
||||
.invoke(m -> m.setContactMap(Contact.toSite()));
|
||||
.invoke(m -> m.setContactMap(Contact.toSite(trad)));
|
||||
}
|
||||
|
||||
@PUT
|
||||
@ -218,7 +222,7 @@ public class ClubEndpoints {
|
||||
})
|
||||
public Uni<SimpleClub> getOfUser() {
|
||||
return clubService.getOfUser(securityCtx).map(SimpleClub::fromModel)
|
||||
.invoke(m -> m.setContactMap(Contact.toSite()));
|
||||
.invoke(m -> m.setContactMap(Contact.toSite(trad)));
|
||||
}
|
||||
|
||||
@PUT
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package fr.titionfire.ffsaf.rest.data;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.MembreModel;
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.utils.ResultPrivacy;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
import lombok.Data;
|
||||
@ -47,19 +48,19 @@ public class MeData {
|
||||
@Schema(description = "La liste des séléctions du membre.")
|
||||
private List<SimpleSelection> selections;
|
||||
|
||||
public void setMembre(MembreModel membreModel) {
|
||||
public void setMembre(MembreModel membreModel, TradService trad) {
|
||||
this.id = membreModel.getId();
|
||||
this.lname = membreModel.getLname();
|
||||
this.fname = membreModel.getFname();
|
||||
this.categorie = membreModel.getCategorie() == null ? "catégorie inconnue" : membreModel.getCategorie().getName();
|
||||
this.club = membreModel.getClub() == null ? "Sans club" : membreModel.getClub().getName();
|
||||
this.genre = membreModel.getGenre().str;
|
||||
this.categorie = membreModel.getCategorie() == null ? trad.t("categorie.inconnue") : membreModel.getCategorie().getName(trad);
|
||||
this.club = membreModel.getClub() == null ? trad.t("sans.club") : membreModel.getClub().getName();
|
||||
this.genre = membreModel.getGenre().getString(trad);
|
||||
this.licence = membreModel.getLicence();
|
||||
this.country = membreModel.getCountry();
|
||||
this.birth_date = membreModel.getBirth_date();
|
||||
this.email = membreModel.getEmail();
|
||||
this.role = membreModel.getRole().str;
|
||||
this.grade_arbitrage = membreModel.getGrade_arbitrage().str;
|
||||
this.role = membreModel.getRole().getString(trad);
|
||||
this.grade_arbitrage = membreModel.getGrade_arbitrage().getString(trad);
|
||||
this.resultPrivacy = membreModel.getResultPrivacy();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package fr.titionfire.ffsaf.utils;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.ResourceBundle;
|
||||
@ -19,7 +20,7 @@ public enum Categorie {
|
||||
VETERAN2;
|
||||
|
||||
public String getName(ResourceBundle BUNDLE) {
|
||||
return switch (this){
|
||||
return switch (this) {
|
||||
case SUPER_MINI -> BUNDLE.getString("Cat.SUPER_MINI");
|
||||
case MINI_POUSSIN -> BUNDLE.getString("Cat.MINI_POUSSIN");
|
||||
case POUSSIN -> BUNDLE.getString("Cat.POUSSIN");
|
||||
@ -34,8 +35,24 @@ public enum Categorie {
|
||||
};
|
||||
}
|
||||
|
||||
public String getName(TradService tradService) {
|
||||
return switch (this) {
|
||||
case SUPER_MINI -> tradService.translate("Cat.SUPER_MINI");
|
||||
case MINI_POUSSIN -> tradService.translate("Cat.MINI_POUSSIN");
|
||||
case POUSSIN -> tradService.translate("Cat.POUSSIN");
|
||||
case BENJAMIN -> tradService.translate("Cat.BENJAMIN");
|
||||
case MINIME -> tradService.translate("Cat.MINIME");
|
||||
case CADET -> tradService.translate("Cat.CADET");
|
||||
case JUNIOR -> tradService.translate("Cat.JUNIOR");
|
||||
case SENIOR1 -> tradService.translate("Cat.SENIOR1");
|
||||
case SENIOR2 -> tradService.translate("Cat.SENIOR2");
|
||||
case VETERAN1 -> tradService.translate("Cat.VETERAN1");
|
||||
case VETERAN2 -> tradService.translate("Cat.VETERAN2");
|
||||
};
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return switch (this){
|
||||
return switch (this) {
|
||||
case SUPER_MINI -> "Super Mini";
|
||||
case MINI_POUSSIN -> "Mini Poussin";
|
||||
case POUSSIN -> "Poussin";
|
||||
|
||||
@ -1,32 +1,34 @@
|
||||
package fr.titionfire.ffsaf.utils;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@RegisterForReflection
|
||||
public enum Contact {
|
||||
COURRIEL("Courriel"),
|
||||
TELEPHONE("Téléphone"),
|
||||
SITE("Site web"),
|
||||
FACEBOOK("Facebook"),
|
||||
INSTAGRAM("Instagram"),
|
||||
AUTRE("Autre");
|
||||
COURRIEL,
|
||||
TELEPHONE,
|
||||
SITE,
|
||||
FACEBOOK,
|
||||
INSTAGRAM,
|
||||
AUTRE;
|
||||
|
||||
public String name;
|
||||
|
||||
Contact(String name) {
|
||||
this.name = name;
|
||||
public String getName(TradService trad) {
|
||||
return switch (this) {
|
||||
case COURRIEL -> trad.translate("Contact.COURRIEL");
|
||||
case TELEPHONE -> trad.translate("Contact.TELEPHONE");
|
||||
case SITE -> trad.translate("Contact.SITE");
|
||||
case FACEBOOK -> trad.translate("Contact.FACEBOOK");
|
||||
case INSTAGRAM -> trad.translate("Contact.INSTAGRAM");
|
||||
case AUTRE -> trad.translate("Contact.AUTRE");
|
||||
};
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static HashMap<String, String> toSite() {
|
||||
public static HashMap<String, String> toSite(TradService trad) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
for (Contact contact : Contact.values()) {
|
||||
map.put(contact.toString(), contact.name);
|
||||
map.put(contact.toString(), contact.getName(trad));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package fr.titionfire.ffsaf.utils;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@ -27,8 +28,17 @@ public enum Genre {
|
||||
}
|
||||
}
|
||||
|
||||
public String getString(TradService trad) {
|
||||
return switch (this) {
|
||||
case H -> trad.translate("Genre.Homme");
|
||||
case F -> trad.translate("Genre.Femme");
|
||||
case NA -> trad.translate("Genre.NA");
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package fr.titionfire.ffsaf.utils;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@ -14,6 +15,14 @@ public enum GradeArbitrage {
|
||||
this.str = name;
|
||||
}
|
||||
|
||||
public String getString(TradService trad) {
|
||||
return switch (this) {
|
||||
case NA -> trad.translate("GradeArbitrage.NA");
|
||||
case ASSESSEUR -> trad.translate("GradeArbitrage.ASSESSEUR");
|
||||
case ARBITRE -> trad.translate("GradeArbitrage.ARBITRE");
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return str;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package fr.titionfire.ffsaf.utils;
|
||||
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
@RegisterForReflection
|
||||
@ -21,6 +22,19 @@ public enum RoleAsso {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public String getString(TradService trad) {
|
||||
return switch (this){
|
||||
case MEMBRE -> trad.translate("RoleAsso.MEMBRE");
|
||||
case PRESIDENT -> trad.translate("RoleAsso.PRESIDENT");
|
||||
case VPRESIDENT -> trad.translate("RoleAsso.VPRESIDENT");
|
||||
case SECRETAIRE -> trad.translate("RoleAsso.SECRETAIRE");
|
||||
case VSECRETAIRE -> trad.translate("RoleAsso.VSECRETAIRE");
|
||||
case TRESORIER -> trad.translate("RoleAsso.TRESORIER");
|
||||
case VTRESORIER -> trad.translate("RoleAsso.VTRESORIER");
|
||||
case MEMBREBUREAU -> trad.translate("RoleAsso.MEMBREBUREAU");
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return str;
|
||||
|
||||
@ -5,6 +5,7 @@ import fr.titionfire.ffsaf.data.model.MatchModel;
|
||||
import fr.titionfire.ffsaf.data.repository.CardboardRepository;
|
||||
import fr.titionfire.ffsaf.data.repository.MatchRepository;
|
||||
import fr.titionfire.ffsaf.domain.entity.CardboardEntity;
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.rest.exception.DForbiddenException;
|
||||
import fr.titionfire.ffsaf.rest.exception.DNotFoundException;
|
||||
import fr.titionfire.ffsaf.ws.PermLevel;
|
||||
@ -32,13 +33,16 @@ public class RCardboard {
|
||||
@Inject
|
||||
CardboardRepository cardboardRepository;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
private Uni<MatchModel> getById(long id, WebSocketConnection connection) {
|
||||
return matchRepository.findById(id)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException("Matche non trouver");
|
||||
throw new DNotFoundException(trad.t("matche.non.trouver"));
|
||||
if (!o.getCategory().getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException("Permission denied");
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import fr.titionfire.ffsaf.data.model.TreeModel;
|
||||
import fr.titionfire.ffsaf.data.repository.*;
|
||||
import fr.titionfire.ffsaf.domain.entity.MatchEntity;
|
||||
import fr.titionfire.ffsaf.domain.entity.TreeEntity;
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.rest.exception.DForbiddenException;
|
||||
import fr.titionfire.ffsaf.rest.exception.DNotFoundException;
|
||||
import fr.titionfire.ffsaf.utils.TreeNode;
|
||||
@ -46,13 +47,16 @@ public class RCategorie {
|
||||
@Inject
|
||||
CardboardRepository cardboardRepository;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
private Uni<CategoryModel> getById(long id, WebSocketConnection connection) {
|
||||
return categoryRepository.findById(id)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException("Catégorie non trouver");
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver"));
|
||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException("Permission denied");
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import fr.titionfire.ffsaf.data.model.*;
|
||||
import fr.titionfire.ffsaf.data.repository.*;
|
||||
import fr.titionfire.ffsaf.domain.entity.MatchEntity;
|
||||
import fr.titionfire.ffsaf.domain.entity.TreeEntity;
|
||||
import fr.titionfire.ffsaf.domain.service.TradService;
|
||||
import fr.titionfire.ffsaf.rest.exception.DForbiddenException;
|
||||
import fr.titionfire.ffsaf.rest.exception.DNotFoundException;
|
||||
import fr.titionfire.ffsaf.utils.ScoreEmbeddable;
|
||||
@ -47,13 +48,16 @@ public class RMatch {
|
||||
@Inject
|
||||
CardboardRepository cardboardRepository;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
private Uni<MatchModel> getById(long id, WebSocketConnection connection) {
|
||||
return matchRepository.findById(id)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException("Matche non trouver");
|
||||
throw new DNotFoundException(trad.t("matche.non.trouver"));
|
||||
if (!o.getCategory().getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException("Permission denied");
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
}));
|
||||
}
|
||||
|
||||
@ -81,9 +85,9 @@ public class RMatch {
|
||||
return categoryRepository.findById(m.categorie)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException("Catégorie non trouver");
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver"));
|
||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException("Permission denied");
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
}))
|
||||
.chain(categoryModel -> creatMatch(categoryModel, m))
|
||||
.chain(mm -> Panache.withTransaction(() -> matchRepository.create(mm)))
|
||||
@ -294,9 +298,9 @@ public class RMatch {
|
||||
return categoryRepository.findById(data.categorie)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException("Catégorie non trouver");
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver"));
|
||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException("Permission denied");
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
}))
|
||||
.call(cm -> data.matchesToRemove.isEmpty() ? Uni.createFrom().voidItem() :
|
||||
(Panache.withTransaction(
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
filtre.all=--tout--
|
||||
no.licence=Non licenci\u00E9
|
||||
|
||||
|
||||
# Categories
|
||||
Cat.SUPER_MINI=Super Mini
|
||||
Cat.MINI_POUSSIN=Mini Poussin
|
||||
Cat.POUSSIN= Poussin
|
||||
Cat.BENJAMIN=Benjamin
|
||||
Cat.MINIME=Minime
|
||||
Cat.CADET=Cadet
|
||||
Cat.JUNIOR=Junior
|
||||
Cat.SENIOR1=Senior 1
|
||||
Cat.SENIOR2=Senior 2
|
||||
Cat.VETERAN1=V\u00E9t\u00E9ran 1
|
||||
Cat.VETERAN2=V\u00E9t\u00E9ran 2
|
||||
87
src/main/resources/lang/messages_en.properties
Normal file
87
src/main/resources/lang/messages_en.properties
Normal file
@ -0,0 +1,87 @@
|
||||
filtre.all=--all--
|
||||
no.licence=Not licensed
|
||||
Cat.SUPER_MINI=Super Mini
|
||||
Cat.MINI_POUSSIN=Mini Chick
|
||||
Cat.POUSSIN=Chick
|
||||
Cat.BENJAMIN=Benjamin
|
||||
Cat.MINIME=Minime
|
||||
Cat.CADET=Cadet
|
||||
Cat.JUNIOR=Junior
|
||||
Cat.SENIOR1=Senior 1
|
||||
Cat.SENIOR2=Senior 2
|
||||
Cat.VETERAN1=Veteran 1
|
||||
Cat.VETERAN2=Veteran 2
|
||||
access.denied=Access denied
|
||||
club.not.found=Club not found
|
||||
combattant.non.inscrit=Fighter not registered
|
||||
comb.not.found=Fighter not found
|
||||
matche.non.trouver=Match not found
|
||||
permission.denied=Permission denied
|
||||
categorie.non.trouver=Category not found
|
||||
|
||||
RoleAsso.MEMBRE=Member
|
||||
RoleAsso.PRESIDENT=President
|
||||
RoleAsso.VPRESIDENT=Vice-President
|
||||
RoleAsso.SECRETAIRE=Secretary
|
||||
RoleAsso.VSECRETAIRE=Vice-Secretary
|
||||
RoleAsso.TRESORIER=Treasurer
|
||||
RoleAsso.VTRESORIER=Vice-Treasurer
|
||||
RoleAsso.MEMBREBUREAU=Board Member
|
||||
|
||||
sans.club=No club
|
||||
categorie.inconnue=Unknown category
|
||||
GradeArbitrage.NA=N/A
|
||||
GradeArbitrage.ASSESSEUR=Assessor
|
||||
GradeArbitrage.ARBITRE=Referee
|
||||
Genre.Homme=Male
|
||||
Genre.Femme=Female
|
||||
Genre.NA=Not defined
|
||||
|
||||
Contact.COURRIEL=Email
|
||||
Contact.TELEPHONE=Phone
|
||||
Contact.SITE=Website
|
||||
Contact.FACEBOOK=Facebook
|
||||
Contact.INSTAGRAM=Instagram
|
||||
Contact.AUTRE=Other
|
||||
|
||||
service.momentanement.indisponible=Service temporarily unavailable
|
||||
asso.introuvable=Association not found
|
||||
erreur.lors.calcul.du.trie=Error during sorting calculation
|
||||
page.out.of.range=Page out of range
|
||||
le.membre.appartient.pas.a.votre.club=Member no. %d does not belong to your club
|
||||
email.deja.utilise.par=Email '%s' already used by %s %s
|
||||
try.edit.licence=To register a new member, please leave the license field blank. (Unauthorized attempt to change the name on license %d for %s %s)
|
||||
email.deja.utilise=Email already in use
|
||||
regiter.new.membre=To register a new member, please use the dedicated button.
|
||||
permission.insuffisante=Insufficient permission
|
||||
membre.deja.existent=Member already exists
|
||||
membre.rm.err1=Cannot delete a member who already has a license number
|
||||
membre.rm.err2=Cannot delete a member with licenses
|
||||
pas.de.licence.pour.la.saison.en.cours=No license for the current season
|
||||
club.non.trouve=Club not found
|
||||
pas.d.affiliation.pour.la.saison.en.cours=No affiliation for the current season
|
||||
erreur.lors.de.la.selection.des.membres=Error during member selection
|
||||
licence.rm.err1=Cannot delete a license for which payment is in progress
|
||||
licence.deja.demandee=License already requested
|
||||
impossible.de.supprimer.une.licence.deja.validee=Cannot delete an already validated license
|
||||
impossible.de.supprimer.une.licence.deja.payee=Cannot delete an already paid license
|
||||
vous.ne.pouvez.pas.creer.de.competition=You cannot create a competition
|
||||
user.not.found=User %s not found
|
||||
inscription.fermee=Registration closed
|
||||
insc.err1=You do not have the right to register this member (by decision of the competition administrator)
|
||||
insc.err2=You do not have the right to register (by decision of the competition administrator)
|
||||
insc.err3=Modification blocked by the competition administrator
|
||||
licence.non.trouve=License %s not found
|
||||
nom.et.prenom.requis=Last name and first name required
|
||||
combattant.non.trouve=Fighter %s %s not found
|
||||
le.membre.n.existe.pas=Member %d does not exist
|
||||
competition.is.not.internal=Competition is not INTERNAL
|
||||
erreur.de.format.des.contacts=Contact format error
|
||||
competition.not.found=Competition not found
|
||||
saison.non.valid=Invalid season
|
||||
demande.d.affiliation.deja.existante=Affiliation request already exists
|
||||
affiliation.deja.existante=Affiliation already exists
|
||||
licence.membre.n.1.inconnue=License member no. 1 unknown
|
||||
licence.membre.n.2.inconnue=License member no. 2 unknown
|
||||
licence.membre.n.3.inconnue=License member no. 3 unknown
|
||||
demande.d.affiliation.non.trouve=Affiliation request not found
|
||||
83
src/main/resources/lang/messages_fr.properties
Normal file
83
src/main/resources/lang/messages_fr.properties
Normal file
@ -0,0 +1,83 @@
|
||||
filtre.all=--Tous--
|
||||
no.licence=Non licencié
|
||||
Cat.SUPER_MINI=Super Mini
|
||||
Cat.MINI_POUSSIN=Mini-Poussin
|
||||
Cat.POUSSIN=Poussin
|
||||
Cat.BENJAMIN=Benjamin
|
||||
Cat.MINIME=Minime
|
||||
Cat.CADET=Cadet
|
||||
Cat.JUNIOR=Junior
|
||||
Cat.SENIOR1=Senior 1
|
||||
Cat.SENIOR2=Senior 2
|
||||
Cat.VETERAN1=Vétéran 1
|
||||
Cat.VETERAN2=Vétéran 2
|
||||
access.denied=Accès refusé
|
||||
club.not.found=Club introuvable
|
||||
combattant.non.inscrit=Combattant non inscrit
|
||||
comb.not.found=Combat introuvable
|
||||
matche.non.trouver=Match introuvable
|
||||
permission.denied=Permission refusée
|
||||
categorie.non.trouver=Catégorie introuvable
|
||||
RoleAsso.MEMBRE=Membre
|
||||
RoleAsso.PRESIDENT=Président
|
||||
RoleAsso.VPRESIDENT=Vice-Président
|
||||
RoleAsso.SECRETAIRE=Secrétaire
|
||||
RoleAsso.VSECRETAIRE=Vice-Secrétaire
|
||||
RoleAsso.TRESORIER=Trésorier
|
||||
RoleAsso.VTRESORIER=Vice-Trésorier
|
||||
RoleAsso.MEMBREBUREAU=Membre bureau
|
||||
sans.club=Sans club
|
||||
categorie.inconnue=catégorie inconnue
|
||||
GradeArbitrage.NA=N/A
|
||||
GradeArbitrage.ASSESSEUR=Assesseur
|
||||
GradeArbitrage.ARBITRE=Arbitre
|
||||
Genre.Homme=Homme
|
||||
Genre.Femme=Femme
|
||||
Genre.NA=Non défini
|
||||
Contact.COURRIEL=Courriel
|
||||
Contact.TELEPHONE=Téléphone
|
||||
Contact.SITE=Site web
|
||||
Contact.FACEBOOK=Facebook
|
||||
Contact.INSTAGRAM=Instagram
|
||||
Contact.AUTRE=Autre
|
||||
service.momentanement.indisponible=Service momentanément indisponible
|
||||
asso.introuvable=Association introuvable
|
||||
erreur.lors.calcul.du.trie=Erreur lors du calcul du tri
|
||||
page.out.of.range=Page out of range
|
||||
le.membre.appartient.pas.a.votre.club=Le membre n°%d n?appartient pas à votre club
|
||||
email.deja.utilise.par=L?adresse e-mail '%s' est déjà utilisée par %s %s
|
||||
try.edit.licence=Pour enregistrer un nouveau membre, veuillez laisser le champ licence vide. (Tentative de modification non autorisée du nom sur la licence %d pour %s %s)
|
||||
email.deja.utilise=Adresse e-mail déjà utilisée
|
||||
regiter.new.membre=Pour enregistrer un nouveau membre, veuillez utiliser le bouton prévu à cet effet.
|
||||
permission.insuffisante=Permissions insuffisantes
|
||||
membre.deja.existent=Membre déjà existant
|
||||
membre.rm.err1=Impossible de supprimer un membre qui possède déjà un numéro de licence
|
||||
membre.rm.err2=Impossible de supprimer un membre ayant des licences actives
|
||||
pas.de.licence.pour.la.saison.en.cours=Aucune licence pour la saison en cours
|
||||
club.non.trouve=Club introuvable
|
||||
pas.d.affiliation.pour.la.saison.en.cours=Aucune affiliation pour la saison en cours
|
||||
erreur.lors.de.la.selection.des.membres=Erreur lors de la sélection des membres
|
||||
licence.rm.err1=Impossible de supprimer une licence pour laquelle un paiement est en cours
|
||||
licence.deja.demandee=Licence déjà demandée
|
||||
impossible.de.supprimer.une.licence.deja.validee=Impossible de supprimer une licence déjà validée
|
||||
impossible.de.supprimer.une.licence.deja.payee=Impossible de supprimer une licence déjà payée
|
||||
vous.ne.pouvez.pas.creer.de.competition=Vous n?êtes pas autorisé à créer une compétition
|
||||
user.not.found=Utilisateur %s introuvable
|
||||
inscription.fermee=Inscription fermée
|
||||
insc.err1=Vous n?êtes pas autorisé à inscrire ce membre (décision de l?administrateur de la compétition)
|
||||
insc.err2=Vous n?êtes pas autorisé à vous inscrire (décision de l?administrateur de la compétition)
|
||||
insc.err3=Modification bloquée par l?administrateur de la compétition
|
||||
licence.non.trouve=Licence %s introuvable
|
||||
nom.et.prenom.requis=Nom et prénom obligatoires
|
||||
combattant.non.trouve=Combattant %s %s introuvable
|
||||
le.membre.n.existe.pas=Le membre n°%d n?existe pas
|
||||
competition.is.not.internal=Competition is not INTERNAL
|
||||
erreur.de.format.des.contacts=Format des contacts invalide
|
||||
competition.not.found=Compétition introuvable
|
||||
saison.non.valid=Saison invalide
|
||||
demande.d.affiliation.deja.existante=Une demande d?affiliation existe déjà
|
||||
affiliation.deja.existante=Affiliation déjà existante
|
||||
licence.membre.n.1.inconnue=Licence du membre n°1 inconnue
|
||||
licence.membre.n.2.inconnue=Licence du membre n°2 inconnue
|
||||
licence.membre.n.3.inconnue=Licence du membre n°3 inconnue
|
||||
demande.d.affiliation.non.trouve=Demande d?affiliation introuvable
|
||||
Loading…
x
Reference in New Issue
Block a user