Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/language/fr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

use super::*;

use Error::*;

impl Language {
pub fn fr_message(error: Error) -> &'static str {
match error {
UnsafePasswordTooShort => "Le mot de passe doit faire au moins 8 caractères.",
UnauthenticatedClientError => "Client non authentifié.",
UnauthorizedError => "Non autorisé.",
InvalidCredentialsError => "Email ou mot de passe incorrect.",
UserNotFoundError => "Cet utilisateur n'existe pas.'",
InvalidEmailAddressError => "Email adresse invalide.",
EmailAlreadyExists => "Cette email adresse existe déjà.",
_ => "Erreur interne au serveur.",
}
}
}
8 changes: 7 additions & 1 deletion src/language/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ pub enum Language {
ES,
#[cfg(feature="lang-pt")]
PT,
#[cfg(feature="lang-fr")]
FR,
}

use Language::*;
Expand All @@ -26,6 +28,8 @@ impl Language {
ES => Language::es_message(error),
#[cfg(feature="lang-pt")]
PT => Language::pt_message(error),
#[cfg(feature="lang-fr")]
FR => Language::fr_message(error),
}
}
}
Expand All @@ -34,4 +38,6 @@ mod en;
#[cfg(feature="lang-es")]
mod es;
#[cfg(feature="lang-pt")]
mod pt;
mod pt;
#[cfg(feature="lang-fr")]
mod fr;