From 0cf5053af005de2705b4e3dcbba17d79212cd8c1 Mon Sep 17 00:00:00 2001
From: Kudjo <214548865+Phoenix-Grand@users.noreply.github.com>
Date: Sun, 25 Oct 2026 22:15:57 -0600
Subject: [PATCH 01/12] Use English defaults for server and shared mobile
messages
---
.../src/views/home.kbview | 2 +-
mobile/common/kubuno-mobile-signin/src/lib.rs | 30 ++--
.../src/views/signin_login.kbview | 10 +-
.../src/views/signin_server.kbview | 6 +-
.../src/views/signin_totp.kbview | 8 +-
server/src/alerts/model.rs | 4 +-
server/src/alerts/store.rs | 26 +--
server/src/audit/query.rs | 2 +-
server/src/audit/retention.rs | 6 +-
server/src/auth/ddos.rs | 4 +-
server/src/auth/methods.rs | 17 +-
server/src/auth/oauth.rs | 10 +-
server/src/auth/rate_limit.rs | 2 +-
server/src/auth/reauth/catalog.rs | 6 +-
server/src/auth/token_scope/policy.rs | 16 +-
server/src/authz/catalog.rs | 6 +-
server/src/authz/guards.rs | 12 +-
server/src/authz/model.rs | 6 +-
server/src/backup/archive.rs | 6 +-
server/src/backup/policy.rs | 8 +-
server/src/backup/restore.rs | 4 +-
server/src/collab/mod.rs | 2 +-
server/src/data_export/policy.rs | 8 +-
server/src/data_export/runs.rs | 2 +-
server/src/data_migration/model.rs | 25 ++-
server/src/data_migration/store.rs | 8 +-
server/src/devices/declared.rs | 2 +-
server/src/devices/store.rs | 10 +-
server/src/directory/auth.rs | 6 +-
server/src/directory/client.rs | 48 +++---
server/src/directory/config.rs | 2 +-
server/src/directory/probe.rs | 23 ++-
server/src/directory/sync.rs | 36 ++--
server/src/domains/dns.rs | 10 +-
server/src/domains/model.rs | 17 +-
server/src/domains/store.rs | 30 ++--
server/src/errors/app_error.rs | 51 +++---
server/src/handlers/admin/alerts.rs | 14 +-
server/src/handlers/admin/audiences.rs | 40 ++---
server/src/handlers/admin/backup.rs | 16 +-
server/src/handlers/admin/dashboard.rs | 2 +-
server/src/handlers/admin/data_export.rs | 38 ++--
server/src/handlers/admin/data_migration.rs | 17 +-
server/src/handlers/admin/db_connections.rs | 28 +--
server/src/handlers/admin/db_switch.rs | 18 +-
server/src/handlers/admin/detectors.rs | 42 ++---
server/src/handlers/admin/devices.rs | 2 +-
server/src/handlers/admin/groups.rs | 20 +--
server/src/handlers/admin/health.rs | 12 +-
server/src/handlers/admin/holidays.rs | 49 +++---
server/src/handlers/admin/ldap.rs | 46 +++--
server/src/handlers/admin/mail.rs | 38 ++--
server/src/handlers/admin/marketplace.rs | 2 +-
server/src/handlers/admin/module_databases.rs | 22 +--
server/src/handlers/admin/network.rs | 18 +-
server/src/handlers/admin/oauth_providers.rs | 25 ++-
server/src/handlers/admin/org_units.rs | 36 ++--
server/src/handlers/admin/password_reset.rs | 18 +-
server/src/handlers/admin/period.rs | 2 +-
server/src/handlers/admin/resources.rs | 78 ++++-----
server/src/handlers/admin/roles.rs | 36 ++--
server/src/handlers/admin/rules.rs | 2 +-
server/src/handlers/admin/schema_prefix.rs | 8 +-
.../src/handlers/admin/security_dashboard.rs | 2 +-
server/src/handlers/admin/setting_scopes.rs | 17 +-
server/src/handlers/admin/settings.rs | 16 +-
server/src/handlers/admin/subscription.rs | 8 +-
server/src/handlers/admin/users.rs | 30 ++--
server/src/handlers/api_tokens.rs | 4 +-
server/src/handlers/auth/accounts.rs | 2 +-
server/src/handlers/auth/login.rs | 8 +-
server/src/handlers/auth/oauth.rs | 18 +-
server/src/handlers/auth/password_reset.rs | 6 +-
server/src/handlers/auth/reauth.rs | 10 +-
server/src/handlers/auth/register.rs | 8 +-
server/src/handlers/auth/tokens.rs | 4 +-
server/src/handlers/auth/totp.rs | 8 +-
server/src/handlers/clipboard.rs | 10 +-
server/src/handlers/devices.rs | 2 +-
server/src/handlers/gate.rs | 2 +-
server/src/handlers/holidays.rs | 10 +-
server/src/handlers/labels.rs | 18 +-
server/src/handlers/me_export.rs | 31 ++--
server/src/handlers/modules/mod.rs | 8 +-
server/src/handlers/modules/registration.rs | 10 +-
.../src/handlers/modules/settings_schema.rs | 37 ++--
server/src/handlers/push.rs | 10 +-
server/src/handlers/storage_mounts.rs | 8 +-
server/src/handlers/storage_usage.rs | 2 +-
server/src/handlers/themes.rs | 50 +++---
server/src/handlers/users.rs | 52 +++---
server/src/health/checks.rs | 2 +-
server/src/holidays/model.rs | 22 +--
server/src/holidays/store.rs | 2 +-
server/src/jobs/runner.rs | 6 +-
server/src/mailer/send.rs | 2 +-
server/src/models/api_token.rs | 2 +-
server/src/models/clipboard.rs | 4 +-
server/src/models/group.rs | 4 +-
server/src/models/label.rs | 4 +-
server/src/models/user.rs | 30 ++--
server/src/modules/db_registry.rs | 6 +-
server/src/modules/marketplace/artifact.rs | 4 +-
server/src/modules/marketplace/catalog.rs | 2 +-
server/src/modules/marketplace/install.rs | 32 ++--
server/src/modules/marketplace/manifest.rs | 8 +-
server/src/modules/marketplace/progress.rs | 4 +-
server/src/modules/proxy.rs | 4 +-
server/src/network/acme.rs | 18 +-
server/src/network/cert.rs | 7 +-
server/src/network/config.rs | 14 +-
server/src/network/runtime.rs | 10 +-
server/src/network/store.rs | 8 +-
server/src/push/mapping.rs | 24 +--
server/src/push/unifiedpush.rs | 4 +-
server/src/rules/actions.rs | 10 +-
server/src/rules/backtest.rs | 20 +--
server/src/rules/catalog.rs | 8 +-
server/src/rules/condition.rs | 4 +-
server/src/rules/declare.rs | 162 +++++++++---------
server/src/rules/detect/scan.rs | 12 +-
server/src/rules/detect/store.rs | 6 +-
server/src/rules/dispatch.rs | 4 +-
server/src/rules/engine.rs | 6 +-
server/src/rules/gate.rs | 18 +-
server/src/rules/jobs.rs | 4 +-
server/src/rules/model.rs | 4 +-
server/src/rules/store.rs | 12 +-
server/src/rules/validate.rs | 60 +++----
server/src/settings/directory.rs | 20 +--
server/src/settings/password_policy.rs | 10 +-
server/src/settings/schema.rs | 8 +-
server/src/settings/scope.rs | 8 +-
server/src/settings/store.rs | 10 +-
server/src/setup/handlers.rs | 43 +++--
server/src/storage/remote/connector.rs | 22 +--
server/src/storage/remote/ftp.rs | 6 +-
server/src/storage/remote/gdrive.rs | 4 +-
server/src/storage/remote/mod.rs | 2 +-
server/src/storage/remote/nfs.rs | 8 +-
server/src/storage/remote/sftp.rs | 3 +-
server/src/storage/remote/smb.rs | 4 +-
server/src/storage/remote/webdav.rs | 26 +--
server/src/storage/usage.rs | 10 +-
server/src/support/mod.rs | 37 ++--
server/src/support/store.rs | 2 +-
server/tests/alerts_lifecycle.rs | 2 +-
server/tests/authz_delegation.rs | 2 +-
148 files changed, 1102 insertions(+), 1169 deletions(-)
diff --git a/mobile/common/kubuno-mobile-render/src/views/home.kbview b/mobile/common/kubuno-mobile-render/src/views/home.kbview
index d61201a8..a87c1fa8 100644
--- a/mobile/common/kubuno-mobile-render/src/views/home.kbview
+++ b/mobile/common/kubuno-mobile-render/src/views/home.kbview
@@ -12,6 +12,6 @@
-
+
diff --git a/mobile/common/kubuno-mobile-signin/src/lib.rs b/mobile/common/kubuno-mobile-signin/src/lib.rs
index 8176ae41..bea2e284 100644
--- a/mobile/common/kubuno-mobile-signin/src/lib.rs
+++ b/mobile/common/kubuno-mobile-signin/src/lib.rs
@@ -183,7 +183,7 @@ fn server_next() {
Ok(s) => s,
Err(e) => return fail(&e),
};
- let Some((generation, device_key)) = begin("Vérification du serveur…") else { return };
+ let Some((generation, device_key)) = begin("Checking server…") else { return };
spawn(async move {
let result = probe_server(&server, &device_key).await;
post_ui(move || {
@@ -207,9 +207,9 @@ fn submit() {
let login = input_value("signin_login").unwrap_or_default().trim().to_string();
let password = input_value("signin_password").unwrap_or_default();
if login.is_empty() || password.is_empty() {
- return set_error("Saisissez votre identifiant et votre mot de passe.".into());
+ return set_error("Enter your username and password.".into());
}
- let Some((generation, device_key)) = begin("Connexion…") else { return };
+ let Some((generation, device_key)) = begin("Signing in…") else { return };
let (server, app) = FLOW.with(|f| (f.borrow().server.clone(), f.borrow().app.clone()));
let opts = LoginOptions {
server,
@@ -240,10 +240,10 @@ fn submit() {
fn verify() {
let code = input_value("signin_code").unwrap_or_default().trim().to_string();
if code.is_empty() {
- return set_error("Saisissez le code.".into());
+ return set_error("Enter the code.".into());
}
let Some(pending) = FLOW.with(|f| f.borrow().pending.clone()) else { return go(Step::Login) };
- let Some((generation, _)) = begin("Vérification…") else { return };
+ let Some((generation, _)) = begin("Verifying…") else { return };
spawn(async move {
let result = verify_totp(&pending, &code).await;
post_ui(move || {
@@ -296,18 +296,18 @@ fn finish(tokens: NativeTokens) {
/// What to tell the user about a failed step.
pub fn message(e: &AccountError) -> String {
match e {
- AccountError::InvalidServer => "Adresse de serveur invalide.".into(),
- AccountError::NotKubuno => "Cette adresse ne répond pas comme un serveur Kubuno.".into(),
- AccountError::Secret(_) => "Impossible d'enregistrer la session sur cet appareil.".into(),
- AccountError::Protocol(_) => "Réponse inattendue du serveur.".into(),
+ AccountError::InvalidServer => "Invalid server address.".into(),
+ AccountError::NotKubuno => "This address does not respond as a Kubuno server.".into(),
+ AccountError::Secret(_) => "Cannot save the session on this device.".into(),
+ AccountError::Protocol(_) => "Unexpected server response.".into(),
AccountError::Api(api) => match api.status() {
- Some(401) | Some(403) => "Identifiant, mot de passe ou code incorrect.".into(),
- Some(429) => "Trop de tentatives. Réessayez dans une minute.".into(),
- Some(s) if s >= 500 => "Le serveur rencontre un problème. Réessayez plus tard.".into(),
- Some(s) => format!("Le serveur a refusé la demande (HTTP {s})."),
+ Some(401) | Some(403) => "Incorrect username, password, or code.".into(),
+ Some(429) => "Too many attempts. Try again in a minute.".into(),
+ Some(s) if s >= 500 => "The server is experiencing a problem. Try again later.".into(),
+ Some(s) => format!("The server refused the request (HTTP {s})."),
None => match api {
- ApiError::Network { .. } => "Serveur injoignable. Vérifiez l'adresse et votre connexion.".into(),
- _ => "Réponse inattendue du serveur.".into(),
+ ApiError::Network { .. } => "Server unreachable. Check the address and your connection.".into(),
+ _ => "Unexpected server response.".into(),
},
},
}
diff --git a/mobile/common/kubuno-mobile-signin/src/views/signin_login.kbview b/mobile/common/kubuno-mobile-signin/src/views/signin_login.kbview
index f45c34cb..eb679bd8 100644
--- a/mobile/common/kubuno-mobile-signin/src/views/signin_login.kbview
+++ b/mobile/common/kubuno-mobile-signin/src/views/signin_login.kbview
@@ -7,18 +7,18 @@
-
+
-
-
+
-
-
+
+
diff --git a/mobile/common/kubuno-mobile-signin/src/views/signin_server.kbview b/mobile/common/kubuno-mobile-signin/src/views/signin_server.kbview
index 66eec005..8b336f59 100644
--- a/mobile/common/kubuno-mobile-signin/src/views/signin_server.kbview
+++ b/mobile/common/kubuno-mobile-signin/src/views/signin_server.kbview
@@ -8,15 +8,15 @@
Layout="Dock" BackColor="#FFFFFF">
-
+
-
-
+
diff --git a/mobile/common/kubuno-mobile-signin/src/views/signin_totp.kbview b/mobile/common/kubuno-mobile-signin/src/views/signin_totp.kbview
index 58476276..ca118d96 100644
--- a/mobile/common/kubuno-mobile-signin/src/views/signin_totp.kbview
+++ b/mobile/common/kubuno-mobile-signin/src/views/signin_totp.kbview
@@ -6,8 +6,8 @@
-
-
+
-
-
+
+
diff --git a/server/src/alerts/model.rs b/server/src/alerts/model.rs
index f4f7c804..832d7fa7 100644
--- a/server/src/alerts/model.rs
+++ b/server/src/alerts/model.rs
@@ -398,11 +398,11 @@ pub const MAX_COMMENT_LEN: usize = 2_000;
pub fn clean_comment(raw: &str) -> Result {
let trimmed = raw.trim();
if trimmed.is_empty() {
- return Err(AppError::Validation("Le commentaire est vide".into()));
+ return Err(AppError::Validation("The comment is empty".into()));
}
if trimmed.chars().count() > MAX_COMMENT_LEN {
return Err(AppError::Validation(format!(
- "Le commentaire dépasse {MAX_COMMENT_LEN} caractères"
+ "The comment exceeds {MAX_COMMENT_LEN} characters"
)));
}
Ok(trimmed.to_string())
diff --git a/server/src/alerts/store.rs b/server/src/alerts/store.rs
index 376f0e63..af027f33 100644
--- a/server/src/alerts/store.rs
+++ b/server/src/alerts/store.rs
@@ -31,7 +31,7 @@ pub const MAX_LIMIT: i64 = 200;
pub const DEFAULT_LIMIT: i64 = 50;
/// Label recorded on the timeline for work the server did on its own.
-pub const SYSTEM_ACTOR: &str = "Système";
+pub const SYSTEM_ACTOR: &str = "System";
// Macros rather than `const`s so call sites splice them with `concat!`: each
// query is then a single `&'static str` literal fixed at compile time, and the
@@ -376,7 +376,7 @@ pub async fn auto_resolve(db: &DbPool, kind: &str, live: &[String]) -> Result Result>("label")
.map_err(AppError::Database)?;
@@ -952,7 +952,7 @@ pub async fn add_comment(
AppError::Database(e)
})?;
if exists.is_none() {
- return Err(AppError::NotFound("Alerte introuvable".into()));
+ return Err(AppError::NotFound("Alert not found".into()));
}
record_event(
@@ -1029,7 +1029,7 @@ pub async fn eligible_assignee(db: &DbPool, user_id: Uuid) -> Result Result {
let name = name.trim();
if name.is_empty() {
- return Err(AppError::Validation("Le nom du filtre est vide".into()));
+ return Err(AppError::Validation("The filter name is empty".into()));
}
if name.chars().count() > 120 {
- return Err(AppError::Validation("Le nom du filtre est trop long".into()));
+ return Err(AppError::Validation("The filter name is too long".into()));
}
if !filters.is_object() {
- return Err(AppError::Validation("Filtre invalide".into()));
+ return Err(AppError::Validation("Invalid filter".into()));
}
// Upsert then reselect: `RETURNING` is not portable, and on the conflict path
@@ -1137,7 +1137,7 @@ pub async fn delete_view(db: &DbPool, owner: Uuid, id: Uuid) -> Result<(), AppEr
AppError::Database(e)
})?;
if affected == 0 {
- return Err(AppError::NotFound("Filtre introuvable".into()));
+ return Err(AppError::NotFound("Filter not found".into()));
}
Ok(())
}
@@ -1236,7 +1236,7 @@ pub async fn severity_of(db: &DbPool, id: Uuid) -> Result {
tracing::error!(error = %e, alert_id = %id, "alerts: lecture de la gravité");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Alerte introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Alert not found".into()))?;
Severity::parse(&raw)
.ok_or_else(|| AppError::Internal(anyhow::anyhow!("Gravité d'alerte inconnue : {raw}")))
}
diff --git a/server/src/audit/query.rs b/server/src/audit/query.rs
index 5f87e83c..8b42627a 100644
--- a/server/src/audit/query.rs
+++ b/server/src/audit/query.rs
@@ -211,7 +211,7 @@ pub async fn get(db: &DbPool, id: i64) -> Result {
tracing::error!(error = %e, entry_id = id, "audit: lecture de l'entrée");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound(format!("Entrée d'audit {id}")))
+ .ok_or_else(|| AppError::NotFound(format!("Audit entry {id}")))
}
/// Escapes one CSV field (RFC 4180) and neutralises spreadsheet formula
diff --git a/server/src/audit/retention.rs b/server/src/audit/retention.rs
index 45af3b43..8878389a 100644
--- a/server/src/audit/retention.rs
+++ b/server/src/audit/retention.rs
@@ -35,16 +35,16 @@ pub fn clamp_retention(requested: i64) -> i64 {
/// the floor exists, not left believing they got what they asked for.
pub fn validate_retention(value: &serde_json::Value) -> Result {
let days = value.as_i64().ok_or_else(|| {
- AppError::Validation(format!("{RETENTION_SETTING_KEY} : un nombre de jours est attendu"))
+ AppError::Validation(format!("{RETENTION_SETTING_KEY}: expected a number of days"))
})?;
if days < MIN_RETENTION_DAYS {
return Err(AppError::Validation(format!(
- "{RETENTION_SETTING_KEY} : plancher de {MIN_RETENTION_DAYS} jours, non abaissable"
+ "{RETENTION_SETTING_KEY}: the minimum of {MIN_RETENTION_DAYS} days cannot be lowered"
)));
}
if days > 3650 {
return Err(AppError::Validation(format!(
- "{RETENTION_SETTING_KEY} : plafond de 3650 jours (10 ans)"
+ "{RETENTION_SETTING_KEY}: maximum 3650 days (10 years)"
)));
}
Ok(days)
diff --git a/server/src/auth/ddos.rs b/server/src/auth/ddos.rs
index 3a9a9002..869152bf 100644
--- a/server/src/auth/ddos.rs
+++ b/server/src/auth/ddos.rs
@@ -186,7 +186,7 @@ pub async fn concurrency_limit(req: Request, next: Next) -> Response {
if current > max {
INFLIGHT.fetch_sub(1, Ordering::Relaxed);
tracing::warn!("concurrency limit reached ({max} max) - shedding request");
- return too_busy("SERVER_BUSY", "Service momentanément saturé, réessayez");
+ return too_busy("SERVER_BUSY", "The service is temporarily overloaded. Please try again");
}
let _guard = InflightGuard; // décrémente en fin de scope
next.run(req).await
@@ -268,7 +268,7 @@ pub async fn global_rate_limit(req: Request, next: Next) -> Response {
return next.run(req).await;
}
}
- return too_busy("RATE_LIMITED", "Trop de requêtes, ralentissez");
+ return too_busy("RATE_LIMITED", "Too many requests. Please slow down");
}
next.run(req).await
}
diff --git a/server/src/auth/methods.rs b/server/src/auth/methods.rs
index 1cf108eb..24e4412a 100644
--- a/server/src/auth/methods.rs
+++ b/server/src/auth/methods.rs
@@ -41,7 +41,7 @@
//! configuration only ([`active_anywhere`]) - never on whether a login exists,
//! never on which unit it belongs to. The per-unit rule is applied once the
//! account is known, and a refusal at that point returns the same
-//! "Identifiants invalides" as every other failure, so it leaks nothing either.
+//! "Invalid credentials" as every other failure, so it leaks nothing either.
//! The cost is a slightly less guided sign-in page. That is the right trade
//! against an enumeration oracle.
//!
@@ -189,13 +189,13 @@ impl MethodSet {
pub fn validate(value: &Value) -> Result {
let Value::Array(items) = value else {
return Err(AppError::Validation(
- "auth.methods attend une liste, par exemple [\"local\",\"directory\"]".into(),
+ "auth.methods expects a list, for example [\"local\",\"directory\"]".into(),
));
};
let mut set = Self::none();
for item in items {
let name = item.as_str().ok_or_else(|| {
- AppError::Validation("auth.methods : chaque élément doit être un texte".into())
+ AppError::Validation("auth.methods: each item must be a string".into())
})?;
match Method::parse(name) {
Some(Method::Local) => set.local = true,
@@ -203,14 +203,14 @@ impl MethodSet {
Some(Method::Sso) => set.sso = true,
None => {
return Err(AppError::Validation(format!(
- "auth.methods : méthode inconnue « {name} » (attendu : local, directory, sso)"
+ "auth.methods: unknown method '{name}' (expected: local, directory, sso)"
)))
}
}
}
if set.is_empty() {
return Err(AppError::Validation(
- "auth.methods : au moins une méthode doit rester acceptée - une liste vide fermerait la porte à tout le monde".into(),
+ "auth.methods: at least one method must remain enabled; an empty list would lock everyone out".into(),
));
}
Ok(set)
@@ -449,15 +449,12 @@ pub async fn ensure_no_administrator_is_stranded(db: &DbPool) -> Result<(), AppE
.take(5)
.map(|a| match &a.org_unit {
Some(u) => format!("{} ({u})", a.username),
- None => format!("{} (sans unité)", a.username),
+ None => format!("{} (no unit)", a.username),
})
.collect();
Err(AppError::Validation(format!(
- "Refusé : {} administrateur(s) - délégués compris - ne pourraient plus se connecter : {}. \
- Laissez-leur une méthode utilisable pour leur unité, ou gardez le secours local des \
- administrateurs actif. En dernier recours, depuis la machine : \
- kubuno auth:recover --local-access",
+ "Refused: {} administrator(s), including delegated administrators, would be unable to sign in: {}. Keep a usable method for their unit, or keep administrator local recovery enabled. As a last resort, run on the server: kubuno auth:recover --local-access",
stranded.len(),
names.join(", ")
)))
diff --git a/server/src/auth/oauth.rs b/server/src/auth/oauth.rs
index d23ac4f0..0f02b26b 100644
--- a/server/src/auth/oauth.rs
+++ b/server/src/auth/oauth.rs
@@ -98,7 +98,7 @@ pub async fn discover(client: &reqwest::Client, issuer_url: &str) -> anyhow::Res
.get(&url)
.send()
.await
- .context("Appel discovery OIDC échoué")?;
+ .context("OIDC discovery request failed")?;
if !resp.status().is_success() {
let body = resp.text().await.unwrap_or_default();
return Err(anyhow::anyhow!("Discovery OIDC ({issuer}): {body}"));
@@ -167,7 +167,7 @@ pub async fn oidc_exchange_code(
.form(&form)
.send()
.await
- .context("Appel token OIDC échoué")?;
+ .context("OIDC token request failed")?;
if !resp.status().is_success() {
let body = resp.text().await.unwrap_or_default();
@@ -176,7 +176,7 @@ pub async fn oidc_exchange_code(
resp.json::()
.await
- .context("Réponse token OIDC invalide")
+ .context("Invalid OIDC token response")
}
// ── User info ─────────────────────────────────────────────────────────────────
@@ -207,7 +207,7 @@ pub async fn oidc_userinfo(
.bearer_auth(access_token)
.send()
.await
- .context("Appel userinfo OIDC échoué")?;
+ .context("OIDC userinfo request failed")?;
if !resp.status().is_success() {
let body = resp.text().await.unwrap_or_default();
@@ -220,7 +220,7 @@ pub async fn oidc_userinfo(
let raw: serde_json::Value = resp
.json()
.await
- .context("Réponse userinfo OIDC invalide")?;
+ .context("Invalid OIDC userinfo response")?;
let mut info: OidcUserInfo =
serde_json::from_value(raw.clone()).context("Profil OIDC sans `sub` exploitable")?;
info.raw = raw;
diff --git a/server/src/auth/rate_limit.rs b/server/src/auth/rate_limit.rs
index 21d88b47..f14f89c6 100644
--- a/server/src/auth/rate_limit.rs
+++ b/server/src/auth/rate_limit.rs
@@ -65,7 +65,7 @@ pub async fn rate_limit_auth(req: Request, next: Next) -> Response {
if exceeded {
let mut resp = axum::response::Response::new(axum::body::Body::from(
- json!({ "error": "RATE_LIMITED", "message": "Trop de tentatives, réessayez dans 60 secondes" }).to_string(),
+ json!({ "error": "RATE_LIMITED", "message": "Too many attempts. Try again in 60 seconds" }).to_string(),
));
*resp.status_mut() = StatusCode::TOO_MANY_REQUESTS;
resp.headers_mut().insert(
diff --git a/server/src/auth/reauth/catalog.rs b/server/src/auth/reauth/catalog.rs
index ea11e8b1..5a9bbd46 100644
--- a/server/src/auth/reauth/catalog.rs
+++ b/server/src/auth/reauth/catalog.rs
@@ -49,19 +49,19 @@ pub const SENSITIVE_ACTIONS: &[SensitiveAction] = &[
method: "POST",
path: "/me/api-tokens",
privilege: "api_tokens.create",
- label: "Créer un jeton d'API",
+ label: "Create an API token",
},
SensitiveAction {
method: "DELETE",
path: "/me/2fa",
privilege: "security.two_factor.disable",
- label: "Désactiver la double authentification",
+ label: "Disable two-factor authentication",
},
SensitiveAction {
method: "POST",
path: "/me/2fa/backup-codes",
privilege: "security.backup_codes.regenerate",
- label: "Régénérer les codes de secours",
+ label: "Regenerate backup codes",
},
];
diff --git a/server/src/auth/token_scope/policy.rs b/server/src/auth/token_scope/policy.rs
index 1776277b..fba3c2d0 100644
--- a/server/src/auth/token_scope/policy.rs
+++ b/server/src/auth/token_scope/policy.rs
@@ -140,7 +140,7 @@ pub async fn validate_requested(
if scopes.is_empty() {
return Err(AppError::Validation(
- "Un jeton doit porter au moins une portée : il n'existe pas de valeur par défaut « tout »."
+ "A token must have at least one scope; there is no default 'all' value."
.into(),
));
}
@@ -154,8 +154,7 @@ pub async fn validate_requested(
// why it will never be granted.
if forbids_scope(key) {
return Err(AppError::Validation(format!(
- "La portée « {key} » exige une réauthentification interactive \
- (réinitialisation du second facteur) : elle ne peut pas être confiée à un jeton."
+ "Scope '{key}' requires interactive reauthentication (second-factor reset) and cannot be assigned to a token."
)));
}
parse_key(key)?;
@@ -177,14 +176,12 @@ pub async fn validate_requested(
match rows.iter().find(|(k, _)| k == key) {
None => {
return Err(AppError::Validation(format!(
- "Portée inconnue « {key} » : elle n'existe pas dans le catalogue des privilèges."
+ "Unknown scope '{key}': it does not exist in the privilege catalog."
)));
}
Some((_, false)) => {
return Err(AppError::Validation(format!(
- "La portée « {key} » est réservée aux opérations interactives \
- (gestion des rôles, installation de modules, approbation de thèmes, \
- réinitialisation du second facteur) et ne peut pas être confiée à un jeton."
+ "Scope '{key}' is reserved for interactive operations (role management, module installation, theme approval, second-factor reset) and cannot be assigned to a token."
)));
}
Some((_, true)) => {}
@@ -220,8 +217,7 @@ pub async fn resolve_expiry(
let Some(days) = expires_in_days else {
if let Some(key) = mandatory.first() {
return Err(AppError::Validation(format!(
- "La portée « {key} » modifie l'instance : ce jeton doit porter une expiration \
- (au plus {cap} jours)."
+ "Scope '{key}' modifies the instance, so this token must expire within at most {cap} days."
)));
}
return Ok(None);
@@ -229,7 +225,7 @@ pub async fn resolve_expiry(
if days == 0 {
return Err(AppError::Validation(
- "L'expiration doit être d'au moins un jour.".into(),
+ "The expiration must be at least one day away.".into(),
));
}
let days = i64::from(days).min(cap);
diff --git a/server/src/authz/catalog.rs b/server/src/authz/catalog.rs
index f53023a1..bc00b28a 100644
--- a/server/src/authz/catalog.rs
+++ b/server/src/authz/catalog.rs
@@ -50,7 +50,7 @@ pub struct PrivilegeDef {
pub fn qualify(module_id: &str, relative_key: &str) -> Result {
if module_id == CORE_NAMESPACE {
return Err(AppError::Validation(
- "L'espace « core » est réservé au core".into(),
+ "The 'core' namespace is reserved for the core".into(),
));
}
let relative = relative_key.trim();
@@ -58,7 +58,7 @@ pub fn qualify(module_id: &str, relative_key: &str) -> Result
// namespace. Refuse instead of silently double-prefixing.
if relative.split('.').count() != 2 {
return Err(AppError::Validation(format!(
- "Privilège « {relative} » invalide : un module déclare « . », le préfixe est ajouté par le core"
+ "Invalid privilege '{relative}': a module declares '.'; the core adds the prefix"
)));
}
let full = format!("{module_id}.{relative}");
@@ -67,7 +67,7 @@ pub fn qualify(module_id: &str, relative_key: &str) -> Result
// Unreachable given the check above; kept as the assertion that the
// invariant is enforced rather than assumed.
return Err(AppError::Validation(format!(
- "Privilège « {full} » hors de l'espace du module « {module_id} »"
+ "Privilege '{full}' is outside module '{module_id}'s namespace"
)));
}
Ok(full)
diff --git a/server/src/authz/guards.rs b/server/src/authz/guards.rs
index df939bd3..6c0d72aa 100644
--- a/server/src/authz/guards.rs
+++ b/server/src/authz/guards.rs
@@ -78,7 +78,7 @@ async fn role_contents(db: &DbPool, role_id: Uuid) -> Result<(bool, Vec)
AppError::Database(e)
})?;
let is_superuser =
- is_superuser.ok_or_else(|| AppError::NotFound(format!("Rôle {role_id}")))?;
+ is_superuser.ok_or_else(|| AppError::NotFound(format!("Role {role_id}")))?;
let keys: Vec = db
.fetch_all_as::(
@@ -116,8 +116,7 @@ pub async fn ensure_scopable(
let (is_superuser, _) = role_contents(db, role_id).await?;
if is_superuser {
return Err(AppError::Validation(
- "Un rôle super-utilisateur ne peut pas être restreint à une unité organisationnelle : \
- il détient tout, présent et futur."
+ "A superuser role cannot be restricted to an organizational unit: it holds all current and future privileges."
.into(),
));
}
@@ -145,8 +144,7 @@ pub async fn ensure_scopable(
}
Err(AppError::Validation(format!(
- "Affectation impossible à une unité organisationnelle : ce rôle contient {} privilège(s) \
- non restreignable(s) ({}). Une portée d'unité serait une illusion de sécurité.",
+ "Cannot assign this role to an organizational unit: it contains {} privilege(s) that cannot be restricted ({}). A unit scope would not provide a real security boundary.",
blocking.len(),
blocking.join(", ")
)))
@@ -179,7 +177,7 @@ pub async fn ensure_can_grant(
// one's own scope even when every privilege is held.
if scope == AssignmentScope::OrgUnit {
let Some(target_unit) = unit else {
- return Err(AppError::Validation("Unité organisationnelle requise".into()));
+ return Err(AppError::Validation("Organizational unit required".into()));
};
let covered = keys
.iter()
@@ -338,7 +336,7 @@ pub async fn ensure_superadmin_remains(tx: &mut DbTx) -> Result<(), AppError> {
}
tracing::warn!("Refus : l'opération retirerait le dernier super-administrateur de l'instance");
Err(AppError::Validation(
- "Opération refusée : l'instance doit conserver au moins un super-administrateur actif.".into(),
+ "Operation refused: the instance must retain at least one active super-administrator.".into(),
))
}
diff --git a/server/src/authz/model.rs b/server/src/authz/model.rs
index 4297b895..fe0a0402 100644
--- a/server/src/authz/model.rs
+++ b/server/src/authz/model.rs
@@ -38,7 +38,7 @@ impl AssignmentScope {
"instance" => Ok(Self::Instance),
"org_unit" => Ok(Self::OrgUnit),
other => Err(AppError::Validation(format!(
- "Portée inconnue « {other} » : attendu « instance » ou « org_unit »"
+ "Unknown scope '{other}': expected 'instance' or 'org_unit'"
))),
}
}
@@ -104,7 +104,7 @@ pub struct ParsedKey<'a> {
pub fn parse_key(key: &str) -> Result, AppError> {
let invalid = |reason: &str| {
AppError::Validation(format!(
- "Privilège « {key} » invalide : {reason}. Attendu « .. »"
+ "Invalid privilege '{key}': {reason}. Expected '..'"
))
};
@@ -119,7 +119,7 @@ pub fn parse_key(key: &str) -> Result, AppError> {
};
if namespace.is_empty() || domain.is_empty() || verb.is_empty() {
- return Err(invalid("aucun segment ne peut être vide"));
+ return Err(invalid("No segment can be empty"));
}
let segment_ok = |s: &str| {
s.chars()
diff --git a/server/src/backup/archive.rs b/server/src/backup/archive.rs
index 2512be93..46584c91 100644
--- a/server/src/backup/archive.rs
+++ b/server/src/backup/archive.rs
@@ -417,17 +417,17 @@ pub async fn list_backup_files(destination: &Path) -> anyhow::Result Result<(), crate::errors::AppError> {
use crate::errors::AppError;
if name.is_empty() || name.len() > 255 {
- return Err(AppError::Validation("Nom de sauvegarde invalide".into()));
+ return Err(AppError::Validation("Invalid backup name".into()));
}
// No directory separators, no traversal: a name is a base name, never a path.
if name.contains('/') || name.contains('\\') || name.contains("..") || name.contains('\0') {
return Err(AppError::Validation(
- "Le nom de sauvegarde ne peut pas contenir de chemin".into(),
+ "The backup name cannot contain a path".into(),
));
}
if !is_dump_file(name) {
return Err(AppError::Validation(
- "Ce fichier n'est pas une sauvegarde Kubuno".into(),
+ "This file is not a Kubuno backup".into(),
));
}
Ok(())
diff --git a/server/src/backup/policy.rs b/server/src/backup/policy.rs
index d202c825..5a143688 100644
--- a/server/src/backup/policy.rs
+++ b/server/src/backup/policy.rs
@@ -249,18 +249,18 @@ pub fn validate_destination(raw: &str) -> Result 512 {
return Err(AppError::Validation(
- "Répertoire de destination : 512 caractères maximum".into(),
+ "Destination directory: maximum 512 characters".into(),
));
}
let path = std::path::Path::new(trimmed);
if !path.is_absolute() {
return Err(AppError::Validation(
- "Le répertoire de destination doit être un chemin absolu".into(),
+ "The destination directory must be an absolute path".into(),
));
}
if path
@@ -268,7 +268,7 @@ pub fn validate_destination(raw: &str) -> Result Result<(), AppError> {
Ok(())
} else {
Err(AppError::Validation(
- "Cette sauvegarde (format PostgreSQL COPY) ne peut être restaurée que sur une instance PostgreSQL".into(),
+ "This backup (PostgreSQL COPY format) can only be restored on a PostgreSQL instance".into(),
))
}
}
@@ -109,7 +109,7 @@ pub async fn restore_from_file(
let source_path = dest_dir.join(file_name);
if !tokio::fs::try_exists(&source_path).await.unwrap_or(false) {
- return Err(AppError::NotFound(format!("Sauvegarde introuvable : {file_name}")));
+ return Err(AppError::NotFound(format!("Backup not found: {file_name}")));
}
let format = archive::format_of(file_name);
ensure_engine_matches(db, format)?;
diff --git a/server/src/collab/mod.rs b/server/src/collab/mod.rs
index 3c43616e..e6b573a5 100644
--- a/server/src/collab/mod.rs
+++ b/server/src/collab/mod.rs
@@ -628,7 +628,7 @@ pub async fn close_room(
) -> Result, AppError> {
let room = dto.room.trim();
if room.is_empty() || room.len() > MAX_ROOM_LEN || room.chars().any(char::is_control) {
- return Err(AppError::Validation("room invalide".into()));
+ return Err(AppError::Validation("Invalid room".into()));
}
if !may_close(internal.module_id(), room) {
tracing::warn!(caller = %internal.0.label(), room = %room, "collab: room close refused (not the owner)");
diff --git a/server/src/data_export/policy.rs b/server/src/data_export/policy.rs
index a742a01b..b6dc8f61 100644
--- a/server/src/data_export/policy.rs
+++ b/server/src/data_export/policy.rs
@@ -356,18 +356,18 @@ pub fn validate_destination(raw: &str) -> Result 512 {
return Err(AppError::Validation(
- "Répertoire des archives : 512 caractères maximum".into(),
+ "Archive directory: maximum 512 characters".into(),
));
}
let path = std::path::Path::new(trimmed);
if !path.is_absolute() {
return Err(AppError::Validation(
- "Le répertoire des archives doit être un chemin absolu".into(),
+ "The archive directory must be an absolute path".into(),
));
}
if path
@@ -375,7 +375,7 @@ pub fn validate_destination(raw: &str) -> Result Result {
"export: ouverture d'une exécution impossible");
match e.as_database_error().and_then(|d| d.constraint()) {
Some("uq_core_data_export_self_active") => AppError::Conflict(
- "Une demande d'export est déjà en cours pour ce compte".into(),
+ "An export request is already in progress for this account".into(),
),
_ => AppError::Database(e),
}
diff --git a/server/src/data_migration/model.rs b/server/src/data_migration/model.rs
index 8f896c21..7259effe 100644
--- a/server/src/data_migration/model.rs
+++ b/server/src/data_migration/model.rs
@@ -42,7 +42,7 @@ impl ServiceKind {
match raw {
"mail" => Ok(ServiceKind::Mail),
other => Err(AppError::Validation(format!(
- "Service de migration inconnu : « {other} »"
+ "Unknown migration service: '{other}'"
))),
}
}
@@ -67,13 +67,13 @@ impl SourceSpec {
pub fn validate(&self) -> Result<(), AppError> {
if self.kind != "imap" {
return Err(AppError::Validation(
- "Type de serveur source non pris en charge (attendu : imap).".into(),
+ "Unsupported source server type (expected: imap).".into(),
));
}
let host = self.host.trim();
if host.is_empty() || host.len() > 255 {
return Err(AppError::Validation(
- "Adresse du serveur source manquante ou trop longue.".into(),
+ "The source server address is missing or too long.".into(),
));
}
// A host is a name or an address, never a URL: accepting
@@ -81,11 +81,11 @@ impl SourceSpec {
// later, at the first chunk, with nothing to point at.
if host.contains('/') || host.contains(' ') || host.contains(':') {
return Err(AppError::Validation(
- "Adresse du serveur source invalide : indiquez un nom d'hôte, sans schéma ni port.".into(),
+ "Invalid source server address: enter a hostname without a scheme or port.".into(),
));
}
if !(1..=65535).contains(&self.port) {
- return Err(AppError::Validation("Port du serveur source invalide.".into()));
+ return Err(AppError::Validation("Invalid source server port.".into()));
}
match self.security.as_str() {
// Refused, and this is not an oversight. The pilot module's IMAP
@@ -95,15 +95,14 @@ impl SourceSpec {
// and hand an entire organisation's passwords to the network in
// clear. A missing option is a limitation; this one would be a lie.
"starttls" => Err(AppError::Validation(
- "STARTTLS n'est pas pris en charge pour la migration : \
- utilisez une connexion SSL/TLS (port 993 en général)."
+ "STARTTLS is not supported for migration. Use an SSL/TLS connection (usually port 993)."
.into(),
)),
// Allowed because it claims nothing: an operator choosing it knows
// the session is not encrypted.
"ssl" | "none" => Ok(()),
_ => Err(AppError::Validation(
- "Méthode de connexion invalide (attendu : ssl ou none).".into(),
+ "Invalid connection method (expected: ssl or none).".into(),
)),
}
}
@@ -201,17 +200,17 @@ impl AccountMappingInput {
let login = self.source_login.trim();
if login.is_empty() || login.len() > 320 {
return Err(AppError::Validation(
- "Identifiant du compte source manquant ou trop long.".into(),
+ "The source account username is missing or too long.".into(),
));
}
if self.password.is_empty() {
return Err(AppError::Validation(format!(
- "Mot de passe manquant pour le compte source « {login} »."
+ "Missing password for source account '{login}'."
)));
}
if self.password.len() > 1024 {
return Err(AppError::Validation(
- "Mot de passe du compte source trop long.".into(),
+ "The source account password is too long.".into(),
));
}
Ok(())
@@ -228,11 +227,11 @@ pub const MAX_ACCOUNTS_PER_CAMPAIGN: usize = 2000;
pub fn validate_exclusions(folders: &[String]) -> Result<(), AppError> {
if folders.len() > 200 {
return Err(AppError::Validation(
- "Trop de dossiers exclus (200 au maximum).".into(),
+ "Too many excluded folders (maximum 200).".into(),
));
}
if folders.iter().any(|f| f.len() > 500) {
- return Err(AppError::Validation("Nom de dossier exclu trop long.".into()));
+ return Err(AppError::Validation("The excluded folder name is too long.".into()));
}
Ok(())
}
diff --git a/server/src/data_migration/store.rs b/server/src/data_migration/store.rs
index 83ed3925..21e065e7 100644
--- a/server/src/data_migration/store.rs
+++ b/server/src/data_migration/store.rs
@@ -94,7 +94,7 @@ pub async fn get(db: &DbPool, id: Uuid) -> Result {
tracing::error!(error = %e, campagne = %id, "data_migration: lecture d'une campagne");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Campagne de migration introuvable".into()))
+ .ok_or_else(|| AppError::NotFound("Migration campaign not found".into()))
}
/// What the console counts on a campaign row, read back per campaign.
@@ -247,7 +247,7 @@ pub async fn secret_of(db: &DbPool, account_id: Uuid) -> Result {
AppError::Validation(
- "Compte de destination inconnu : rechargez la page et refaites la correspondance."
+ "Unknown destination account. Reload the page and map the accounts again."
.into(),
)
}
@@ -386,7 +386,7 @@ pub async fn retry_account(db: &DbPool, campaign_id: Uuid, account_id: Uuid) ->
if affected == 0 {
return Err(AppError::Conflict(
- "Ce compte n'est pas en échec : il n'y a rien à relancer.".into(),
+ "This account has not failed; there is nothing to retry.".into(),
));
}
Ok(())
diff --git a/server/src/devices/declared.rs b/server/src/devices/declared.rs
index 2e6ab29b..685afcaa 100644
--- a/server/src/devices/declared.rs
+++ b/server/src/devices/declared.rs
@@ -144,7 +144,7 @@ pub async fn apply(
})?;
if affected == 0 {
- return Err(AppError::NotFound("Appareil introuvable".into()));
+ return Err(AppError::NotFound("Device not found".into()));
}
// The timeline records that a declaration arrived and what it claimed - the
diff --git a/server/src/devices/store.rs b/server/src/devices/store.rs
index e02bec93..45decfa0 100644
--- a/server/src/devices/store.rs
+++ b/server/src/devices/store.rs
@@ -286,7 +286,7 @@ pub async fn get(db: &DbPool, id: Uuid, ctx: &AdminContext) -> Result Result Result<(), AppError> {
AppError::Database(e)
})?;
if affected == 0 {
- return Err(AppError::NotFound("Appareil introuvable".into()));
+ return Err(AppError::NotFound("Device not found".into()));
}
Ok(())
}
@@ -614,7 +614,7 @@ pub async fn rename(
AppError::Database(e)
})?;
if affected == 0 {
- return Err(AppError::NotFound("Appareil introuvable".into()));
+ return Err(AppError::NotFound("Device not found".into()));
}
Ok(())
}
diff --git a/server/src/directory/auth.rs b/server/src/directory/auth.rs
index 32d574a4..f6b01926 100644
--- a/server/src/directory/auth.rs
+++ b/server/src/directory/auth.rs
@@ -42,7 +42,7 @@
//!
//! Nothing that distinguishes the cases. Whether the address is unknown, the
//! password is wrong, the directory refused the bind or the directory is down,
-//! the sign-in route answers the same "Identifiants invalides" it has always
+//! the sign-in route answers the same "Invalid credentials" it has always
//! answered. The diagnosis lives in the log and in the administration console's
//! test button, both of which require an operator.
@@ -177,7 +177,7 @@ pub async fn search_then_bind(
) -> Result {
if !dir.is_usable() {
return Err(DirectoryError::Misconfigured(
- "annuaire désactivé ou incomplet".into(),
+ "Directory disabled or incompletely configured".into(),
));
}
let search_filter = filter::build_user_filter(&dir.user_filter, login)
@@ -222,7 +222,7 @@ pub async fn search_then_bind(
let mapped = map_user(&entry, &attrs);
if mapped.dn.is_empty() {
conn.close().await;
- return Err(DirectoryError::SearchFailed("entrée sans DN".into()));
+ return Err(DirectoryError::SearchFailed("Entry has no DN".into()));
}
// The bind is the authentication. It runs on the same connection, which
diff --git a/server/src/directory/client.rs b/server/src/directory/client.rs
index ac29b124..c3034a45 100644
--- a/server/src/directory/client.rs
+++ b/server/src/directory/client.rs
@@ -70,13 +70,13 @@ impl DirectoryError {
/// Wording for the administration console. Never reaches the sign-in path.
pub fn message(&self) -> String {
match self {
- Self::Misconfigured(d) => format!("Configuration incomplète : {d}"),
- Self::Unreachable(_) => "Annuaire injoignable".into(),
- Self::ServiceBindFailed(_) => "Liaison du compte de service refusée".into(),
- Self::SearchFailed(_) => "Recherche refusée par l'annuaire".into(),
- Self::NoSuchUser => "Aucune entrée ne correspond au filtre".into(),
- Self::Ambiguous(n) => format!("Le filtre correspond à {n} entrées - il doit en désigner une seule"),
- Self::InvalidCredentials(_) => "Identifiants refusés par l'annuaire".into(),
+ Self::Misconfigured(d) => format!("Incomplete configuration: {d}"),
+ Self::Unreachable(_) => "Directory unreachable".into(),
+ Self::ServiceBindFailed(_) => "Service account bind refused".into(),
+ Self::SearchFailed(_) => "Search refused by the directory".into(),
+ Self::NoSuchUser => "No entry matches the filter".into(),
+ Self::Ambiguous(n) => format!("The filter matches {n} entries; it must identify exactly one"),
+ Self::InvalidCredentials(_) => "Credentials refused by the directory".into(),
}
}
@@ -96,28 +96,22 @@ impl DirectoryError {
/// them and no idea which of six fields is wrong.
pub fn hint(&self) -> &'static str {
match self {
- Self::Misconfigured(_) => "Renseignez l'hôte, le DN de base et le filtre de recherche.",
+ Self::Misconfigured(_) => "Enter the host, base DN, and search filter.",
Self::Unreachable(_) => {
- "Vérifiez l'hôte, le port et le mode de chiffrement. En LDAPS le certificat doit être \
- signé par une autorité connue - collez l'autorité privée de votre annuaire si nécessaire."
+ "Check the host, port, and encryption mode. For LDAPS, the certificate must be signed by a trusted authority. Paste your directory's private CA if needed."
}
Self::ServiceBindFailed(_) => {
- "Vérifiez le DN complet du compte de service (par ex. cn=service,ou=comptes,dc=exemple,dc=com) \
- et son mot de passe. Active Directory accepte aussi la forme service@exemple.com."
+ "Check the service account's full DN (e.g. cn=service,ou=accounts,dc=example,dc=com) and its password. Active Directory also accepts service@example.com."
}
Self::SearchFailed(_) => {
- "Vérifiez le DN de base et la syntaxe du filtre. Le compte de service doit avoir le droit \
- de lire cette branche."
+ "Check the base DN and filter syntax. The service account must have permission to read this branch."
}
Self::NoSuchUser => {
- "Le filtre est syntaxiquement valide mais ne trouve personne : vérifiez l'attribut \
- d'identifiant (uid pour un annuaire standard, sAMAccountName pour Active Directory) \
- et le DN de base."
+ "The filter is syntactically valid but finds no users. Check the username attribute (uid for a standard directory, sAMAccountName for Active Directory) and the base DN."
}
- Self::Ambiguous(_) => "Ajoutez une clause au filtre pour qu'il ne désigne qu'une entrée.",
+ Self::Ambiguous(_) => "Add a filter clause so it identifies exactly one entry.",
Self::InvalidCredentials(_) => {
- "Le compte a été trouvé dans l'annuaire mais la liaison a échoué : mot de passe erroné, \
- ou compte désactivé, expiré ou verrouillé côté annuaire."
+ "The account was found in the directory, but the bind failed: the password is incorrect or the account is disabled, expired, or locked in the directory."
}
}
}
@@ -177,18 +171,18 @@ fn root_store_with(ca_pem: &str) -> Result {
let certs: Vec> = rustls_pemfile::certs(&mut reader)
.collect::, _>>()
.map_err(|e| {
- DirectoryError::Misconfigured(format!("autorité de certification illisible : {e}"))
+ DirectoryError::Misconfigured(format!("Cannot read the certificate authority: {e}"))
})?;
if certs.is_empty() {
return Err(DirectoryError::Misconfigured(
- "l'autorité de certification fournie ne contient aucun certificat PEM".into(),
+ "The supplied certificate authority contains no PEM certificates".into(),
));
}
let count = certs.len();
let (added, ignored) = store.add_parsable_certificates(certs);
if added == 0 {
return Err(DirectoryError::Misconfigured(format!(
- "l'autorité de certification fournie ({count} bloc(s) PEM) n'a pas pu être chargée"
+ "The supplied certificate authority ({count} PEM block(s)) could not be loaded"
)));
}
if ignored > 0 {
@@ -263,10 +257,10 @@ impl Connection {
service_password: &str,
) -> Result {
if dir.host.trim().is_empty() {
- return Err(DirectoryError::Misconfigured("hôte non renseigné".into()));
+ return Err(DirectoryError::Misconfigured("Host not specified".into()));
}
if dir.base_dn.trim().is_empty() {
- return Err(DirectoryError::Misconfigured("DN de base non renseigné".into()));
+ return Err(DirectoryError::Misconfigured("Base DN not specified".into()));
}
// rustls refuses to build anything before a crypto provider exists.
@@ -349,7 +343,7 @@ impl Connection {
pub async fn bind_as(&mut self, dn: &str, password: &str) -> Result<(), DirectoryError> {
if password.is_empty() {
return Err(DirectoryError::InvalidCredentials(
- "mot de passe vide (liaison non authentifiée refusée)".into(),
+ "Empty password (unauthenticated bind refused)".into(),
));
}
let res = self
@@ -528,7 +522,7 @@ mod tests {
}
other => panic!("attendu ServiceBindFailed, obtenu {other:?}"),
}
- assert!(err.hint().contains("compte de service"));
+ assert!(err.hint().contains("service account"));
}
#[test]
diff --git a/server/src/directory/config.rs b/server/src/directory/config.rs
index 1de4f57e..dddc0070 100644
--- a/server/src/directory/config.rs
+++ b/server/src/directory/config.rs
@@ -109,7 +109,7 @@ pub async fn load(db: &DbPool, id: uuid::Uuid) -> Result Connecti
let sample_filter = match filter::build_sync_filter(&dir.user_filter) {
Ok(f) => f,
Err(e) => {
- probe.message = "Filtre de recherche invalide".into();
+ probe.message = "Invalid search filter".into();
probe.detail = Some(e.message().to_string());
probe.hint = Some(
- "Le filtre doit contenir « {login} » : c'est l'endroit où l'identifiant saisi est inséré."
+ "The filter must contain '{login}', where the entered username is inserted."
.into(),
);
probe.elapsed_ms = started.elapsed().as_millis() as u64;
@@ -164,14 +164,12 @@ pub async fn probe_connection(jwt_secret: &str, dir: &LdapDirectory) -> Connecti
// Connected, bound, searched - and matched nobody. Worth its own
// wording: the connection is fine and the mapping is not.
probe.hint = Some(
- "La connexion et la liaison fonctionnent, mais le filtre ne trouve personne. \
- Vérifiez le DN de base et l'attribut d'identifiant (uid pour un annuaire standard, \
- sAMAccountName pour Active Directory)."
+ "The connection and bind work, but the filter finds no users. Check the base DN and username attribute (uid for a standard directory, sAMAccountName for Active Directory)."
.into(),
);
- "Connexion établie, aucune entrée trouvée".into()
+ "Connected; no entries found".into()
} else {
- "Connexion établie".into()
+ "Connected".into()
};
probe.elapsed_ms = started.elapsed().as_millis() as u64;
probe
@@ -204,7 +202,7 @@ pub async fn probe_authentication(
match super::auth::search_then_bind(dir, &service_password, login, password).await {
Ok(mapped) => {
probe.ok = true;
- probe.message = "Authentification réussie".into();
+ probe.message = "Authentication succeeded".into();
probe.dn = Some(mapped.dn.clone());
probe.sample_mapping = Some(SampleMapping {
username: mapped.username.clone(),
@@ -222,16 +220,15 @@ pub async fn probe_authentication(
qui l'authentifie, pas l'annuaire.",
u.username
),
- Ok(Some(u)) => format!("Le compte « {} » est gouverné par cet annuaire.", u.username),
+ Ok(Some(u)) => format!("Account '{}' is managed by this directory.", u.username),
Ok(None) if dir.allow_signup => {
- "Aucun compte local - une connexion réelle en créerait un.".into()
+ "No local account; a real sign-in would create one.".into()
}
Ok(None) => {
- "Aucun compte local, et la création est désactivée sur cet annuaire : la connexion \
- échouerait malgré une liaison réussie."
+ "No local account, and account creation is disabled for this directory. Sign-in would fail despite a successful bind."
.into()
}
- Err(_) => "État du compte local indéterminé.".into(),
+ Err(_) => "Could not determine the local account's state.".into(),
});
}
Err(e) => {
diff --git a/server/src/directory/sync.rs b/server/src/directory/sync.rs
index 04e4fe24..0c407346 100644
--- a/server/src/directory/sync.rs
+++ b/server/src/directory/sync.rs
@@ -99,20 +99,20 @@ impl SyncReport {
/// One-line summary stored in `last_sync_detail` and shown in the list.
pub fn summary(&self) -> String {
let mut parts = vec![format!(
- "{} compte(s) vus - {} créé(s), {} lié(s), {} ignoré(s)",
+ "{} account(s) seen — {} created, {} linked, {} skipped",
self.users_seen, self.users_created, self.users_linked, self.users_skipped
)];
if self.groups_seen > 0 {
parts.push(format!(
- "{} groupe(s), {} adhésion(s) ajoutée(s), {} retirée(s)",
+ "{} group(s), {} membership(s) added, {} removed",
self.groups_seen, self.memberships_added, self.memberships_removed
));
}
if self.disabled > 0 {
- parts.push(format!("{} compte(s) désactivé(s)", self.disabled));
+ parts.push(format!("{} account(s) disabled", self.disabled));
}
if let Some(reason) = &self.disable_refused {
- parts.push(format!("désactivation suspendue : {reason}"));
+ parts.push(format!("Deactivation suspended: {reason}"));
}
for w in self.warnings.iter().take(3) {
parts.push(w.clone());
@@ -132,15 +132,13 @@ pub fn disable_guard(governed: usize, seen: usize, would_disable: usize) -> Opti
}
if seen == 0 {
return Some(format!(
- "l'annuaire n'a retourné aucune entrée alors que {governed} compte(s) en dépendent - \
- incident réseau ou configuration cassée plutôt que départs"
+ "The directory returned no entries even though {governed} account(s) depend on it. This may be a network or configuration issue rather than departures"
));
}
let ceiling = DISABLE_FLOOR.max((governed as f64 * DISABLE_MAX_RATIO).ceil() as usize);
if would_disable > ceiling {
return Some(format!(
- "{would_disable} compte(s) sur {governed} seraient désactivés, au-delà du plafond de {ceiling} \
- par exécution - relancez après avoir vérifié le filtre et le DN de base"
+ "{would_disable} of {governed} account(s) would be disabled, exceeding the per-run limit of {ceiling}. Check the filter and base DN before running again"
));
}
None
@@ -162,7 +160,7 @@ pub async fn run(db: &DbPool, jwt_secret: &str, dir: &LdapDirectory) -> Result Result Result 0;
if !trustworthy {
report.warnings.push(
- "aucune entrée retournée : adhésions de groupe laissées intactes".into(),
+ "No entries returned; group memberships left unchanged".into(),
);
}
match sync_groups(db, dir, &mut conn, &by_dn, &member_of_edges, trustworthy).await {
@@ -285,7 +283,7 @@ pub async fn run(db: &DbPool, jwt_secret: &str, dir: &LdapDirectory) -> Result {
- report.warnings.push(super::client::truncate(&format!("désactivation : {e}")));
+ report.warnings.push(super::client::truncate(&format!("Deactivation: {e}")));
}
}
}
@@ -380,7 +378,7 @@ async fn disable_missing(
.module("core")
.target(target::USER, *id, username.clone())
.detail(format!(
- "absent de l'annuaire « {} » - compte désactivé, aucune donnée supprimée",
+ "Missing from directory '{}'; account disabled, no data deleted",
dir.display_name
))
.reversible(),
@@ -454,7 +452,7 @@ async fn sync_groups(
}
Err(e) => {
out.warnings.push(super::client::truncate(&format!(
- "groupe « {} » non importé : {e}",
+ "Group '{}' not imported: {e}",
group.name
)));
continue;
@@ -589,7 +587,7 @@ async fn upsert_group(
params![
id,
&name,
- format!("Importé de l'annuaire « {} »", dir.display_name),
+ format!("Imported from directory '{}'", dir.display_name),
dir.id,
&group.dn
],
@@ -680,7 +678,7 @@ async fn finalise(db: &DbPool, dir: &LdapDirectory, report: SyncReport) -> SyncR
.warnings
.first()
.cloned()
- .unwrap_or_else(|| "synchronisation échouée".into()),
+ .unwrap_or_else(|| "Synchronization failed".into()),
)
} else {
outcome_entry
@@ -700,7 +698,7 @@ mod tests {
// Every one of them looks "missing" and every one of them would be
// switched off. Refused, with a reason an operator can act on.
let reason = disable_guard(120, 0, 120).expect("garde-fou déclenché");
- assert!(reason.contains("aucune entrée"));
+ assert!(reason.contains("no entries"));
}
#[test]
@@ -708,7 +706,7 @@ mod tests {
// 100 governed, 100 returned, but half of them stamped as missing -
// a filter change, not a hundred resignations.
let reason = disable_guard(100, 100, 50).expect("garde-fou déclenché");
- assert!(reason.contains("plafond"));
+ assert!(reason.contains("limit"));
}
#[test]
@@ -739,7 +737,7 @@ mod tests {
r.disable_refused = Some("l'annuaire n'a retourné aucune entrée".into());
let s = r.summary();
assert!(s.contains("3 compte(s) vus"));
- assert!(s.contains("désactivation suspendue"));
+ assert!(s.contains("Deactivation suspended"));
// Bounded, whatever the directory answered.
assert!(s.chars().count() <= super::super::client::MAX_ERROR_LEN + 1);
}
diff --git a/server/src/domains/dns.rs b/server/src/domains/dns.rs
index 37fc1a95..431e3e78 100644
--- a/server/src/domains/dns.rs
+++ b/server/src/domains/dns.rs
@@ -82,10 +82,10 @@ impl ProbeError {
/// shows an administrator.
pub fn message(&self) -> String {
match self {
- Self::NoResolver => "Cette instance n'a pas de résolveur DNS utilisable : la vérification est impossible tant que le serveur ne peut pas interroger le DNS.".into(),
- Self::UnknownDomain => "Ce domaine n'existe pas dans le DNS. Vérifiez son orthographe.".into(),
- Self::NoRecord => "Aucun enregistrement de ce type n'est publié sur ce domaine.".into(),
- Self::Unreachable(detail) => format!("Le DNS n'a pas répondu : {detail}"),
+ Self::NoResolver => "This instance has no usable DNS resolver. Verification is impossible until the server can query DNS.".into(),
+ Self::UnknownDomain => "This domain does not exist in DNS. Check its spelling.".into(),
+ Self::NoRecord => "No record of this type is published for this domain.".into(),
+ Self::Unreachable(detail) => format!("DNS did not respond: {detail}"),
}
}
}
@@ -99,7 +99,7 @@ async fn lookup(name: &str, record_type: RecordType) -> Result, Prob
let query = format!("{}.", name.trim_end_matches('.'));
let response = match tokio::time::timeout(QUERY_TIMEOUT, resolver.lookup(query, record_type)).await {
- Err(_) => return Err(ProbeError::Unreachable("délai dépassé".into())),
+ Err(_) => return Err(ProbeError::Unreachable("Timed out".into())),
Ok(Ok(response)) => response,
Ok(Err(e)) => {
let text = e.to_string();
diff --git a/server/src/domains/model.rs b/server/src/domains/model.rs
index a86209fd..cf75aa6f 100644
--- a/server/src/domains/model.rs
+++ b/server/src/domains/model.rs
@@ -35,7 +35,7 @@ impl DomainKind {
"alias" => Self::Alias,
other => {
return Err(AppError::Validation(format!(
- "Type de domaine « {other} » inconnu"
+ "Unknown domain type '{other}'"
)))
}
})
@@ -124,37 +124,36 @@ pub fn normalise_name(raw: &str) -> Result {
let name = name.trim_end_matches('.').trim().to_string();
if name.is_empty() {
- return Err(AppError::Validation("Indiquez un nom de domaine.".into()));
+ return Err(AppError::Validation("Enter a domain name.".into()));
}
if name.len() > 253 {
- return Err(AppError::Validation("Nom de domaine trop long.".into()));
+ return Err(AppError::Validation("The domain name is too long.".into()));
}
if !name.contains('.') {
return Err(AppError::Validation(
- "Un domaine comporte au moins un point (« exemple.fr »).".into(),
+ "A domain must contain at least one dot (e.g. 'example.com').".into(),
));
}
if !name.is_ascii() {
return Err(AppError::Validation(
- "Les noms accentués ou non latins doivent être saisis sous leur forme punycode (« xn--… »), \
- qui est celle que le DNS transporte."
+ "Accented or non-Latin names must be entered in punycode form ('xn--…'), which is the form used by DNS."
.into(),
));
}
for label in name.split('.') {
if label.is_empty() || label.len() > 63 {
return Err(AppError::Validation(
- "Chaque partie du domaine doit faire entre 1 et 63 caractères.".into(),
+ "Each domain label must contain between 1 and 63 characters.".into(),
));
}
if label.starts_with('-') || label.ends_with('-') {
return Err(AppError::Validation(
- "Une partie du domaine ne peut pas commencer ni finir par un tiret.".into(),
+ "A domain label cannot start or end with a hyphen.".into(),
));
}
if !label.chars().all(|c| c.is_ascii_alphanumeric() || c == '-') {
return Err(AppError::Validation(
- "Un domaine ne contient que des lettres, des chiffres et des tirets.".into(),
+ "A domain can only contain letters, numbers, and hyphens.".into(),
));
}
}
diff --git a/server/src/domains/store.rs b/server/src/domains/store.rs
index c2244c64..09b38a14 100644
--- a/server/src/domains/store.rs
+++ b/server/src/domains/store.rs
@@ -115,7 +115,7 @@ pub async fn get(db: &DbPool, id: Uuid) -> Result {
tracing::error!(error = %e, "domains: lecture");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Domaine introuvable".into()))?
+ .ok_or_else(|| AppError::NotFound("Domain not found".into()))?
.into_domain()
}
@@ -170,7 +170,7 @@ pub async fn create(
) -> Result {
if kind == DomainKind::Primary {
return Err(AppError::Validation(
- "Le domaine principal ne se crée pas : ajoutez le domaine, vérifiez-le, puis promouvez-le.".into(),
+ "The primary domain cannot be created directly. Add the domain, verify it, then promote it.".into(),
));
}
@@ -179,7 +179,7 @@ pub async fn create(
// claim the registry exists to check.
if kind == DomainKind::Alias {
let parent_id = parent_id.ok_or_else(|| {
- AppError::Validation("Un alias doit désigner le domaine dont il reprend les adresses.".into())
+ AppError::Validation("An alias must specify the domain whose addresses it uses.".into())
})?;
let parent = tx
.fetch_optional_row(
@@ -188,23 +188,23 @@ pub async fn create(
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::Validation("Le domaine désigné n'existe pas.".into()))?;
+ .ok_or_else(|| AppError::Validation("The specified domain does not exist.".into()))?;
let parent_kind: String = parent.try_get("kind").map_err(AppError::Database)?;
if parent_kind == "alias" {
return Err(AppError::Validation(
- "Un alias ne peut pas désigner un autre alias : rattachez-le au domaine d'origine.".into(),
+ "An alias cannot point to another alias. Link it to the original domain.".into(),
));
}
let parent_verified: Option> =
parent.try_get("verified_at").map_err(AppError::Database)?;
if parent_verified.is_none() {
return Err(AppError::Validation(
- "Vérifiez d'abord le domaine dont cet alias reprend les adresses.".into(),
+ "First verify the domain whose addresses this alias uses.".into(),
));
}
} else if parent_id.is_some() {
return Err(AppError::Validation(
- "Seul un alias désigne un domaine d'origine.".into(),
+ "Only an alias specifies an original domain.".into(),
));
}
@@ -225,7 +225,7 @@ pub async fn create(
.map_err(|e| {
if let sqlx::Error::Database(db) = &e {
if db.is_unique_violation() {
- return AppError::Conflict(format!("Le domaine « {name} » est déjà déclaré ici."));
+ return AppError::Conflict(format!("Domain '{name}' is already configured here."));
}
}
tracing::error!(error = %e, domain = %name, "domains: création");
@@ -258,12 +258,12 @@ pub async fn verify(db: &DbPool, id: Uuid) -> Result {
.map_err(AppError::Database)?;
}
Ok(result) => {
- let mut message = "L'enregistrement TXT attendu n'a pas été trouvé sur ce domaine.".to_string();
+ let mut message = "The expected TXT record was not found on this domain.".to_string();
if !result.others.is_empty() {
// The near-miss worth naming: a token from another instance, or
// one published on the wrong name.
message.push_str(&format!(
- " D'autres jetons de vérification sont publiés : {}.",
+ "Other verification tokens are published: {}.",
result.others.join(", ")
));
}
@@ -330,19 +330,19 @@ pub async fn promote(tx: &mut DbTx, id: Uuid) -> Result<(String, Option)
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Domaine introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Domain not found".into()))?;
let name: String = row.try_get("name").map_err(AppError::Database)?;
let kind: String = row.try_get("kind").map_err(AppError::Database)?;
match kind.as_str() {
"primary" => {
return Err(AppError::Validation(format!(
- "« {name} » est déjà le domaine principal."
+ "'{name}' is already the primary domain."
)))
}
"alias" => {
return Err(AppError::Validation(
- "Un alias ne peut pas devenir le domaine principal : il ne porte aucun compte.".into(),
+ "An alias cannot become the primary domain because it has no accounts.".into(),
))
}
_ => {}
@@ -351,7 +351,7 @@ pub async fn promote(tx: &mut DbTx, id: Uuid) -> Result<(String, Option)
row.try_get("verified_at").map_err(AppError::Database)?;
if verified_at.is_none() {
return Err(AppError::Validation(format!(
- "Vérifiez « {name} » avant d'en faire le domaine principal."
+ "Verify '{name}' before making it the primary domain."
)));
}
@@ -401,7 +401,7 @@ pub async fn removal_blockers(db: &DbPool, domain: &Domain) -> Result 0 {
blockers.push(format!(
- "{} compte(s) portent une adresse à ce domaine. Changez leur adresse avant de le retirer.",
+ "{} account(s) use an address on this domain. Change their addresses before removing it.",
domain.account_count
));
}
diff --git a/server/src/errors/app_error.rs b/server/src/errors/app_error.rs
index 63dd9666..c94895d8 100644
--- a/server/src/errors/app_error.rs
+++ b/server/src/errors/app_error.rs
@@ -8,15 +8,15 @@ use thiserror::Error;
#[derive(Debug, Error)]
pub enum AppError {
- #[error("Non authentifié")]
+ #[error("Not authenticated")]
Unauthorized,
- #[error("Accès refusé")]
+ #[error("Access denied")]
Forbidden,
/// The account still carries the password it was seeded with: administrative
/// writes stay closed until the owner picks a new one.
- #[error("Changement de mot de passe requis avant toute action d'administration")]
+ #[error("You must change your password before performing administrative actions")]
PasswordChangeRequired,
/// The action is sensitive and the caller has not proved presence recently.
@@ -25,13 +25,13 @@ pub enum AppError {
/// indistinguishable from a genuine lack of authorisation, so a client cannot
/// tell whether to offer a way forward. This one carries a code the client
/// acts on - open the re-authentication dialog, then replay the request.
- #[error("Réauthentification requise pour cette action sensible")]
+ #[error("Reauthentication is required for this sensitive action")]
ReauthRequired,
/// The caller is a personal API token: no second factor, nobody at the
/// keyboard, so the challenge can never be met. Final, not retryable - a
/// `ReauthRequired` here would send an unattended script into a loop.
- #[error("Cette action sensible exige une personne : un jeton d'API ne peut pas la réaliser")]
+ #[error("This sensitive action requires a person; an API token cannot perform it")]
ReauthImpossible,
/// A personal API token issued before scopes existed, presented after its
@@ -43,30 +43,25 @@ pub enum AppError {
/// one with explicit scopes. A 401 would send the holder debugging the wrong
/// thing, and the client's refresh interceptor chasing a token it cannot mint.
#[error(
- "Ce jeton d'API a été émis avant les portées et sa période de transition est terminée. \
- Réémettez un jeton en sélectionnant explicitement ses portées \
- (Paramètres → Jetons d'API)."
+ "This API token was issued before scopes were introduced and its transition period has ended. Issue a new token with explicitly selected scopes (Settings → API tokens)."
)]
ApiTokenLegacyExpired,
/// A legacy token attempting an administrative write. Refused immediately,
/// with no grace period - this is the defect the scoping work exists to close.
#[error(
- "Un jeton d'API sans portées ne peut pas effectuer d'écriture d'administration. \
- Réémettez un jeton en sélectionnant explicitement ses portées."
+ "An API token without scopes cannot make administrative changes. Issue a new token with explicitly selected scopes."
)]
ApiTokenLegacyAdminWrite,
/// The token authenticated, but does not carry the scope this route needs.
- #[error("Ce jeton d'API ne porte pas la portée requise pour cette opération : {0}")]
+ #[error("This API token does not have the scope required for this operation: {0}")]
ApiTokenScopeMissing(String),
/// The instance requires administrators to carry a second factor and this
/// account's grace window has closed.
#[error(
- "Double authentification obligatoire pour les administrateurs : \
- le délai de grâce est écoulé. Configurez-la dans Paramètres → Sécurité \
- pour retrouver l'accès à l'administration."
+ "Two-factor authentication is required for administrators and the grace period has ended. Configure it in Settings → Security to regain administrative access."
)]
TwoFactorRequired,
@@ -78,13 +73,13 @@ pub enum AppError {
#[error("{0}")]
SettingLocked(String),
- #[error("Ressource introuvable: {0}")]
+ #[error("Resource not found: {0}")]
NotFound(String),
- #[error("Données invalides: {0}")]
+ #[error("Invalid data: {0}")]
Validation(String),
- #[error("Conflit: {0}")]
+ #[error("Conflict: {0}")]
Conflict(String),
/// Sign-in is refused because the account has failed enough times that a
@@ -92,10 +87,10 @@ pub enum AppError {
/// user-facing message is the SAME generic "invalid credentials" as every
/// other sign-in failure - only the machine `code` differs, so the login
/// form knows to show the CAPTCHA. See `handlers::auth::login`.
- #[error("Identifiants invalides")]
+ #[error("Invalid credentials")]
CaptchaRequired,
- #[error("Quota dépassé")]
+ #[error("Quota exceeded")]
QuotaExceeded,
/// A remote mount's stored credentials can no longer be decrypted, because
@@ -104,22 +99,20 @@ pub enum AppError {
/// reconnect the mount. It gets its own code so the client can say that
/// instead of showing a bare failure.
#[error(
- "Les identifiants de ce stockage distant ne sont plus déchiffrables : \
- le secret interne de l'instance a changé depuis leur enregistrement. \
- Reconnectez le montage pour les saisir à nouveau."
+ "The credentials for this remote storage can no longer be decrypted because the instance's internal secret has changed since they were saved. Reconnect the mount to enter them again."
)]
RemoteMountUnreadable,
/// A remote storage provider was unreachable, refused us, or answered
/// something unusable. The failure is upstream: reporting it as a 500 sends
/// whoever reads it auditing Kubuno's own logs for a fault that is not here.
- #[error("Stockage distant injoignable : {0}")]
+ #[error("Remote storage unreachable: {0}")]
RemoteUnavailable(String),
- #[error("Erreur base de données")]
+ #[error("Database error")]
Database(#[from] sqlx::Error),
- #[error("Erreur interne")]
+ #[error("Internal error")]
Internal(#[from] anyhow::Error),
}
@@ -130,7 +123,7 @@ impl AppError {
/// `Display` stays deliberately generic on `Internal` and `Database` so that
/// a response body never leaks internals. That genericity used to reach the
/// logs and the audit trail too, which left an administrator facing
- /// "Erreur interne" on four surfaces at once with no way to diagnose the
+ /// "Internal error" on four surfaces at once with no way to diagnose the
/// failure - even with full shell access to the server.
pub fn detail(&self) -> String {
match self {
@@ -183,14 +176,14 @@ impl IntoResponse for AppError {
}
AppError::Database(e) => {
tracing::error!(error = %e, "Database error");
- (StatusCode::INTERNAL_SERVER_ERROR, "DATABASE_ERROR", "Erreur base de données".to_string())
+ (StatusCode::INTERNAL_SERVER_ERROR, "DATABASE_ERROR", "Database error".to_string())
}
AppError::Internal(e) => {
// The chain, not just the outermost message: the response body
// below stays generic, so this log is the only place the cause
// survives.
tracing::error!(error = %format!("{e:#}"), "Internal error");
- (StatusCode::INTERNAL_SERVER_ERROR, "INTERNAL_ERROR", "Erreur interne".to_string())
+ (StatusCode::INTERNAL_SERVER_ERROR, "INTERNAL_ERROR", "Internal error".to_string())
}
};
@@ -210,7 +203,7 @@ mod tests {
.into();
// What the response body and the old logs showed: nothing usable.
- assert_eq!(err.to_string(), "Erreur interne");
+ assert_eq!(err.to_string(), "Internal error");
// What an administrator now gets on the log, the audit trail and the
// install status endpoint: the operation AND its root cause.
diff --git a/server/src/handlers/admin/alerts.rs b/server/src/handlers/admin/alerts.rs
index a6ad65a2..204c41ae 100644
--- a/server/src/handlers/admin/alerts.rs
+++ b/server/src/handlers/admin/alerts.rs
@@ -139,7 +139,7 @@ pub async fn set_alert_status(
ctx.require(keys::ALERTS_MANAGE)?;
let next = Status::parse(dto.status.trim())
- .ok_or_else(|| AppError::Validation("État d'alerte inconnu".into()))?;
+ .ok_or_else(|| AppError::Validation("Unknown alert state".into()))?;
let note = match dto.comment.as_deref() {
Some(raw) if !raw.trim().is_empty() => Some(clean_comment(raw)?),
_ => None,
@@ -297,23 +297,23 @@ pub async fn bulk_alerts(
ctx.require(keys::ALERTS_MANAGE)?;
if dto.ids.is_empty() {
- return Err(AppError::Validation("Aucune alerte sélectionnée".into()));
+ return Err(AppError::Validation("No alerts selected".into()));
}
if dto.ids.len() > MAX_BULK {
return Err(AppError::Validation(format!(
- "Sélection trop large : {MAX_BULK} alertes au maximum"
+ "Selection too large: maximum {MAX_BULK} alerts"
)));
}
let next = match dto.status.as_deref().map(str::trim).filter(|s| !s.is_empty()) {
Some(raw) => Some(
- Status::parse(raw).ok_or_else(|| AppError::Validation("État d'alerte inconnu".into()))?,
+ Status::parse(raw).ok_or_else(|| AppError::Validation("Unknown alert state".into()))?,
),
None => None,
};
let assign = dto.assign.unwrap_or(false);
if next.is_none() && !assign {
- return Err(AppError::Validation("Aucune opération demandée".into()));
+ return Err(AppError::Validation("No operation requested".into()));
}
let assignee = match (assign, dto.assignee_id) {
@@ -387,7 +387,7 @@ async fn dead_letter_job_type(
let alert = store::get(&state.db, id, ctx).await?;
if alert.kind != catalog::JOB_DEAD_LETTER {
return Err(AppError::Validation(
- "Cette action ne s'applique qu'aux alertes de tâches en échec".into(),
+ "This action only applies to failed-job alerts".into(),
));
}
let job_type = alert
@@ -396,7 +396,7 @@ async fn dead_letter_job_type(
.and_then(Value::as_str)
.ok_or_else(|| {
tracing::error!(alert_id = %id, "alerts: alerte de tâche sans type de tâche");
- AppError::Validation("Alerte incomplète : type de tâche absent".into())
+ AppError::Validation("Incomplete alert: missing job type".into())
})?
.to_string();
Ok((alert, job_type))
diff --git a/server/src/handlers/admin/audiences.rs b/server/src/handlers/admin/audiences.rs
index ececa6ed..da7b4339 100644
--- a/server/src/handlers/admin/audiences.rs
+++ b/server/src/handlers/admin/audiences.rs
@@ -75,20 +75,20 @@ fn validate_details(name: &str, description: Option<&str>) -> Result 40 {
return Err(AppError::Validation(
- "Le nom d'une audience ne peut pas dépasser 40 caractères - il s'affiche dans une liste de partage, à côté d'un nom de fichier.".into(),
+ "An audience name cannot exceed 40 characters because it appears in a sharing list next to a file name.".into(),
));
}
if let Some(d) = description {
if d.chars().count() > 150 {
return Err(AppError::Validation(
- "La description ne peut pas dépasser 150 caractères.".into(),
+ "The description cannot exceed 150 characters.".into(),
));
}
}
@@ -98,7 +98,7 @@ fn validate_details(name: &str, description: Option<&str>) -> Result AppError {
if e.to_string().contains("idx_core_ta_name") {
- AppError::Conflict(format!("Une audience nommée « {name} » existe déjà."))
+ AppError::Conflict(format!("An audience named '{name}' already exists."))
} else {
tracing::error!(error = %e, "audiences: écriture");
AppError::Database(e)
@@ -299,7 +299,7 @@ pub async fn get_audience(
tracing::error!(error = %e, "audiences: read");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Audience introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Audience not found".into()))?;
// Portable: the `CASE` yields a `COUNT` for a group and `NULL` for a user,
// decoded as `Option` on every engine, so the `::bigint` cast is gone.
@@ -472,7 +472,7 @@ pub async fn update_audience(
tracing::error!(error = %e, "audiences: reading before modification");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Audience introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Audience not found".into()))?;
let before_json = json!({
"name": before.try_get::("name")?,
@@ -531,12 +531,12 @@ pub async fn delete_audience(
tracing::error!(error = %e, "audiences: reading before deletion");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Audience introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Audience not found".into()))?;
let name: String = row.try_get("name")?;
if row.try_get::("is_everyone")? {
return Err(AppError::Validation(
- "L'audience « toute l'organisation » ne peut pas être supprimée : une instance doit toujours pouvoir proposer au moins une audience.".into(),
+ "The 'entire organization' audience cannot be deleted: an instance must always offer at least one audience.".into(),
));
}
let applied_to: i64 = row.try_get("applied_to")?;
@@ -587,7 +587,7 @@ pub async fn add_members(
) -> Result, AppError> {
ctx.require(keys::AUDIENCES_MANAGE)?;
if dto.members.is_empty() {
- return Err(AppError::Validation("Aucun membre à ajouter.".into()));
+ return Err(AppError::Validation("No members to add.".into()));
}
let mut tx = audit.begin(&state.db).await?;
@@ -602,11 +602,11 @@ pub async fn add_members(
tracing::error!(error = %e, "audiences: reading before adding members");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Audience introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Audience not found".into()))?;
if row.try_get::("is_everyone")? {
return Err(AppError::Validation(
- "L'audience « toute l'organisation » n'a pas de membres explicites : elle désigne tous les comptes actifs.".into(),
+ "The 'entire organization' audience has no explicit members; it includes all active accounts.".into(),
));
}
let name: String = row.try_get("name")?;
@@ -642,7 +642,7 @@ pub async fn add_members(
}
other => {
return Err(AppError::Validation(format!(
- "Type de membre inconnu : « {other} ». Attendu : user, group."
+ "Unknown member type: '{other}'. Expected: user, group."
)))
}
}
@@ -654,7 +654,7 @@ pub async fn add_members(
if !exists {
return Err(AppError::Validation(
- "Un des membres indiqués n'existe pas (ou plus).".into(),
+ "One of the specified members no longer exists.".into(),
));
}
@@ -694,7 +694,7 @@ pub async fn remove_members(
) -> Result, AppError> {
ctx.require(keys::AUDIENCES_MANAGE)?;
if dto.members.is_empty() {
- return Err(AppError::Validation("Aucun membre à retirer.".into()));
+ return Err(AppError::Validation("No members to remove.".into()));
}
let mut tx = audit.begin(&state.db).await?;
@@ -709,7 +709,7 @@ pub async fn remove_members(
tracing::error!(error = %e, "audiences: reading before removing members");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Audience introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Audience not found".into()))?;
let mut removed = 0u32;
for m in &dto.members {
@@ -901,11 +901,11 @@ pub async fn set_policy(
ctx.require(keys::AUDIENCES_APPLY)?;
if dto.module_id.trim().is_empty() {
- return Err(AppError::Validation("Module non précisé.".into()));
+ return Err(AppError::Validation("No module specified.".into()));
}
if dto.audience_ids.len() > MAX_APPLIED {
return Err(AppError::Validation(format!(
- "Au plus {MAX_APPLIED} audiences peuvent être proposées à la fois : au-delà, la liste cesse d'être un raccourci."
+ "At most {MAX_APPLIED} audiences can be offered at once; a longer list would no longer be a shortcut."
)));
}
// A duplicate would be accepted by the primary key on (unit, module,
@@ -914,7 +914,7 @@ pub async fn set_policy(
let mut seen = std::collections::HashSet::new();
if !dto.audience_ids.iter().all(|id| seen.insert(*id)) {
return Err(AppError::Validation(
- "La même audience figure deux fois dans la liste.".into(),
+ "The same audience appears twice in the list.".into(),
));
}
@@ -948,7 +948,7 @@ pub async fn set_policy(
tracing::error!(error = %e, "audiences: reading the unit");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Unité organisationnelle introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Organizational unit not found".into()))?;
tx.execute(
"DELETE FROM core.target_audience_policies WHERE org_unit_id = $1 AND module_id = $2",
@@ -969,7 +969,7 @@ pub async fn set_policy(
.await
.map_err(|e| {
if e.to_string().contains("foreign key") {
- AppError::Validation("Une des audiences indiquées n'existe pas.".into())
+ AppError::Validation("One of the specified audiences does not exist.".into())
} else {
tracing::error!(error = %e, "audiences: writing the policy");
AppError::Database(e)
diff --git a/server/src/handlers/admin/backup.rs b/server/src/handlers/admin/backup.rs
index 00e3a770..bdab199e 100644
--- a/server/src/handlers/admin/backup.rs
+++ b/server/src/handlers/admin/backup.rs
@@ -129,7 +129,7 @@ pub async fn run_now(
if runs::is_running(&state.db).await.unwrap_or(false) {
return Err(AppError::Conflict(
- "Une sauvegarde est déjà en cours".into(),
+ "A backup is already in progress".into(),
));
}
@@ -158,7 +158,7 @@ pub async fn run_now(
.await;
Ok(Json(json!({
- "message": "Sauvegarde demandée",
+ "message": "Backup requested",
"job_id": job_id,
})))
}
@@ -197,7 +197,7 @@ pub async fn declare_restore_test(
let note = dto.note.as_deref().map(str::trim).unwrap_or_default();
if note.len() > MAX_NOTE {
return Err(AppError::Validation(format!(
- "Note : {MAX_NOTE} caractères maximum"
+ "Note: maximum {MAX_NOTE} characters"
)));
}
@@ -225,7 +225,7 @@ pub async fn declare_restore_test(
if previous.is_none() {
return Err(AppError::NotFound(format!(
- "Réglage '{}' inexistant",
+ "Setting '{}' does not exist",
policy::KEY_LAST_RESTORE_TEST
)));
}
@@ -267,7 +267,7 @@ pub async fn declare_restore_test(
crate::health::invalidate();
Ok(Json(json!({
- "message": if clearing { "Déclaration retirée" } else { "Restauration testée enregistrée" },
+ "message": if clearing { "Declaration removed" } else { "Test restore recorded" },
"at": if clearing { Value::Null } else { value },
"declared": true,
})))
@@ -334,7 +334,7 @@ pub async fn restore_now(
// Strong confirmation: retype the exact file name.
if dto.confirm.trim() != file_name {
return Err(AppError::Validation(
- "Confirmation invalide : retapez exactement le nom du fichier de sauvegarde".into(),
+ "Invalid confirmation: type the exact backup file name again".into(),
));
}
@@ -354,7 +354,7 @@ pub async fn restore_now(
&state.db,
&state.ws_hub,
GLOBAL_SCOPE,
- format!("Restauration de la base de données (« {file_name} ») en cours…"),
+ format!("Database restore ('{file_name}') in progress…"),
"restore",
)
.await;
@@ -390,7 +390,7 @@ pub async fn restore_now(
let outcome = result?;
Ok(Json(json!({
- "message": "Restauration terminée",
+ "message": "Restore complete",
"id": outcome.id,
"source_file": outcome.source_file,
"safety_file": outcome.safety_file,
diff --git a/server/src/handlers/admin/dashboard.rs b/server/src/handlers/admin/dashboard.rs
index 25c36f90..8527f197 100644
--- a/server/src/handlers/admin/dashboard.rs
+++ b/server/src/handlers/admin/dashboard.rs
@@ -823,7 +823,7 @@ pub async fn dashboard(
.iter()
.find(|p| p.id == asked)
.map(|p| p.id)
- .ok_or_else(|| AppError::Validation(format!("panneau inconnu : « {asked} »")))?,
+ .ok_or_else(|| AppError::Validation(format!("Unknown panel: '{asked}'")))?,
),
};
let full = q.full.unwrap_or(false);
diff --git a/server/src/handlers/admin/data_export.rs b/server/src/handlers/admin/data_export.rs
index 5665b166..e8f699db 100644
--- a/server/src/handlers/admin/data_export.rs
+++ b/server/src/handlers/admin/data_export.rs
@@ -263,24 +263,24 @@ pub async fn request_export(
// ── Validation ──────────────────────────────────────────────────────────
if dto.scope != "instance" && dto.scope != "accounts" {
return Err(AppError::Validation(
- "Périmètre invalide : « instance » ou « accounts »".into(),
+ "Invalid scope: expected 'instance' or 'accounts'".into(),
));
}
if dto.scope == "accounts" && dto.user_ids.is_empty() {
return Err(AppError::Validation(
- "Sélectionnez au moins un compte à exporter".into(),
+ "Select at least one account to export".into(),
));
}
if dto.user_ids.len() > MAX_SELECTED {
return Err(AppError::Validation(format!(
- "Sélection trop large : {MAX_SELECTED} comptes maximum par export"
+ "Selection too large: maximum {MAX_SELECTED} accounts per export"
)));
}
// One at a time, instance-wide - and checked before anything is written, so a
// double-click produces one export and one clear refusal.
if runs::active_admin(&state.db).await?.is_some() {
- return Err(AppError::Conflict("Un export est déjà en cours".into()));
+ return Err(AppError::Conflict("An export is already in progress".into()));
}
// Services are intersected with what the live modules actually offer: a
@@ -333,7 +333,7 @@ pub async fn request_export(
if rows.is_empty() {
return Err(AppError::Validation(
- "Aucun compte existant dans cette sélection".into(),
+ "No existing accounts in this selection".into(),
));
}
@@ -413,7 +413,7 @@ pub async fn request_export(
let job_id = crate::data_export::jobs::enqueue_run(&state.db, export_id).await?;
Ok(Json(json!({
- "message": "Export demandé",
+ "message": "Export requested",
"export_id": export_id,
"job_id": job_id,
"available_at": available_at,
@@ -438,7 +438,7 @@ pub async fn cancel_export(
ctx.require(keys::DATA_EXPORT_EXECUTE)?;
let Some(run) = runs::get_admin(&state.db, id).await? else {
- return Err(AppError::NotFound("Export introuvable".into()));
+ return Err(AppError::NotFound("Export not found".into()));
};
let label = audit
@@ -450,7 +450,7 @@ pub async fn cancel_export(
if !runs::cancel(&state.db, id, &format!("Annulé par {label}")).await? {
return Err(AppError::Conflict(
- "Cet export est déjà terminé : il ne peut plus être annulé".into(),
+ "This export has already finished and can no longer be canceled".into(),
));
}
@@ -475,7 +475,7 @@ pub async fn cancel_export(
)
.await;
- Ok(Json(json!({ "message": "Export annulé" })))
+ Ok(Json(json!({ "message": "Export canceled" })))
}
/// `DELETE /admin/data-export/:id` - remove a produced archive now.
@@ -488,7 +488,7 @@ pub async fn delete_export(
ctx.require(keys::DATA_EXPORT_EXECUTE)?;
let Some(run) = runs::get_admin(&state.db, id).await? else {
- return Err(AppError::NotFound("Export introuvable".into()));
+ return Err(AppError::NotFound("Export not found".into()));
};
if let (Some(destination), Some(file_name)) = (run.destination.as_deref(), run.file_name.as_deref())
@@ -519,7 +519,7 @@ pub async fn delete_export(
)
.await;
- Ok(Json(json!({ "message": "Archive supprimée" })))
+ Ok(Json(json!({ "message": "Archive deleted" })))
}
// ── The archive itself ───────────────────────────────────────────────────────
@@ -538,48 +538,48 @@ pub async fn download_export(
ctx.require(keys::DATA_EXPORT_READ)?;
let Some(run) = runs::get_admin(&state.db, id).await? else {
- return Err(AppError::NotFound("Export introuvable".into()));
+ return Err(AppError::NotFound("Export not found".into()));
};
let now = Utc::now();
if run.status != "ready" {
return Err(AppError::Conflict(
- "Cette archive n'est pas prête".into(),
+ "This archive is not ready".into(),
));
}
if run.file_deleted {
return Err(AppError::NotFound(
- "Cette archive a été supprimée du serveur".into(),
+ "This archive has been deleted from the server".into(),
));
}
if now < run.available_at {
// The hold. The one refusal that is not a defect and is worded as such.
return Err(AppError::Conflict(format!(
- "Cette archive ne sera disponible qu'à partir du {} (délai de sécurité)",
+ "This archive will only be available from {} (security delay)",
run.available_at.format("%d/%m/%Y %H:%M UTC")
)));
}
if now >= run.expires_at {
return Err(AppError::NotFound(
- "Cette archive a expiré et n'est plus disponible".into(),
+ "This archive has expired and is no longer available".into(),
));
}
let (Some(destination), Some(file_name)) = (run.destination.as_deref(), run.file_name.as_deref())
else {
- return Err(AppError::NotFound("Archive introuvable sur le disque".into()));
+ return Err(AppError::NotFound("Archive not found on disk".into()));
};
// Re-validated even though it came from our own row: this is the one handler
// that turns a database string into an open file descriptor.
if !archive::is_export_file(file_name) {
tracing::error!(export_id = %id, "export: nom d'archive non reconnu - téléchargement refusé");
- return Err(AppError::NotFound("Archive introuvable sur le disque".into()));
+ return Err(AppError::NotFound("Archive not found on disk".into()));
}
let path = std::path::Path::new(destination).join(file_name);
let file = tokio::fs::File::open(&path).await.map_err(|e| {
tracing::error!(error = %e, export_id = %id, "export: ouverture de l'archive impossible");
- AppError::NotFound("Archive introuvable sur le disque".into())
+ AppError::NotFound("Archive not found on disk".into())
})?;
// Audited BEFORE the bytes leave: a download interrupted halfway still
diff --git a/server/src/handlers/admin/data_migration.rs b/server/src/handlers/admin/data_migration.rs
index a6f81282..b8c5581a 100644
--- a/server/src/handlers/admin/data_migration.rs
+++ b/server/src/handlers/admin/data_migration.rs
@@ -151,7 +151,7 @@ pub async fn probe(
dto.source.validate()?;
if dto.login.trim().is_empty() || dto.password.is_empty() {
return Err(AppError::Validation(
- "Indiquez un compte source et son mot de passe pour tester la connexion.".into(),
+ "Enter a source account and its password to test the connection.".into(),
));
}
@@ -214,7 +214,7 @@ pub async fn create(
let name = dto.name.trim();
if name.is_empty() || name.len() > 200 {
return Err(AppError::Validation(
- "Donnez un nom à la campagne (200 caractères au maximum).".into(),
+ "Give the campaign a name (maximum 200 characters).".into(),
));
}
let service = ServiceKind::parse(&dto.service)?;
@@ -223,12 +223,12 @@ pub async fn create(
if dto.accounts.is_empty() {
return Err(AppError::Validation(
- "Une campagne sans correspondance de comptes ne migrerait rien.".into(),
+ "A campaign with no account mappings would not migrate anything.".into(),
));
}
if dto.accounts.len() > MAX_ACCOUNTS_PER_CAMPAIGN {
return Err(AppError::Validation(format!(
- "Trop de comptes dans une seule campagne ({} au maximum).",
+ "Too many accounts in a single campaign (maximum {}).",
MAX_ACCOUNTS_PER_CAMPAIGN
)));
}
@@ -311,7 +311,7 @@ pub async fn start(
let campaign = store::get(&state.db, id).await?;
if campaign.status == "running" {
- return Err(AppError::Conflict("Cette campagne est déjà en cours.".into()));
+ return Err(AppError::Conflict("This campaign is already running.".into()));
}
// Checked again at every start: a module removed between two runs must stop
@@ -355,7 +355,7 @@ pub async fn pause(
let campaign = store::get(&state.db, id).await?;
if campaign.status != "running" {
return Err(AppError::Conflict(
- "Cette campagne n'est pas en cours : il n'y a rien à interrompre.".into(),
+ "This campaign is not running; there is nothing to interrupt.".into(),
));
}
@@ -426,7 +426,7 @@ pub async fn delete(
let campaign = store::get(&state.db, id).await?;
if campaign.status == "running" {
return Err(AppError::Conflict(
- "Interrompez la campagne avant de la supprimer.".into(),
+ "Stop the campaign before deleting it.".into(),
));
}
@@ -456,8 +456,7 @@ async fn module_url(state: &AppState, service: ServiceKind) -> Result Result<(), AppError> {
if found {
Ok(())
} else {
- Err(AppError::NotFound(format!("Module '{id}' introuvable")))
+ Err(AppError::NotFound(format!("Module '{id}' not found")))
}
}
@@ -136,12 +136,12 @@ pub async fn switch_core_connection(
ctx.require_superuser("bascule de la base de données principale")?;
let target = registry::get(&state.db, registry::CORE_SCOPE, cid)
.await?
- .ok_or_else(|| AppError::NotFound("Connexion enregistrée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Saved connection not found".into()))?;
if target.is_current {
- return Err(AppError::Validation("Cette connexion est déjà la base courante.".into()));
+ return Err(AppError::Validation("This connection is already the current database.".into()));
}
let target_backend = Backend::parse(&target.engine)
- .ok_or_else(|| AppError::Validation(format!("Moteur inconnu : {}", target.engine)))?;
+ .ok_or_else(|| AppError::Validation(format!("Unknown engine: {}", target.engine)))?;
db_switch::ensure_switchable_config(target_backend)?;
let target_creds = target.to_credentials(&state.settings.auth.jwt_secret).map_err(AppError::Internal)?;
let prefix = instance_prefix(&state);
@@ -166,7 +166,7 @@ pub async fn switch_core_connection(
&state.db,
&state.ws_hub,
GLOBAL_SCOPE,
- format!("Bascule de la base de données principale vers {tgt_label} en cours…"),
+ format!("Switching the primary database to {tgt_label}…"),
"switch",
)
.await;
@@ -183,7 +183,7 @@ pub async fn switch_core_connection(
match do_core_copy(&state, &target_settings, &eff, job).await {
Ok((tables, rows)) => {
if let Err(e) = db_switch::persist_core_settings(&target_creds, target_backend) {
- finish_err(&state.db, job, &format!("Copie réussie mais configuration non écrite : {}", e.detail())).await;
+ finish_err(&state.db, job, &format!("Copy succeeded, but the configuration could not be written: {}", e.detail())).await;
return Err(e);
}
finish_ok(&state.db, job, tables, rows).await;
@@ -242,10 +242,10 @@ pub async fn sync_core_connection(
ctx.require_superuser("synchronisation de la base de données principale")?;
let target = registry::get(&state.db, registry::CORE_SCOPE, cid)
.await?
- .ok_or_else(|| AppError::NotFound("Connexion enregistrée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Saved connection not found".into()))?;
if target.is_current {
return Err(AppError::Validation(
- "La base courante ne peut pas être synchronisée avec elle-même.".into(),
+ "The current database cannot be synchronized with itself.".into(),
));
}
let target_creds = target.to_credentials(&state.settings.auth.jwt_secret).map_err(AppError::Internal)?;
@@ -263,7 +263,7 @@ pub async fn sync_core_connection(
&state.db,
&state.ws_hub,
GLOBAL_SCOPE,
- format!("Synchronisation de la base de données principale vers {tgt_label} en cours…"),
+ format!("Synchronizing the primary database to {tgt_label}…"),
"sync",
)
.await;
@@ -401,9 +401,9 @@ pub async fn switch_module_connection(
module_exists(&state, &id).await?;
let target = registry::get(&state.db, &id, cid)
.await?
- .ok_or_else(|| AppError::NotFound("Connexion enregistrée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Saved connection not found".into()))?;
if target.is_current {
- return Err(AppError::Validation("Cette connexion est déjà la base courante du module.".into()));
+ return Err(AppError::Validation("This connection is already the module's current database.".into()));
}
let target_creds = target.to_credentials(&state.settings.auth.jwt_secret).map_err(AppError::Internal)?;
let target_prefix = target.prefix();
@@ -506,10 +506,10 @@ pub async fn sync_module_connection(
module_exists(&state, &id).await?;
let target = registry::get(&state.db, &id, cid)
.await?
- .ok_or_else(|| AppError::NotFound("Connexion enregistrée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Saved connection not found".into()))?;
if target.is_current {
return Err(AppError::Validation(
- "La base courante ne peut pas être synchronisée avec elle-même.".into(),
+ "The current database cannot be synchronized with itself.".into(),
));
}
let source = db_config::resolve(&state.db, &state.settings.database, &state.settings.auth.jwt_secret, &id)
@@ -533,7 +533,7 @@ pub async fn sync_module_connection(
let has_tables = db_switch::count_tables(&target_pool, &dst_eff).await.map_err(AppError::Database)?;
if has_tables == 0 {
return Err(AppError::Validation(
- "La cible ne contient pas encore les tables du module : basculez d'abord dessus pour l'initialiser."
+ "The target does not yet contain the module's tables. Switch to it first to initialize them."
.into(),
));
}
diff --git a/server/src/handlers/admin/db_switch.rs b/server/src/handlers/admin/db_switch.rs
index 75ec8e68..5ad7007b 100644
--- a/server/src/handlers/admin/db_switch.rs
+++ b/server/src/handlers/admin/db_switch.rs
@@ -73,13 +73,13 @@ impl TargetDto {
pub(crate) fn validate(&self) -> Result {
let backend = Backend::parse(&self.engine)
.filter(|_| ENGINES.contains(&self.engine.as_str()))
- .ok_or_else(|| AppError::Validation(format!("Moteur inconnu : {}", self.engine)))?;
+ .ok_or_else(|| AppError::Validation(format!("Unknown engine: {}", self.engine)))?;
if backend != Backend::Sqlite {
if self.host.trim().is_empty() {
- return Err(AppError::Validation("L'hôte de la base cible est requis.".into()));
+ return Err(AppError::Validation("The target database host is required.".into()));
}
if self.user.trim().is_empty() {
- return Err(AppError::Validation("L'utilisateur de la base cible est requis.".into()));
+ return Err(AppError::Validation("The target database user is required.".into()));
}
}
Ok(backend)
@@ -282,7 +282,7 @@ pub async fn get_job(
.map_err(AppError::Database)?;
match job {
Some(j) => Ok(Json(json!({ "job": job_json(&j) }))),
- None => Err(AppError::NotFound("Migration introuvable".into())),
+ None => Err(AppError::NotFound("Migration not found".into())),
}
}
@@ -338,7 +338,7 @@ pub async fn migrate_core_database(
&state.ws_hub,
GLOBAL_SCOPE,
format!(
- "Migration de la base de données principale ({source_engine} → {}) en cours…",
+ "Migrating the primary database ({source_engine} → {})…",
dto.engine
),
"migrate",
@@ -351,7 +351,7 @@ pub async fn migrate_core_database(
let outcome: Result, AppError> = match result {
Ok((tables, rows)) => match persist_core_settings(&creds, target_backend) {
Err(e) => {
- let msg = format!("Copie réussie mais configuration non écrite : {}", e.detail());
+ let msg = format!("Copy succeeded, but the configuration could not be written: {}", e.detail());
finish_err(&state.db, job, &msg).await;
record_core_switch(&audit, &state.db, &source_engine, &dto.engine, Err(&msg)).await;
Err(e)
@@ -571,9 +571,7 @@ fn database_env_overrides(target: Backend, is_set: impl Fn(&str) -> bool) -> Opt
pub(crate) fn ensure_switchable_config(target: Backend) -> Result<(), AppError> {
match database_pinned_by_env(target) {
Some(vars) => Err(AppError::Validation(format!(
- "La base de données principale est fixée par l'environnement ({vars}) : \
- une bascule ne pourrait pas prendre effet au redémarrage. Retirez ces variables \
- (ou configurez la base dans le fichier de configuration) avant de migrer."
+ "The primary database is set by the environment ({vars}), so switching would not take effect after a restart. Remove these variables or configure the database in the configuration file before migrating."
))),
None => Ok(()),
}
@@ -610,7 +608,7 @@ pub async fn migrate_module_database(
.map_err(AppError::Database)?
.is_some();
if !exists {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
}
// The source (current) credentials, resolved BEFORE we change anything.
diff --git a/server/src/handlers/admin/detectors.rs b/server/src/handlers/admin/detectors.rs
index 4bac76bb..91322dea 100644
--- a/server/src/handlers/admin/detectors.rs
+++ b/server/src/handlers/admin/detectors.rs
@@ -149,7 +149,7 @@ fn prepare(input: &DetectorInput) -> Result {
let key = input.key.trim().to_lowercase();
if key.is_empty() || key.len() > MAX_KEY_LEN {
return Err(AppError::Validation(format!(
- "La clé du détecteur doit faire 1 à {MAX_KEY_LEN} caractères"
+ "The detector key must contain 1 to {MAX_KEY_LEN} characters"
)));
}
if !key
@@ -157,27 +157,27 @@ fn prepare(input: &DetectorInput) -> Result {
.all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '.' || c == '_')
{
return Err(AppError::Validation(
- "La clé n'accepte que minuscules, chiffres, points et underscores".into(),
+ "The key only accepts lowercase letters, numbers, dots, and underscores".into(),
));
}
let label = input.label.trim();
if label.is_empty() || label.chars().count() > MAX_LABEL_LEN {
return Err(AppError::Validation(format!(
- "Le libellé doit faire 1 à {MAX_LABEL_LEN} caractères"
+ "The label must contain 1 to {MAX_LABEL_LEN} characters"
)));
}
if let Some(d) = input.description.as_deref() {
if d.chars().count() > MAX_DESCRIPTION_LEN {
return Err(AppError::Validation(format!(
- "La description dépasse {MAX_DESCRIPTION_LEN} caractères"
+ "The description exceeds {MAX_DESCRIPTION_LEN} characters"
)));
}
}
let kind = Kind::parse(input.kind.trim()).ok_or_else(|| {
AppError::Validation(format!(
- "Type de détecteur inconnu « {} » : attendus {}",
+ "Unknown detector type '{}': expected {}",
input.kind,
Kind::ALL
.iter()
@@ -191,7 +191,7 @@ fn prepare(input: &DetectorInput) -> Result {
None => None,
Some(raw) => Some(Checksum::parse(raw).ok_or_else(|| {
AppError::Validation(format!(
- "Somme de contrôle inconnue « {raw} » : attendues {}",
+ "Unknown checksum '{raw}': expected {}",
Checksum::ALL
.iter()
.map(|c| c.as_str())
@@ -202,20 +202,20 @@ fn prepare(input: &DetectorInput) -> Result {
};
if checksum.is_some() && kind != Kind::Checksum {
return Err(AppError::Validation(
- "Une somme de contrôle n'a de sens que sur un détecteur de type « somme de contrôle »"
+ "A checksum only applies to a checksum detector"
.into(),
));
}
if kind == Kind::Checksum && checksum.is_none() {
return Err(AppError::Validation(
- "Un détecteur de type « somme de contrôle » doit nommer l'algorithme à appliquer".into(),
+ "A checksum detector must specify the algorithm to use".into(),
));
}
let unit = |name: &str, value: Option, default: f32| -> Result {
let v = value.unwrap_or(default);
if !(0.0..=1.0).contains(&v) || v.is_nan() {
- return Err(AppError::Validation(format!("{name} va de 0 à 1")));
+ return Err(AppError::Validation(format!("{name} must be between 0 and 1")));
}
Ok(v)
};
@@ -249,8 +249,8 @@ fn prepare(input: &DetectorInput) -> Result {
proximity_window: input.proximity_window.unwrap_or(120).clamp(0, 4_000),
proximity_required: input.proximity_required,
base_confidence: unit("La confiance de base", input.base_confidence, 0.5)?,
- checksum_bonus: unit("Le bonus de somme de contrôle", input.checksum_bonus, 0.35)?,
- proximity_bonus: unit("Le bonus de proximité", input.proximity_bonus, 0.2)?,
+ checksum_bonus: unit("The checksum bonus", input.checksum_bonus, 0.35)?,
+ proximity_bonus: unit("The proximity bonus", input.proximity_bonus, 0.2)?,
min_confidence: unit("Le seuil de confiance", input.min_confidence, 0.7)?,
min_matches: input.min_matches.unwrap_or(1).clamp(1, 10_000),
min_unique_matches: input.min_unique_matches.unwrap_or(1).clamp(1, 10_000),
@@ -259,12 +259,12 @@ fn prepare(input: &DetectorInput) -> Result {
if draft.min_unique_matches > draft.min_matches {
return Err(AppError::Validation(
- "Le nombre de valeurs distinctes ne peut dépasser le nombre de correspondances : ce seuil ne serait jamais atteint".into(),
+ "The distinct value count cannot exceed the match count; this threshold would never be reached".into(),
));
}
if draft.proximity_required && draft.proximity_terms.is_empty() {
return Err(AppError::Validation(
- "« Mot-clé obligatoire » exige au moins un mot-clé de proximité".into(),
+ "'Keyword required' requires at least one proximity keyword".into(),
));
}
@@ -363,7 +363,7 @@ pub async fn create_detector(
let draft = prepare(&input)?;
if store::key_exists(&state.db, &draft.key, None).await? {
return Err(AppError::Validation(format!(
- "La clé « {} » est déjà prise",
+ "Key '{}' is already taken",
draft.key
)));
}
@@ -412,12 +412,12 @@ pub async fn update_detector(
// its key is what rules written before this edit point at.
if before.is_builtin && draft.key != before.key {
return Err(AppError::Validation(
- "La clé d'un détecteur fourni avec le core ne peut pas changer : des règles la référencent".into(),
+ "A detector bundled with the core cannot change its key because rules reference it".into(),
));
}
if store::key_exists(&state.db, &draft.key, Some(id)).await? {
return Err(AppError::Validation(format!(
- "La clé « {} » est déjà prise",
+ "Key '{}' is already taken",
draft.key
)));
}
@@ -479,13 +479,13 @@ pub async fn delete_detector(
// leave every rule that names it pointing at nothing, and the next
// migration would put it back.
return Err(AppError::Validation(
- "Un détecteur fourni avec le core se désactive, il ne se supprime pas".into(),
+ "A detector bundled with the core can be disabled but cannot be deleted".into(),
));
}
let used_by = store::rules_using(&state.db, &before.key).await?;
if !used_by.is_empty() {
return Err(AppError::Validation(format!(
- "{} règle(s) utilisent ce détecteur : {}",
+ "{} rule(s) use this detector: {}",
used_by.len(),
used_by.join(", ")
)));
@@ -552,7 +552,7 @@ pub async fn test_detector(
if dto.sample.len() > MAX_SAMPLE_BYTES {
return Err(AppError::Validation(format!(
- "L'échantillon dépasse {} Ko",
+ "The sample exceeds {} KB",
MAX_SAMPLE_BYTES / 1024
)));
}
@@ -575,7 +575,7 @@ pub async fn test_detector(
}
(None, None) => {
return Err(AppError::Validation(
- "Indiquez un détecteur existant ou un brouillon à essayer".into(),
+ "Specify an existing detector or a draft to try".into(),
))
}
};
@@ -644,7 +644,7 @@ pub async fn lookup_reference(
ctx.require(keys::RULES_READ)?;
let reference = q.reference.trim().to_uppercase();
if reference.is_empty() || reference.len() > 16 {
- return Err(AppError::Validation("Référence invalide".into()));
+ return Err(AppError::Validation("Invalid reference".into()));
}
let executions = rules_store::list_executions(
&state.db,
diff --git a/server/src/handlers/admin/devices.rs b/server/src/handlers/admin/devices.rs
index 665c8aab..9dc28156 100644
--- a/server/src/handlers/admin/devices.rs
+++ b/server/src/handlers/admin/devices.rs
@@ -180,7 +180,7 @@ pub async fn set_approval(
ctx.require(keys::SESSIONS_DELETE)?;
let next = Approval::parse(dto.approval.trim())
- .ok_or_else(|| AppError::Validation("État d'approbation inconnu".into()))?;
+ .ok_or_else(|| AppError::Validation("Unknown approval state".into()))?;
let reason = dto
.reason
.as_deref()
diff --git a/server/src/handlers/admin/groups.rs b/server/src/handlers/admin/groups.rs
index 5ab43c19..e39afb21 100644
--- a/server/src/handlers/admin/groups.rs
+++ b/server/src/handlers/admin/groups.rs
@@ -95,7 +95,7 @@ pub async fn get_group(
params![group_id],
)
.await?
- .ok_or_else(|| AppError::NotFound("Groupe introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Group not found".into()))?;
let members = state
.db
@@ -158,7 +158,7 @@ pub async fn create_group(
.await
.map_err(|e| {
if e.to_string().contains("unique") {
- AppError::Conflict(format!("Un groupe nommé '{}' existe déjà", dto.name))
+ AppError::Conflict(format!("A group named '{}' already exists", dto.name))
} else {
tracing::error!(error = %e, "create_group");
AppError::Database(e)
@@ -203,7 +203,7 @@ pub async fn update_group(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_group: lecture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Groupe introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Group not found".into()))?;
let previous = group_from_row(&prev_raw)?;
// `COALESCE($n, col)` keeps the stored value when the bind is NULL, the same
@@ -232,7 +232,7 @@ pub async fn update_group(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_group: écriture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Groupe introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Group not found".into()))?;
let group = group_from_row(&updated_raw)?;
tx.commit(
@@ -267,7 +267,7 @@ pub async fn delete_group(
)
.await
.map_err(|e| { tracing::error!(error = %e, "delete_group: lecture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Groupe introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Group not found".into()))?;
let group = group_from_row(&group_raw)?;
// System groups (Administrators, Users, Guests) cannot be deleted; the
@@ -302,7 +302,7 @@ pub async fn delete_group(
)
.await?;
- Ok(Json(json!({ "message": "Groupe supprimé" })))
+ Ok(Json(json!({ "message": "Group deleted" })))
}
// ── Membres ───────────────────────────────────────────────────────────────────
@@ -325,7 +325,7 @@ async fn membership_labels(
)
.await
.map_err(|e| { tracing::error!(error = %e, "membership_labels: groupe"); AppError::Database(e) })?;
- let group_name = group_name.ok_or_else(|| AppError::NotFound("Groupe introuvable".into()))?;
+ let group_name = group_name.ok_or_else(|| AppError::NotFound("Group not found".into()))?;
let username: Option = conn
.fetch_optional_scalar::(
@@ -374,7 +374,7 @@ pub async fn add_member(
)
.await?;
- Ok(Json(json!({ "message": "Membre ajouté" })))
+ Ok(Json(json!({ "message": "Member added" })))
}
pub async fn remove_member(
@@ -396,7 +396,7 @@ pub async fn remove_member(
.map_err(|e| { tracing::error!(error = %e, "remove_member"); AppError::Database(e) })?;
if affected == 0 {
- return Err(AppError::NotFound("Membre introuvable dans ce groupe".into()));
+ return Err(AppError::NotFound("Member not found in this group".into()));
}
tx.commit(
@@ -413,7 +413,7 @@ pub async fn remove_member(
)
.await?;
- Ok(Json(json!({ "message": "Membre retiré" })))
+ Ok(Json(json!({ "message": "Member removed" })))
}
/// Lists a user's groups (used by other handlers).
diff --git a/server/src/handlers/admin/health.rs b/server/src/handlers/admin/health.rs
index 17b7e36a..39521eca 100644
--- a/server/src/handlers/admin/health.rs
+++ b/server/src/handlers/admin/health.rs
@@ -119,10 +119,10 @@ pub async fn mute_check(
// Validate before touching the database: an unknown id would sit in the
// table forever, invisible to the page that is supposed to clear it.
let ignorable = health::checks::is_ignorable(&id)
- .ok_or_else(|| AppError::NotFound(format!("Contrôle '{id}' inconnu")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unknown check '{id}'")))?;
if !ignorable {
return Err(AppError::Validation(format!(
- "Le contrôle '{id}' ne peut pas être ignoré"
+ "Check '{id}' cannot be ignored"
)));
}
@@ -133,7 +133,7 @@ pub async fn mute_check(
if let Some(r) = &reason {
if r.chars().count() > MAX_REASON_LEN {
return Err(AppError::Validation(format!(
- "Justification trop longue (maximum {MAX_REASON_LEN} caractères)"
+ "Reason too long (maximum {MAX_REASON_LEN} characters)"
)));
}
}
@@ -174,7 +174,7 @@ pub async fn mute_check(
// The report is cached; the operator must see their decision immediately.
health::invalidate();
- Ok(Json(json!({ "message": "Contrôle ignoré", "check_id": id })))
+ Ok(Json(json!({ "message": "Check ignored", "check_id": id })))
}
/// `DELETE /api/v1/admin/health-checks/:id/ignore` - put the finding back.
@@ -201,7 +201,7 @@ pub async fn unmute_check(
if deleted == 0 {
// Nothing to undo. Rolled back rather than committed with an empty
// trail entry: "un-ignored a check that was not ignored" is noise.
- return Err(AppError::NotFound(format!("Le contrôle '{id}' n'est pas ignoré")));
+ return Err(AppError::NotFound(format!("Check '{id}' is not ignored")));
}
tx.commit(
@@ -212,7 +212,7 @@ pub async fn unmute_check(
.await?;
health::invalidate();
- Ok(Json(json!({ "message": "Contrôle réactivé", "check_id": id })))
+ Ok(Json(json!({ "message": "Check re-enabled", "check_id": id })))
}
#[cfg(test)]
diff --git a/server/src/handlers/admin/holidays.rs b/server/src/handlers/admin/holidays.rs
index de5c57b0..543398fb 100644
--- a/server/src/handlers/admin/holidays.rs
+++ b/server/src/handlers/admin/holidays.rs
@@ -264,15 +264,15 @@ struct ParsedHoliday {
fn parse_holiday(dto: &HolidayDto) -> Result {
let name = dto.name.trim();
if name.is_empty() {
- return Err(AppError::Validation("Le nom de la journée est vide".into()));
+ return Err(AppError::Validation("The holiday name is empty".into()));
}
if name.chars().count() > 200 {
- return Err(AppError::Validation("Nom trop long (200 caractères)".into()));
+ return Err(AppError::Validation("Name too long (200 characters)".into()));
}
if let (Some(from), Some(to)) = (dto.from_year, dto.to_year) {
if to < from {
return Err(AppError::Validation(
- "L'année de fin précède l'année de début".into(),
+ "The end year precedes the start year".into(),
));
}
}
@@ -280,7 +280,7 @@ fn parse_holiday(dto: &HolidayDto) -> Result {
None => None,
Some(c) => {
if !c.starts_with('#') || !(4..=9).contains(&c.len()) || !c[1..].chars().all(|ch| ch.is_ascii_hexdigit()) {
- return Err(AppError::Validation("Couleur invalide (attendu #rrggbb)".into()));
+ return Err(AppError::Validation("Invalid color (expected #rrggbb)".into()));
}
Some(c.to_string())
}
@@ -292,12 +292,12 @@ fn parse_holiday(dto: &HolidayDto) -> Result {
Some(Value::Object(map)) => {
if map.values().any(|v| !v.is_string()) {
return Err(AppError::Validation(
- "Les traductions doivent être des chaînes".into(),
+ "Translations must be strings".into(),
));
}
Value::Object(map)
}
- Some(_) => return Err(AppError::Validation("Traductions invalides".into())),
+ Some(_) => return Err(AppError::Validation("Invalid translations".into())),
};
Ok(ParsedHoliday {
@@ -342,7 +342,7 @@ async fn custom_key(db: &DbPool, calendar_id: Uuid, name: &str) -> Result("name")?,
@@ -515,7 +515,7 @@ pub async fn set_holiday_enabled(
.fetch_optional_row("SELECT name FROM core.holidays WHERE id = $1", params![id])
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Journée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Holiday not found".into()))?;
let name: String = row.try_get("name")?;
tx.commit(
@@ -555,13 +555,12 @@ pub async fn delete_holiday(
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Journée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Holiday not found".into()))?;
let name: String = row.try_get("name")?;
if row.try_get::("is_builtin")? {
return Err(AppError::Validation(
- "Cette journée provient du référentiel livré : désactivez-la plutôt que de la supprimer \
- (une suppression serait rétablie au prochain chargement du référentiel)."
+ "This holiday comes from the bundled reference data. Disable it instead of deleting it; deletion would be undone when the reference data is reloaded."
.into(),
));
}
@@ -600,11 +599,11 @@ pub async fn reset_holiday(
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Journée introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Holiday not found".into()))?;
if !row.try_get::("is_builtin")? {
return Err(AppError::Validation(
- "Cette journée a été créée ici : il n'y a pas de version d'origine à rétablir.".into(),
+ "This holiday was created locally; there is no original version to restore.".into(),
));
}
@@ -613,7 +612,7 @@ pub async fn reset_holiday(
let key: String = row.try_get("key")?;
let shipped = seed::shipped_holiday(&calendar_code, &key).ok_or_else(|| {
AppError::Validation(
- "Le référentiel livré ne contient plus cette journée : elle ne peut pas être rétablie.".into(),
+ "The bundled reference data no longer contains this holiday, so it cannot be restored.".into(),
)
})?;
@@ -678,7 +677,7 @@ pub async fn create_calendar(
ctx.require(keys::HOLIDAYS_MANAGE)?;
let name = dto.name.trim();
if name.is_empty() {
- return Err(AppError::Validation("Le nom du calendrier est vide".into()));
+ return Err(AppError::Validation("The calendar name is empty".into()));
}
let code = match dto.code.as_deref().map(str::trim).filter(|c| !c.is_empty()) {
@@ -695,14 +694,14 @@ pub async fn create_calendar(
};
if !code.chars().all(|c| c.is_ascii_uppercase() || c.is_ascii_digit() || "._-".contains(c)) {
return Err(AppError::Validation(
- "Identifiant invalide : lettres majuscules, chiffres, point, tiret ou souligné".into(),
+ "Invalid identifier: use uppercase letters, numbers, dots, hyphens, or underscores".into(),
));
}
let country = match dto.country_code.as_deref().map(str::trim).filter(|c| !c.is_empty()) {
None => None,
Some(c) if c.len() == 2 && c.chars().all(|ch| ch.is_ascii_alphabetic()) => Some(c.to_uppercase()),
- Some(_) => return Err(AppError::Validation("Code pays invalide (ISO 3166-1 alpha-2)".into())),
+ Some(_) => return Err(AppError::Validation("Invalid country code (ISO 3166-1 alpha-2)".into())),
};
let mut tx = audit.begin(&state.db).await?;
@@ -724,7 +723,7 @@ pub async fn create_calendar(
.map_err(|e| {
if let sqlx::Error::Database(db) = &e {
if db.constraint().is_some() {
- return AppError::Conflict(format!("Un calendrier « {code} » existe déjà."));
+ return AppError::Conflict(format!("A calendar with code '{code}' already exists."));
}
}
tracing::error!(error = %e, "holidays: creating a calendar");
@@ -761,7 +760,7 @@ pub async fn update_calendar(
) -> Result, AppError> {
ctx.require(keys::HOLIDAYS_MANAGE)?;
let name = match dto.name.as_deref().map(str::trim) {
- Some("") => return Err(AppError::Validation("Le nom du calendrier est vide".into())),
+ Some("") => return Err(AppError::Validation("The calendar name is empty".into())),
other => other.map(str::to_string),
};
@@ -794,7 +793,7 @@ pub async fn update_calendar(
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Calendrier introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Calendar not found".into()))?;
let final_name: String = row.try_get("name")?;
let final_enabled: bool = row.try_get("enabled")?;
@@ -830,11 +829,11 @@ pub async fn delete_calendar(
)
.await
.map_err(AppError::Database)?
- .ok_or_else(|| AppError::NotFound("Calendrier introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Calendar not found".into()))?;
if row.try_get::("is_builtin")? {
return Err(AppError::Validation(
- "Ce calendrier fait partie du référentiel livré : désactivez-le plutôt que de le supprimer.".into(),
+ "This calendar is part of the bundled reference data. Disable it instead of deleting it.".into(),
));
}
let name: String = row.try_get("name")?;
@@ -875,7 +874,7 @@ pub async fn set_exclusions(
let calendar = store::calendar(&state.db, id).await?;
if calendar.parent_id.is_none() {
return Err(AppError::Validation(
- "Seul un calendrier régional peut retirer une journée : il n'hérite de rien ici.".into(),
+ "Only a regional calendar can exclude a holiday; this calendar does not inherit any here.".into(),
));
}
@@ -994,7 +993,7 @@ pub async fn set_unit_pref(
ctx.require(keys::HOLIDAYS_MANAGE)?;
if dto.calendar_id.is_some() == dto.holiday_id.is_some() {
return Err(AppError::Validation(
- "Indiquez soit un calendrier, soit une journée.".into(),
+ "Specify either a calendar or a holiday.".into(),
));
}
diff --git a/server/src/handlers/admin/ldap.rs b/server/src/handlers/admin/ldap.rs
index 86d2c979..d67610ea 100644
--- a/server/src/handlers/admin/ldap.rs
+++ b/server/src/handlers/admin/ldap.rs
@@ -55,7 +55,7 @@ fn validate_slug(slug: &str) -> Result<(), AppError> {
Ok(())
} else {
Err(AppError::Validation(
- "Identifiant invalide : 2 à 40 caractères, minuscules, chiffres et tirets".into(),
+ "Invalid identifier: 2 to 40 characters; lowercase letters, numbers, and hyphens".into(),
))
}
}
@@ -63,7 +63,7 @@ fn validate_slug(slug: &str) -> Result<(), AppError> {
fn validate_field(label: &str, value: &str) -> Result<(), AppError> {
if value.chars().count() > MAX_FIELD {
return Err(AppError::Validation(format!(
- "{label} : {MAX_FIELD} caractères maximum"
+ "{label}: maximum {MAX_FIELD} characters"
)));
}
Ok(())
@@ -77,7 +77,7 @@ fn validate_field(label: &str, value: &str) -> Result<(), AppError> {
fn validate_host(host: &str) -> Result<(), AppError> {
let host = host.trim();
if host.is_empty() || host.chars().count() > 255 {
- return Err(AppError::Validation("Hôte requis (255 caractères maximum)".into()));
+ return Err(AppError::Validation("Host required (maximum 255 characters)".into()));
}
let bad = host.contains("://")
|| host.contains('/')
@@ -86,7 +86,7 @@ fn validate_host(host: &str) -> Result<(), AppError> {
|| host.contains('@');
if bad {
return Err(AppError::Validation(
- "Hôte invalide : indiquez seulement le nom ou l'adresse (par ex. dc01.exemple.com), sans schéma ni chemin".into(),
+ "Invalid host: enter only the name or address (e.g. dc01.example.com), without a scheme or path".into(),
));
}
Ok(())
@@ -96,7 +96,7 @@ fn validate_filter(label: &str, value: &str) -> Result<(), AppError> {
validate_field(label, value)?;
let value = value.trim();
if value.is_empty() {
- return Err(AppError::Validation(format!("{label} requis")));
+ return Err(AppError::Validation(format!("{label} required")));
}
// Balanced parentheses is the one structural property worth checking here;
// the directory itself is the authority on the rest of the grammar and says
@@ -108,14 +108,14 @@ fn validate_filter(label: &str, value: &str) -> Result<(), AppError> {
')' => {
depth -= 1;
if depth < 0 {
- return Err(AppError::Validation(format!("{label} : parenthèses déséquilibrées")));
+ return Err(AppError::Validation(format!("{label}: unbalanced parentheses")));
}
}
_ => {}
}
}
if depth != 0 {
- return Err(AppError::Validation(format!("{label} : parenthèses déséquilibrées")));
+ return Err(AppError::Validation(format!("{label}: unbalanced parentheses")));
}
Ok(())
}
@@ -125,8 +125,7 @@ fn validate_user_filter(value: &str) -> Result<(), AppError> {
validate_filter("Filtre de recherche", value)?;
if !value.contains(crate::directory::filter::LOGIN_PLACEHOLDER) {
return Err(AppError::Validation(
- "Le filtre de recherche doit contenir « {login} » - c'est là que l'identifiant saisi est inséré. \
- Sans lui, la même requête serait exécutée pour tout le monde."
+ "The search filter must contain '{login}', where the entered username is inserted. Without it, the same query would run for everyone."
.into(),
));
}
@@ -203,16 +202,16 @@ pub async fn create_directory(
let slug = dto.slug.trim().to_lowercase();
validate_slug(&slug)?;
if dto.display_name.trim().is_empty() {
- return Err(AppError::Validation("Nom affiché requis".into()));
+ return Err(AppError::Validation("Display name required".into()));
}
validate_host(&dto.host)?;
if dto.base_dn.trim().is_empty() {
- return Err(AppError::Validation("DN de base requis".into()));
+ return Err(AppError::Validation("Base DN required".into()));
}
validate_field("DN de base", &dto.base_dn)?;
validate_field("DN du compte de service", &dto.bind_dn)?;
if dto.ca_certificate.chars().count() > MAX_PEM {
- return Err(AppError::Validation("Autorité de certification trop volumineuse".into()));
+ return Err(AppError::Validation("Certificate authority data is too large".into()));
}
let security = crate::directory::Security::parse(dto.security.as_deref().unwrap_or("starttls"));
@@ -313,7 +312,7 @@ pub async fn create_directory(
.await
.map_err(|e| match &e {
sqlx::Error::Database(db) if db.is_unique_violation() => {
- AppError::Conflict(format!("Un annuaire portant l'identifiant « {slug} » existe déjà"))
+ AppError::Conflict(format!("A directory with identifier '{slug}' already exists"))
}
_ => {
tracing::error!(error = %e, "create_directory");
@@ -403,7 +402,7 @@ pub async fn update_directory(
if let Some(dn) = dto.base_dn.as_deref() {
validate_field("DN de base", dn)?;
if dn.trim().is_empty() {
- return Err(AppError::Validation("DN de base requis".into()));
+ return Err(AppError::Validation("Base DN required".into()));
}
}
if let Some(dn) = dto.bind_dn.as_deref() {
@@ -411,7 +410,7 @@ pub async fn update_directory(
}
if let Some(pem) = dto.ca_certificate.as_deref() {
if pem.chars().count() > MAX_PEM {
- return Err(AppError::Validation("Autorité de certification trop volumineuse".into()));
+ return Err(AppError::Validation("Certificate authority data is too large".into()));
}
}
@@ -435,7 +434,7 @@ pub async fn update_directory(
tracing::error!(error = %e, "update_directory: read");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Annuaire introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Directory not found".into()))?;
let mut tx = audit.begin(&state.db).await?;
@@ -703,7 +702,7 @@ pub async fn delete_directory(
tracing::error!(error = %e, "delete_directory: read");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Annuaire introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Directory not found".into()))?;
let mut tx = audit.begin(&state.db).await?;
@@ -750,7 +749,7 @@ pub async fn delete_directory(
.await?;
Ok(Json(json!({
- "message": "Annuaire supprimé",
+ "message": "Directory deleted",
"deactivated_accounts": deactivated,
})))
}
@@ -805,7 +804,7 @@ pub async fn test_directory_auth(
) -> Result, AppError> {
ctx.require(keys::AUTH_PROVIDERS_MANAGE)?;
if dto.login.trim().is_empty() || dto.password.is_empty() {
- return Err(AppError::Validation("Identifiant et mot de passe requis".into()));
+ return Err(AppError::Validation("Username and password required".into()));
}
let dir = dircfg::load(&state.db, id).await?;
let result = probe::probe_authentication(
@@ -897,7 +896,7 @@ pub async fn govern_accounts(
let dir = dircfg::load(&state.db, id).await?;
if dto.user_ids.is_empty() && !dto.all {
- return Err(AppError::Validation("Aucun compte désigné".into()));
+ return Err(AppError::Validation("No account specified".into()));
}
let backend = state.db.backend();
@@ -921,7 +920,7 @@ pub async fn govern_accounts(
if candidates.is_empty() {
return Err(AppError::Validation(
- "Aucun compte concerné : ces comptes n'ont pas de mot de passe local, ou ne dépendent pas de cet annuaire".into(),
+ "No affected accounts: these accounts have no local password or are not managed by this directory".into(),
));
}
@@ -949,8 +948,7 @@ pub async fn govern_accounts(
if remaining_local_admins <= 0 {
return Err(AppError::Validation(
- "Refusé : plus aucun administrateur ne pourrait se connecter sans l'annuaire. \
- Conservez au moins un compte d'administration avec un mot de passe local."
+ "Refused: no administrator would be able to sign in without the directory. Keep at least one administrator account with a local password."
.into(),
));
}
@@ -978,7 +976,7 @@ pub async fn govern_accounts(
.await?;
Ok(Json(json!({
- "message": "Comptes confiés à l'annuaire",
+ "message": "Accounts assigned to the directory",
"affected": affected,
"remaining_local_admins": remaining_local_admins,
})))
diff --git a/server/src/handlers/admin/mail.rs b/server/src/handlers/admin/mail.rs
index b319479a..c6593763 100644
--- a/server/src/handlers/admin/mail.rs
+++ b/server/src/handlers/admin/mail.rs
@@ -115,7 +115,7 @@ fn validate_address(value: &str) -> Result<(), AppError> {
Ok(())
} else {
Err(AppError::Validation(format!(
- "Adresse invalide : « {value} »"
+ "Invalid address: '{value}'"
)))
}
}
@@ -134,7 +134,7 @@ fn validate_host(value: &str) -> Result<(), AppError> {
Ok(())
} else {
Err(AppError::Validation(
- "Hôte SMTP invalide (nom d'hôte ou adresse IP attendu)".into(),
+ "Invalid SMTP host (expected a hostname or IP address)".into(),
))
}
}
@@ -147,7 +147,7 @@ fn validate_public_url(value: &str) -> Result<(), AppError> {
match url::Url::parse(value) {
Ok(u) if (u.scheme() == "https" || u.scheme() == "http") && u.host().is_some() => Ok(()),
_ => Err(AppError::Validation(
- "URL publique invalide (URL http(s) absolue attendue)".into(),
+ "Invalid public URL (expected an absolute http(s) URL)".into(),
)),
}
}
@@ -252,13 +252,13 @@ pub async fn update_mail_settings(
if let Some(security) = &dto.security {
if !["none", "starttls", "tls"].contains(&security.as_str()) {
return Err(AppError::Validation(
- "Chiffrement invalide : aucun, starttls ou tls".into(),
+ "Invalid encryption: expected none, starttls, or tls".into(),
));
}
}
if let Some(port) = dto.port {
if port == 0 {
- return Err(AppError::Validation("Port SMTP invalide".into()));
+ return Err(AppError::Validation("Invalid SMTP port".into()));
}
}
for (label, value) in [
@@ -266,12 +266,12 @@ pub async fn update_mail_settings(
("Nom d'expédition", dto.from_name.as_deref()),
] {
if value.is_some_and(|v| v.len() > MAX_FIELD) {
- return Err(AppError::Validation(format!("{label} : 255 caractères maximum")));
+ return Err(AppError::Validation(format!("{label}: maximum 255 characters")));
}
}
if dto.password.as_deref().is_some_and(|p| p.len() > 512) {
return Err(AppError::Validation(
- "Mot de passe SMTP : 512 caractères maximum".into(),
+ "SMTP password: maximum 512 characters".into(),
));
}
@@ -321,7 +321,7 @@ pub async fn update_mail_settings(
// `AuditTx` cannot be committed without an entry - a PATCH that changed
// nothing has nothing to write either.
let Some(last) = entries.pop() else {
- return Ok(Json(json!({ "message": "Aucun réglage modifié", "updated": 0 })));
+ return Ok(Json(json!({ "message": "No settings changed", "updated": 0 })));
};
let updated = entries.len() + 1;
for entry in entries {
@@ -333,7 +333,7 @@ pub async fn update_mail_settings(
// health report caches it.
crate::health::invalidate();
- Ok(Json(json!({ "message": "Relais de courriel mis à jour", "updated": updated })))
+ Ok(Json(json!({ "message": "Email relay updated", "updated": updated })))
}
#[derive(Debug, Deserialize)]
@@ -367,12 +367,12 @@ pub async fn test_mail(
// letting lettre fail with "invalid hostname" on an empty string.
if cfg.host.is_empty() {
return Err(AppError::Validation(
- "Renseignez l'hôte SMTP avant d'envoyer un test".into(),
+ "Enter the SMTP host before sending a test".into(),
));
}
if cfg.from_address.is_empty() {
return Err(AppError::Validation(
- "Renseignez l'adresse d'expédition avant d'envoyer un test".into(),
+ "Enter the sender address before sending a test".into(),
));
}
@@ -417,7 +417,7 @@ pub async fn test_mail(
.await;
Ok(Json(json!({
"ok": true,
- "message": format!("Message de test envoyé à {to}."),
+ "message": format!("Test message sent to {to}."),
"to": to,
"host": cfg.host,
"port": cfg.port,
@@ -452,32 +452,30 @@ fn hint_for(err: &send::SendError, cfg: &MailConfig) -> Option {
let raw = err.raw.to_lowercase();
if raw.contains("connection refused") || raw.contains("refused") {
return Some(format!(
- "Aucun service n'écoute sur {}:{}. Vérifiez l'hôte et le port.",
+ "No service is listening on {}:{}. Check the host and port.",
cfg.host, cfg.port
));
}
if raw.contains("timed out") || raw.contains("timeout") {
return Some(
- "Le relais ne répond pas : pare-feu, port bloqué, ou hôte injoignable.".into(),
+ "The relay is not responding: check for a firewall, blocked port, or unreachable host.".into(),
);
}
if raw.contains("535") || raw.contains("authentication") || raw.contains("auth") {
return Some(
- "Le relais a refusé les identifiants. Vérifiez l'identifiant et le mot de passe \
- (certains fournisseurs exigent un mot de passe d'application)."
+ "The relay refused the credentials. Check the username and password; some providers require an app password."
.into(),
);
}
if raw.contains("tls") || raw.contains("certificate") || raw.contains("handshake") {
return Some(format!(
- "Échec TLS avec le mode « {} ». Essayez starttls sur le port 587, ou tls sur le 465.",
+ "TLS failed with mode '{}'. Try starttls on port 587 or tls on port 465.",
cfg.security.as_str()
));
}
if raw.contains("relay") && raw.contains("denied") {
return Some(
- "Le relais refuse de router ce message : l'adresse d'expédition n'est probablement \
- pas autorisée sur ce serveur."
+ "The relay refuses to route this message. The sender address may not be authorized on this server."
.into(),
);
}
@@ -568,7 +566,7 @@ mod tests {
assert!(hint_for(&refused, &cfg).unwrap_or_default().contains("587"));
let auth = send::SendError { stage: "Envoi SMTP", raw: "535 5.7.8 Authentication failed".into() };
- assert!(hint_for(&auth, &cfg).unwrap_or_default().contains("identifiants"));
+ assert!(hint_for(&auth, &cfg).unwrap_or_default().contains("credentials"));
let unknown = send::SendError { stage: "Envoi SMTP", raw: "quelque chose d'inédit".into() };
assert!(hint_for(&unknown, &cfg).is_none());
diff --git a/server/src/handlers/admin/marketplace.rs b/server/src/handlers/admin/marketplace.rs
index e629cc69..7ef1d266 100644
--- a/server/src/handlers/admin/marketplace.rs
+++ b/server/src/handlers/admin/marketplace.rs
@@ -90,7 +90,7 @@ pub async fn install_marketplace(
// Refuse une installation déjà en cours pour ce module.
if let Some(p) = marketplace::get_progress(&id) {
if !matches!(p.phase.as_str(), "done" | "error") {
- return Err(AppError::Conflict(format!("installation de « {id} » déjà en cours")));
+ return Err(AppError::Conflict(format!("Installation of '{id}' is already in progress")));
}
}
marketplace::begin(&id);
diff --git a/server/src/handlers/admin/module_databases.rs b/server/src/handlers/admin/module_databases.rs
index 0c23ad4c..51b8c588 100644
--- a/server/src/handlers/admin/module_databases.rs
+++ b/server/src/handlers/admin/module_databases.rs
@@ -81,22 +81,22 @@ fn schema_prefix_is_valid(p: &str) -> bool {
fn validate(dto: &ModuleDbDto) -> Result<(), AppError> {
if !ENGINES.contains(&dto.engine.as_str()) {
- return Err(AppError::Validation(format!("Moteur inconnu : {}", dto.engine)));
+ return Err(AppError::Validation(format!("Unknown engine: {}", dto.engine)));
}
let prefix = dto.schema_prefix.as_deref().unwrap_or("").trim();
if !schema_prefix_is_valid(prefix) {
return Err(AppError::Validation(
- "Préfixe de schéma invalide : minuscules, chiffres et « _ » uniquement, 32 max.".into(),
+ "Invalid schema prefix: only lowercase letters, numbers, and '_'; maximum 32 characters.".into(),
));
}
match Backend::parse(&dto.engine) {
Some(Backend::Sqlite) => {}
_ => {
if dto.host.trim().is_empty() {
- return Err(AppError::Validation("L'hôte de la base est requis.".into()));
+ return Err(AppError::Validation("The database host is required.".into()));
}
if dto.user.trim().is_empty() {
- return Err(AppError::Validation("L'utilisateur de la base est requis.".into()));
+ return Err(AppError::Validation("The database user is required.".into()));
}
}
}
@@ -134,7 +134,7 @@ pub async fn get_module_database(
) -> Result, AppError> {
ctx.require_superuser("gestion de la base de données d'un module")?;
if !module_exists(&state.db, &id).await? {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
}
let inherited_engine = state.settings.database.engine.clone();
@@ -277,14 +277,14 @@ async fn ensure_target(
} else {
creds.path.trim().to_string()
};
- std::fs::create_dir_all(&dir).map_err(|e| format!("Répertoire inaccessible « {dir} » : {e}"))?;
+ std::fs::create_dir_all(&dir).map_err(|e| format!("Cannot access directory '{dir}': {e}"))?;
let probe = std::path::Path::new(&dir).join(".kubuno-write-probe");
std::fs::File::create(&probe)
- .map_err(|e| format!("Le répertoire « {dir} » n'est pas accessible en écriture : {e}"))?;
+ .map_err(|e| format!("Directory '{dir}' is not writable: {e}"))?;
let _ = std::fs::remove_file(&probe);
Ok(())
}
- None => Err(format!("Moteur inconnu : {}", creds.engine)),
+ None => Err(format!("Unknown engine: {}", creds.engine)),
}
}
@@ -299,7 +299,7 @@ pub async fn test_module_database(
) -> Result {
ctx.require_superuser("test de la base de données d'un module")?;
if !module_exists(&state.db, &id).await? {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
}
validate(&dto)?;
@@ -343,7 +343,7 @@ pub async fn put_module_database(
) -> Result, AppError> {
ctx.require_superuser("gestion de la base de données d'un module")?;
if !module_exists(&state.db, &id).await? {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
}
validate(&dto)?;
@@ -482,7 +482,7 @@ pub async fn delete_module_database(
) -> Result, AppError> {
ctx.require_superuser("gestion de la base de données d'un module")?;
if !module_exists(&state.db, &id).await? {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
}
// A banner scoped to this module covers the delete + restart.
diff --git a/server/src/handlers/admin/network.rs b/server/src/handlers/admin/network.rs
index 07449902..0fb5709c 100644
--- a/server/src/handlers/admin/network.rs
+++ b/server/src/handlers/admin/network.rs
@@ -131,11 +131,11 @@ pub async fn request_acme(
let net = NetworkConfig::load(&state.db).await;
let message = if https_live {
- "Certificat obtenu et rechargé à chaud."
+ "Certificate obtained and reloaded live."
} else if net.https_enabled {
- "Certificat obtenu. Redémarrez le service pour activer le HTTPS."
+ "Certificate obtained. Restart the service to enable HTTPS."
} else {
- "Certificat obtenu. Activez le HTTPS puis redémarrez le service pour l'utiliser."
+ "Certificate obtained. Enable HTTPS, then restart the service to use it."
};
Ok(Json(json!({
@@ -178,7 +178,7 @@ pub async fn delete_certificate(
let tx = audit.begin(&state.db).await?;
tx.commit(entry).await?;
- Ok(Json(json!({ "message": "Certificat supprimé" })))
+ Ok(Json(json!({ "message": "Certificate deleted" })))
}
#[derive(Deserialize)]
@@ -202,12 +202,12 @@ pub async fn upload_certificate(
if dto.cert_pem.trim().is_empty() || dto.key_pem.trim().is_empty() {
return Err(AppError::Validation(
- "Le certificat et la clé privée sont requis".into(),
+ "The certificate and private key are required".into(),
));
}
if dto.cert_pem.len() > MAX_PEM_LEN || dto.key_pem.len() > MAX_PEM_LEN {
return Err(AppError::Validation(
- "Certificat ou clé trop volumineux".into(),
+ "Certificate or key too large".into(),
));
}
@@ -246,11 +246,11 @@ pub async fn upload_certificate(
let restart_required = net.https_enabled && !https_live;
let message = if hot_reloaded {
- "Certificat installé et rechargé à chaud."
+ "Certificate installed and reloaded live."
} else if !net.https_enabled {
- "Certificat installé. Activez le HTTPS puis redémarrez le service pour l'utiliser."
+ "Certificate installed. Enable HTTPS, then restart the service to use it."
} else {
- "Certificat installé. Redémarrez le service pour activer le HTTPS."
+ "Certificate installed. Restart the service to enable HTTPS."
};
Ok(Json(json!({
diff --git a/server/src/handlers/admin/oauth_providers.rs b/server/src/handlers/admin/oauth_providers.rs
index 30a8d9e4..2074dacc 100644
--- a/server/src/handlers/admin/oauth_providers.rs
+++ b/server/src/handlers/admin/oauth_providers.rs
@@ -52,7 +52,7 @@ fn validate_slug(slug: &str) -> Result<(), AppError> {
Ok(())
} else {
Err(AppError::Validation(
- "slug invalide : 2 à 40 caractères, minuscules/chiffres/tirets uniquement".into(),
+ "Invalid slug: 2 to 40 characters; only lowercase letters, numbers, and hyphens".into(),
))
}
}
@@ -71,7 +71,7 @@ fn validate_issuer(url: &str) -> Result<(), AppError> {
match url::Url::parse(url) {
Ok(u) if u.scheme() == "https" || u.scheme() == "http" => Ok(()),
_ => Err(AppError::Validation(
- "issuer_url invalide (URL http(s) attendue)".into(),
+ "Invalid issuer_url (expected an http(s) URL)".into(),
)),
}
}
@@ -114,7 +114,7 @@ pub async fn create_oauth_provider(
validate_slug(&slug)?;
validate_issuer(dto.issuer_url.trim())?;
if dto.display_name.trim().is_empty() || dto.client_id.trim().is_empty() {
- return Err(AppError::Validation("display_name et client_id requis".into()));
+ return Err(AppError::Validation("display_name and client_id are required".into()));
}
let secret_enc = encrypt_secret(&state, &dto.client_secret)?;
@@ -161,7 +161,7 @@ pub async fn create_oauth_provider(
.await
.map_err(|e| match &e {
sqlx::Error::Database(db) if db.is_unique_violation() => {
- AppError::Conflict(format!("Un fournisseur avec le slug '{slug}' existe déjà"))
+ AppError::Conflict(format!("A provider with slug '{slug}' already exists"))
}
_ => {
tracing::error!(error = %e, "create_oauth_provider");
@@ -217,7 +217,7 @@ pub async fn update_oauth_provider(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_oauth_provider: lecture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Fournisseur SSO introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("SSO provider not found".into()))?;
let previous = provider_from_row(&prev_raw)?;
let updated_raw = kubuno_db::returning::update_returning_row(
@@ -261,7 +261,7 @@ pub async fn update_oauth_provider(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_oauth_provider: écriture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Fournisseur SSO introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("SSO provider not found".into()))?;
let row = provider_from_row(&updated_raw)?;
let public = AdminOAuthProvider::from(row.clone());
@@ -301,7 +301,7 @@ pub async fn delete_oauth_provider(
)
.await
.map_err(|e| { tracing::error!(error = %e, "delete_oauth_provider: lecture"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound("Fournisseur SSO introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("SSO provider not found".into()))?;
let previous = provider_from_row(&prev_raw)?;
tx.execute("DELETE FROM core.oauth_providers WHERE id = $1", params![id])
@@ -316,7 +316,7 @@ pub async fn delete_oauth_provider(
)
.await?;
- Ok(Json(json!({ "message": "Fournisseur supprimé" })))
+ Ok(Json(json!({ "message": "Provider deleted" })))
}
// ── Diagnostic ───────────────────────────────────────────────────────────────
@@ -346,7 +346,7 @@ pub async fn test_oauth_provider(
tracing::error!(error = %e, "test_oauth_provider: lecture");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Fournisseur SSO introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("SSO provider not found".into()))?;
let started = std::time::Instant::now();
let http = reqwest::Client::builder()
@@ -357,7 +357,7 @@ pub async fn test_oauth_provider(
let result = match oauth::discover(&http, &provider.issuer_url).await {
Ok(disc) => json!({
"ok": true,
- "message": "Document de découverte récupéré",
+ "message": "Discovery document retrieved",
"issuer_url": provider.issuer_url,
"authorization_endpoint": disc.authorization_endpoint,
"token_endpoint": disc.token_endpoint,
@@ -375,12 +375,11 @@ pub async fn test_oauth_provider(
}),
Err(e) => json!({
"ok": false,
- "message": "Découverte OIDC échouée",
+ "message": "OIDC discovery failed",
// The provider's own answer, truncated and verbatim: the useful part
// is usually its 404 body or the TLS alert, not our phrasing.
"detail": crate::directory::client::truncate(&e.to_string()),
- "hint": "L'URL d'émetteur doit être la BASE, sans « /.well-known/openid-configuration » : \
- le core l'ajoute. Pour Keycloak, elle finit par /realms/.",
+ "hint": "The issuer URL must be the base URL, without '/.well-known/openid-configuration'; the core adds that path. For Keycloak, it ends with /realms/.",
"issuer_url": provider.issuer_url,
"elapsed_ms": started.elapsed().as_millis() as u64,
}),
diff --git a/server/src/handlers/admin/org_units.rs b/server/src/handlers/admin/org_units.rs
index 977d0477..090a8084 100644
--- a/server/src/handlers/admin/org_units.rs
+++ b/server/src/handlers/admin/org_units.rs
@@ -134,13 +134,13 @@ fn invalidate_authz_cache() {
fn clean_name(raw: &str) -> Result<&str, AppError> {
let name = raw.trim();
if name.is_empty() {
- return Err(AppError::Validation("Nom requis".into()));
+ return Err(AppError::Validation("Name required".into()));
}
// Characters, not bytes: a 200-letter accented name is legal and a byte
// check would reject it.
if name.chars().count() > MAX_NAME_CHARS {
return Err(AppError::Validation(format!(
- "Nom trop long : {MAX_NAME_CHARS} caractères au maximum"
+ "Name too long: maximum {MAX_NAME_CHARS} characters"
)));
}
Ok(name)
@@ -160,8 +160,7 @@ fn check_depth(parent_depth: i32, subtree_height: i32) -> Result<(), AppError> {
let depth = resulting_depth(parent_depth, subtree_height);
if depth > MAX_ORG_UNIT_DEPTH {
return Err(AppError::Validation(format!(
- "Profondeur maximale dépassée : l'arborescence est limitée à \
- {MAX_ORG_UNIT_DEPTH} niveaux sous l'unité racine, cette opération en demanderait {depth}"
+ "Maximum depth exceeded: the tree is limited to {MAX_ORG_UNIT_DEPTH} levels below the root unit; this operation would require {depth}"
)));
}
Ok(())
@@ -172,7 +171,7 @@ fn check_depth(parent_depth: i32, subtree_height: i32) -> Result<(), AppError> {
fn map_write_error(e: sqlx::Error, name: &str, context: &'static str) -> AppError {
if matches!(&e, sqlx::Error::Database(db) if db.is_unique_violation()) {
AppError::Conflict(format!(
- "Une unité nommée « {name} » existe déjà sous la même unité parente"
+ "A unit named '{name}' already exists under the same parent unit"
))
} else {
tracing::error!(error = %e, "{context}");
@@ -347,7 +346,7 @@ pub async fn org_unit_impact(
)
.await
.map_err(|e| { tracing::error!(error = %e, "org_unit_impact: read"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Unité {id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unit {id}")))?;
// The subtree of a legal tree never exceeds the ceiling; the bound is a
// safety net for a tree that predates it.
@@ -400,8 +399,7 @@ pub async fn create_org_unit(
// request", and the message says why there is nothing to guess.
let Some(parent_id) = dto.parent_id else {
return Err(AppError::Validation(
- "Unité parente requise : une instance n'a qu'une seule unité racine, \
- toute nouvelle unité se crée sous une unité existante"
+ "Parent unit required: an instance has only one root unit; every new unit must be created under an existing unit"
.into(),
));
};
@@ -419,7 +417,7 @@ pub async fn create_org_unit(
let refuse = || AuditEntry::new("core.org_units.create").target_kind(target::ORG_UNIT, name);
let Some(parent_depth) = unit_depth(&mut tx, parent_id).await? else {
- let reason = format!("Unité parente {parent_id} introuvable");
+ let reason = format!("Parent unit {parent_id} not found");
return Err(tx
.abort(&state.db, refuse(), AppError::Validation(reason))
.await);
@@ -524,7 +522,7 @@ pub async fn update_org_unit(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_org_unit: read"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Unité {id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unit {id}")))?;
let previous = OrgUnit {
id: previous_row.try_get("id")?,
name: previous_row.try_get("name")?,
@@ -544,14 +542,14 @@ pub async fn update_org_unit(
// `"parent_id": null` asks for a second root. There is exactly one, and
// it is the one migration 000036 seeded.
Some(None) => {
- let reason = "Une instance n'a qu'une seule unité racine : une unité ne peut pas être promue racine";
+ let reason = "An instance has only one root unit; another unit cannot be promoted to root";
return Err(tx
.abort(&state.db, refuse(), AppError::Validation(reason.into()))
.await);
}
Some(Some(new_parent)) => {
if new_parent == id {
- let reason = "Une unité ne peut pas être son propre parent";
+ let reason = "A unit cannot be its own parent";
return Err(tx
.abort(&state.db, refuse(), AppError::Validation(reason.into()))
.await);
@@ -572,7 +570,7 @@ pub async fn update_org_unit(
if creates_cycle {
let reason =
- "Parent invalide : cette unité fait partie du sous-arbre de l'unité déplacée (cycle)";
+ "Invalid parent: this unit is in the moved unit's subtree (cycle)";
return Err(tx
.abort(&state.db, refuse(), AppError::Validation(reason.into()))
.await);
@@ -581,7 +579,7 @@ pub async fn update_org_unit(
// A move carries the whole subtree with it, so the ceiling applies
// to its deepest leaf - not to the unit being dragged.
let Some(parent_depth) = unit_depth(&mut tx, new_parent).await? else {
- let reason = format!("Unité parente {new_parent} introuvable");
+ let reason = format!("Parent unit {new_parent} not found");
return Err(tx
.abort(&state.db, refuse(), AppError::Validation(reason))
.await);
@@ -684,7 +682,7 @@ pub async fn delete_org_unit(
)
.await
.map_err(|e| { tracing::error!(error = %e, "delete_org_unit: read"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Unité {id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unit {id}")))?;
let unit = OrgUnit {
id: unit_row.try_get("id")?,
name: unit_row.try_get("name")?,
@@ -698,7 +696,7 @@ pub async fn delete_org_unit(
// the organisation itself, never an accidental second root. The refusal is
// journalled like any other attempt.
let Some(parent_id) = unit.parent_id else {
- let reason = "Impossible de supprimer l'unité racine";
+ let reason = "Cannot delete the root unit";
return Err(tx
.abort(
&state.db,
@@ -720,7 +718,7 @@ pub async fn delete_org_unit(
.fetch_optional_row(&impact_sql, params![id, id, id, id, id, id])
.await
.map_err(|e| { tracing::error!(error = %e, %id, "delete_org_unit: count"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Unité {id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unit {id}")))?;
let impact = DeletionImpact {
children: impact_row.try_get("children")?,
descendants: impact_row.try_get("descendants")?,
@@ -748,7 +746,7 @@ pub async fn delete_org_unit(
Err(e) => {
let err = if matches!(&e, sqlx::Error::Database(db) if db.is_unique_violation()) {
AppError::Conflict(
- "Suppression impossible : une sous-unité porterait le même nom qu'une unité déjà présente sous le parent. Renommez-la d'abord."
+ "Cannot delete: a child unit would have the same name as an existing unit under the parent. Rename it first."
.into(),
)
} else {
@@ -812,7 +810,7 @@ pub async fn delete_org_unit(
invalidate_authz_cache();
Ok(Json(json!({
- "message": "Unité supprimée",
+ "message": "Unit deleted",
// Echoed back so a caller that skipped `/impact` still learns what it
// did - the same numbers, in the same names.
"children": impact.children,
diff --git a/server/src/handlers/admin/password_reset.rs b/server/src/handlers/admin/password_reset.rs
index 38d12da5..8894373f 100644
--- a/server/src/handlers/admin/password_reset.rs
+++ b/server/src/handlers/admin/password_reset.rs
@@ -123,7 +123,7 @@ fn validate_address(value: &str) -> Result<(), AppError> {
if ok {
Ok(())
} else {
- Err(AppError::Validation(format!("Adresse invalide : « {value} »")))
+ Err(AppError::Validation(format!("Invalid address: '{value}'")))
}
}
@@ -189,8 +189,7 @@ pub async fn reset_user_password(
"reset_user_password: la politique rend la génération impossible"
);
AppError::Validation(
- "Impossible de générer un mot de passe satisfaisant la politique en vigueur : \
- assouplissez-la ou saisissez le mot de passe manuellement."
+ "Cannot generate a password that satisfies the current policy. Relax the policy or enter the password manually."
.into(),
)
})?;
@@ -200,15 +199,15 @@ pub async fn reset_user_password(
let supplied = dto
.password
.as_deref()
- .ok_or_else(|| AppError::Validation("Mot de passe requis en saisie manuelle".into()))?;
+ .ok_or_else(|| AppError::Validation("A password is required for manual entry".into()))?;
if supplied.chars().count() < MIN_PASSWORD_LEN {
return Err(AppError::Validation(format!(
- "Mot de passe : {MIN_PASSWORD_LEN} caractères minimum"
+ "Password: minimum {MIN_PASSWORD_LEN} characters"
)));
}
if supplied.len() > MAX_PASSWORD_LEN {
return Err(AppError::Validation(format!(
- "Mot de passe : {MAX_PASSWORD_LEN} caractères maximum"
+ "Password: maximum {MAX_PASSWORD_LEN} characters"
)));
}
policy.check(supplied)?;
@@ -257,7 +256,7 @@ pub async fn reset_user_password(
})?;
let Some(row) = target_row else {
- return Err(AppError::NotFound("Utilisateur introuvable".into()));
+ return Err(AppError::NotFound("User not found".into()));
};
let username: String = row.try_get("username").map_err(AppError::Database)?;
let email: String = row.try_get("email").map_err(AppError::Database)?;
@@ -438,7 +437,7 @@ pub async fn require_password_change(
})?;
let Some(row) = target_row else {
- return Err(AppError::NotFound("Utilisateur introuvable".into()));
+ return Err(AppError::NotFound("User not found".into()));
};
let username: String = row.try_get("username").map_err(AppError::Database)?;
let was_required: bool = row.try_get("must_change_password").map_err(AppError::Database)?;
@@ -449,8 +448,7 @@ pub async fn require_password_change(
// because that screen asks for a current password they do not have.
if dto.required && password_hash.is_none() {
return Err(AppError::Validation(
- "Ce compte n'a pas de mot de passe local : son authentification est gouvernée \
- par un annuaire ou un fournisseur d'identité."
+ "This account has no local password; its authentication is managed by a directory or identity provider."
.into(),
));
}
diff --git a/server/src/handlers/admin/period.rs b/server/src/handlers/admin/period.rs
index ebc2d89d..b4b82401 100644
--- a/server/src/handlers/admin/period.rs
+++ b/server/src/handlers/admin/period.rs
@@ -57,7 +57,7 @@ pub fn validate(asked: Option<&str>) -> Result<&'static str, AppError> {
.iter()
.copied()
.find(|p| *p == asked)
- .ok_or_else(|| AppError::Validation(format!("période inconnue : « {asked} »"))),
+ .ok_or_else(|| AppError::Validation(format!("Unknown period: '{asked}'"))),
}
}
diff --git a/server/src/handlers/admin/resources.rs b/server/src/handlers/admin/resources.rs
index 2147531f..33a813fc 100644
--- a/server/src/handlers/admin/resources.rs
+++ b/server/src/handlers/admin/resources.rs
@@ -159,7 +159,7 @@ fn clean_opt(raw: Option<&str>) -> Option {
fn max_len(value: &str, limit: usize, field: &str) -> Result<(), AppError> {
if value.chars().count() > limit {
return Err(AppError::Validation(format!(
- "{field} ne peut pas dépasser {limit} caractères."
+ "{field} cannot exceed {limit} characters."
)));
}
Ok(())
@@ -325,29 +325,29 @@ async fn resources_with_feature(db: &DbPool, feature_id: Uuid) -> Result AppError {
let s = e.to_string();
if s.contains("idx_core_buildings_key") {
- return AppError::Conflict("Un bâtiment porte déjà cet identifiant.".into());
+ return AppError::Conflict("A building already uses this identifier.".into());
}
if s.contains("idx_core_features_name") {
- return AppError::Conflict("Une fonctionnalité porte déjà ce nom.".into());
+ return AppError::Conflict("A feature already uses this name.".into());
}
if s.contains("idx_core_resources_name") {
return AppError::Conflict(
- "Une ressource porte déjà ce nom à cet étage de ce bâtiment.".into(),
+ "A resource already uses this name on this floor of this building.".into(),
);
}
if s.contains("resources_floor_in_building") {
return AppError::Validation(
- "Cet étage n'existe pas dans le bâtiment choisi. Ajoutez-le d'abord à la fiche du bâtiment.".into(),
+ "This floor does not exist in the selected building. Add it to the building first.".into(),
);
}
if s.contains("resources_type_iff_other") {
return AppError::Validation(
- "Le type ne se renseigne que pour une ressource qui n'est pas une salle, et il y est obligatoire.".into(),
+ "Type is only used for a resource that is not a room, and is required for those resources.".into(),
);
}
if s.contains("buildings_coordinates_pair") {
return AppError::Validation(
- "Latitude et longitude vont ensemble : renseignez les deux, ou aucune.".into(),
+ "Latitude and longitude must be provided together; enter both or neither.".into(),
);
}
tracing::error!(error = %e, context, "ressources: écriture");
@@ -389,10 +389,10 @@ fn validate_building(dto: &BuildingDto) -> Result {
let key = clean(&dto.building_key);
if key.is_empty() {
return Err(AppError::Validation(
- "L'identifiant du bâtiment est obligatoire : c'est lui qui apparaît dans le nom des ressources.".into(),
+ "The building identifier is required because it appears in resource names.".into(),
));
}
- max_len(&key, MAX_BUILDING_KEY, "L'identifiant du bâtiment")?;
+ max_len(&key, MAX_BUILDING_KEY, "Building identifier")?;
// Same alphabet as the column's CHECK. Refused here so the message can say
// *why*: the key is followed by a hyphen and a floor inside the generated
// name, and a space there would make that name ambiguous exactly where it is
@@ -402,19 +402,19 @@ fn validate_building(dto: &BuildingDto) -> Result {
.all(|c| c.is_ascii_alphanumeric() || c == '.' || c == '_' || c == '-')
{
return Err(AppError::Validation(
- "L'identifiant du bâtiment n'accepte que des lettres non accentuées, des chiffres, un point, un tiret ou un tiret bas - il compose le nom des ressources.".into(),
+ "The building identifier only accepts unaccented letters, numbers, dots, hyphens, and underscores because it forms part of resource names.".into(),
));
}
let name = clean_opt(dto.name.as_deref());
if let Some(n) = &name {
- max_len(n, MAX_BUILDING_NAME, "Le nom du bâtiment")?;
+ max_len(n, MAX_BUILDING_NAME, "Building name")?;
}
let address = clean(&dto.address);
if address.is_empty() {
return Err(AppError::Validation(
- "L'adresse est obligatoire : c'est la seule question que se pose quelqu'un qui a rendez-vous là-bas.".into(),
+ "The address is required so visitors know where to go.".into(),
));
}
max_len(&address, MAX_ADDRESS, "L'adresse")?;
@@ -428,7 +428,7 @@ fn validate_building(dto: &BuildingDto) -> Result {
(Some(la), Some(lo)) => {
if !(-90.0..=90.0).contains(&la) || !(-180.0..=180.0).contains(&lo) {
return Err(AppError::Validation(
- "Coordonnées hors limites : latitude entre -90 et 90, longitude entre -180 et 180.".into(),
+ "Coordinates out of range: latitude must be between -90 and 90, longitude between -180 and 180.".into(),
));
}
}
@@ -437,7 +437,7 @@ fn validate_building(dto: &BuildingDto) -> Result {
// valid coordinate.
_ => {
return Err(AppError::Validation(
- "Latitude et longitude vont ensemble : renseignez les deux, ou aucune.".into(),
+ "Latitude and longitude must be provided together; enter both or neither.".into(),
))
}
}
@@ -448,7 +448,7 @@ fn validate_building(dto: &BuildingDto) -> Result {
if f.is_empty() {
continue;
}
- max_len(&f, MAX_FLOOR, "Un nom d'étage")?;
+ max_len(&f, MAX_FLOOR, "Floor name")?;
// Case-insensitive, because the unique index is: two floors that read
// the same must not both exist, or a resource's floor would be ambiguous.
if floors
@@ -456,19 +456,19 @@ fn validate_building(dto: &BuildingDto) -> Result {
.any(|e: &String| e.to_lowercase() == f.to_lowercase())
{
return Err(AppError::Validation(format!(
- "L'étage « {f} » figure deux fois."
+ "Floor '{f}' appears twice."
)));
}
floors.push(f);
}
if floors.is_empty() {
return Err(AppError::Validation(
- "Un bâtiment doit avoir au moins un étage : c'est ce qui permet de dire où se trouve une ressource.".into(),
+ "A building must have at least one floor to locate its resources.".into(),
));
}
if floors.len() > MAX_FLOORS {
return Err(AppError::Validation(format!(
- "Au plus {MAX_FLOORS} étages par bâtiment."
+ "At most {MAX_FLOORS} floors per building."
)));
}
@@ -527,7 +527,7 @@ async fn write_floors(db: &mut DbTx, building_id: Uuid, floors: &[String]) -> Re
if let Err(e) = qb.tx_execute(db).await {
return Err(if e.to_string().contains("resources_floor_in_building") {
AppError::Validation(
- "Un étage retiré porte encore des ressources. Déplacez-les ou supprimez-les d'abord.".into(),
+ "A removed floor still contains resources. Move or delete them first.".into(),
)
} else {
tracing::error!(error = %e, "bâtiments: retrait d'étages");
@@ -714,7 +714,7 @@ pub async fn update_building(
tracing::error!(error = %e, "bâtiments: lecture avant modification");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Bâtiment introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Building not found".into()))?;
let before_json = building_json(&before);
let refuse = || AuditEntry::new("core.buildings.update").target(target::BUILDING, id, b.key.clone());
@@ -800,7 +800,7 @@ pub async fn delete_building(
tracing::error!(error = %e, "bâtiments: lecture avant suppression");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Bâtiment introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Building not found".into()))?;
let key: String = row.building_key.clone();
let count: i64 = row.resource_count;
@@ -812,7 +812,7 @@ pub async fn delete_building(
&state.db,
refuse(),
AppError::Validation(format!(
- "Ce bâtiment porte encore {count} ressource(s). Supprimez-les ou déplacez-les d'abord."
+ "This building still contains {count} resource(s). Delete or move them first."
)),
)
.await);
@@ -848,10 +848,10 @@ fn validate_feature(dto: &FeatureDto) -> Result<(String, Option), AppErr
let name = clean(&dto.name);
if name.is_empty() {
return Err(AppError::Validation(
- "Le nom de la fonctionnalité est obligatoire.".into(),
+ "The feature name is required.".into(),
));
}
- max_len(&name, MAX_FEATURE_NAME, "Le nom de la fonctionnalité")?;
+ max_len(&name, MAX_FEATURE_NAME, "Feature name")?;
let description = clean_opt(dto.description.as_deref());
if let Some(d) = &description {
max_len(d, MAX_ADMIN_NOTE, "La description")?;
@@ -973,7 +973,7 @@ pub async fn update_feature(
tracing::error!(error = %e, "fonctionnalités: lecture avant modification");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Fonctionnalité introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Feature not found".into()))?;
let before_json = json!({
"name": before.try_get::("name")?,
@@ -1038,7 +1038,7 @@ pub async fn delete_feature(
tracing::error!(error = %e, "fonctionnalités: lecture avant suppression");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Fonctionnalité introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Feature not found".into()))?;
let name: String = row.try_get("name")?;
let description: Option = row.try_get("description")?;
@@ -1120,14 +1120,14 @@ struct CleanResource {
fn validate_resource(dto: &ResourceDto) -> Result {
let name = clean(&dto.name);
if name.is_empty() {
- return Err(AppError::Validation("Le nom de la ressource est obligatoire.".into()));
+ return Err(AppError::Validation("The resource name is required.".into()));
}
max_len(&name, MAX_RESOURCE_NAME, "Le nom de la ressource")?;
let category = dto.category.trim().to_string();
if category != CATEGORY_ROOM && category != CATEGORY_OTHER {
return Err(AppError::Validation(format!(
- "Catégorie inconnue : « {category} ». Attendu : {CATEGORY_ROOM}, {CATEGORY_OTHER}."
+ "Unknown category: '{category}'. Expected: {CATEGORY_ROOM}, {CATEGORY_OTHER}."
)));
}
@@ -1137,12 +1137,12 @@ fn validate_resource(dto: &ResourceDto) -> Result {
match (category.as_str(), &resource_type) {
(CATEGORY_ROOM, Some(_)) => {
return Err(AppError::Validation(
- "Une salle n'a pas de type : elle est le type. Laissez le champ vide.".into(),
+ "A room does not have a type; leave the field empty.".into(),
))
}
(CATEGORY_OTHER, None) => {
return Err(AppError::Validation(
- "Le type est obligatoire pour une ressource qui n'est pas une salle (« Vélo », « Salon », « Vidéoprojecteur »…).".into(),
+ "Type is required for a resource that is not a room (e.g. 'Bike', 'Lounge', 'Projector').".into(),
))
}
_ => {}
@@ -1153,23 +1153,23 @@ fn validate_resource(dto: &ResourceDto) -> Result {
let floor = clean(&dto.floor_name);
if floor.is_empty() {
- return Err(AppError::Validation("L'étage est obligatoire.".into()));
+ return Err(AppError::Validation("The floor is required.".into()));
}
- max_len(&floor, MAX_FLOOR, "L'étage")?;
+ max_len(&floor, MAX_FLOOR, "Floor")?;
let section = clean_opt(dto.floor_section.as_deref());
if let Some(s) = §ion {
- max_len(s, MAX_SECTION, "La partie de l'étage")?;
+ max_len(s, MAX_SECTION, "Floor section")?;
}
if dto.capacity <= 0 {
return Err(AppError::Validation(
- "La capacité est un nombre entier de places strictement positif.".into(),
+ "Capacity must be a positive integer number of seats.".into(),
));
}
if dto.capacity > MAX_CAPACITY {
return Err(AppError::Validation(format!(
- "La capacité dépasse {MAX_CAPACITY} : il s'agit très probablement d'un chiffre en trop."
+ "Capacity exceeds {MAX_CAPACITY}; check for an extra digit."
)));
}
@@ -1205,7 +1205,7 @@ async fn write_features(
let mut seen = std::collections::HashSet::new();
if !feature_ids.iter().all(|id| seen.insert(*id)) {
return Err(AppError::Validation(
- "La même fonctionnalité figure deux fois.".into(),
+ "The same feature appears twice.".into(),
));
}
@@ -1227,7 +1227,7 @@ async fn write_features(
.await
.map_err(|e| {
if e.to_string().contains("foreign key") {
- AppError::Validation("Une des fonctionnalités indiquées n'existe pas.".into())
+ AppError::Validation("One of the specified features does not exist.".into())
} else {
tracing::error!(error = %e, "ressources: liaison d'une fonctionnalité");
AppError::Database(e)
@@ -1526,7 +1526,7 @@ pub async fn update_resource(
tracing::error!(error = %e, "ressources: lecture avant modification");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Ressource introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Resource not found".into()))?;
let before_json = resource_json(&before);
let refuse = || {
@@ -1629,7 +1629,7 @@ pub async fn delete_resource(
tracing::error!(error = %e, "ressources: lecture avant suppression");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Ressource introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Resource not found".into()))?;
let generated: String = row.generated_name.clone();
let refuse =
diff --git a/server/src/handlers/admin/roles.rs b/server/src/handlers/admin/roles.rs
index da94f4ab..e23b52a5 100644
--- a/server/src/handlers/admin/roles.rs
+++ b/server/src/handlers/admin/roles.rs
@@ -235,7 +235,7 @@ pub struct CreateRoleDto {
/// Slug shape: what appears in URLs and in the trail.
fn validate_slug(slug: &str) -> Result<(), AppError> {
if slug.len() < 2 || slug.len() > 100 {
- return Err(AppError::Validation("Identifiant : 2 à 100 caractères".into()));
+ return Err(AppError::Validation("Identifier: 2 to 100 characters".into()));
}
if !slug
.chars()
@@ -273,7 +273,7 @@ async fn validate_privileges(db: &DbPool, keys_in: &[String]) -> Result<(), AppE
let unknown: Vec<&String> = keys_in.iter().filter(|k| !known.contains(k)).collect();
if !unknown.is_empty() {
return Err(AppError::Validation(format!(
- "Privilège(s) inconnu(s) du catalogue : {}",
+ "Privilege(s) not found in the catalog: {}",
unknown
.iter()
.map(|k| k.as_str())
@@ -294,7 +294,7 @@ pub async fn create_role(
ensure_role_management(&ctx)?;
validate_slug(&dto.slug)?;
if dto.name.trim().is_empty() {
- return Err(AppError::Validation("Nom requis".into()));
+ return Err(AppError::Validation("Name required".into()));
}
// The catalogue check reads static reference data, so it runs on the pool
@@ -316,7 +316,7 @@ pub async fn create_role(
.await
.map_err(|e| {
if e.to_string().contains("unique") {
- AppError::Conflict(format!("Un rôle « {} » existe déjà", dto.slug))
+ AppError::Conflict(format!("A role named '{}' already exists", dto.slug))
} else {
tracing::error!(error = %e, "create_role");
AppError::Database(e)
@@ -386,7 +386,7 @@ pub async fn update_role(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_role: read"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Rôle {role_id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Role {role_id}")))?;
let previous = role_from_row(&previous_row)?;
// Read on the pool: no write has happened in this transaction yet, so the
@@ -406,7 +406,7 @@ pub async fn update_role(
.target(target::ROLE, role_id, name)
.before(role_snapshot(&previous, &before_privileges)),
AppError::Validation(
- "Les privilèges d'un rôle système ne sont pas modifiables".into(),
+ "System role privileges cannot be changed".into(),
),
)
.await);
@@ -445,7 +445,7 @@ pub async fn update_role(
)
.await
.map_err(|e| { tracing::error!(error = %e, "update_role: reselect"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Rôle {role_id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Role {role_id}")))?;
role_from_row(&row)?
};
@@ -493,9 +493,7 @@ pub async fn update_role(
.target(target::ROLE, role_id, name)
.before(role_snapshot(&previous, &before_privileges)),
AppError::Validation(format!(
- "Modification refusée : {broken} affectation(s) de ce rôle sont restreintes \
- à une unité organisationnelle, et le nouvel ensemble contient un privilège \
- non restreignable."
+ "Change refused: {broken} assignment(s) of this role are restricted to an organizational unit, and the new set contains a privilege that cannot be restricted."
)),
)
.await);
@@ -549,7 +547,7 @@ pub async fn delete_role(
)
.await
.map_err(|e| { tracing::error!(error = %e, "delete_role: read"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Rôle {role_id}")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Role {role_id}")))?;
let role = role_from_row(&role_row)?;
// Committed state (no write yet in this transaction), read on the pool.
@@ -584,7 +582,7 @@ pub async fn delete_role(
.await?;
cache::invalidate_all();
- Ok(Json(json!({ "message": "Rôle supprimé" })))
+ Ok(Json(json!({ "message": "Role deleted" })))
}
// ── Assignments ───────────────────────────────────────────────────────────────
@@ -690,21 +688,21 @@ pub async fn create_assignment(
match (dto.user_id, dto.group_id) {
(Some(_), Some(_)) => {
return Err(AppError::Validation(
- "Un sujet et un seul : utilisateur OU groupe".into(),
+ "Specify exactly one subject: user OR group".into(),
))
}
- (None, None) => return Err(AppError::Validation("Sujet requis".into())),
+ (None, None) => return Err(AppError::Validation("Subject required".into())),
_ => {}
}
if scope == AssignmentScope::OrgUnit && dto.org_unit_id.is_none() {
return Err(AppError::Validation(
- "Unité organisationnelle requise pour une portée « org_unit »".into(),
+ "Organizational unit required for an 'org_unit' scope".into(),
));
}
if let Some(expiry) = dto.expires_at {
if expiry <= chrono::Utc::now() {
return Err(AppError::Validation(
- "La date d'expiration doit être dans le futur".into(),
+ "The expiration date must be in the future".into(),
));
}
}
@@ -751,9 +749,9 @@ pub async fn create_assignment(
.await
.map_err(|e| {
if e.to_string().contains("uniq_core_assign") {
- AppError::Conflict("Cette affectation existe déjà".into())
+ AppError::Conflict("This assignment already exists".into())
} else if e.to_string().contains("foreign key") {
- AppError::NotFound("Rôle, sujet ou unité introuvable".into())
+ AppError::NotFound("Role, subject, or unit not found".into())
} else {
tracing::error!(error = %e, "create_assignment");
AppError::Database(e)
@@ -879,7 +877,7 @@ pub async fn delete_assignment(
.await?;
cache::invalidate_all();
- Ok(Json(json!({ "message": "Affectation retirée" })))
+ Ok(Json(json!({ "message": "Assignment removed" })))
}
/// `GET /admin/users/:id/privileges` - what one account effectively holds.
diff --git a/server/src/handlers/admin/rules.rs b/server/src/handlers/admin/rules.rs
index f46248cd..2403010e 100644
--- a/server/src/handlers/admin/rules.rs
+++ b/server/src/handlers/admin/rules.rs
@@ -300,7 +300,7 @@ pub async fn set_mode(
let mode = Mode::parse_settable(dto.mode.trim())?;
if mode.acts() && before.actions.is_empty() {
return Err(AppError::Validation(
- "Cette règle ne déclare aucune action : le mode « actif avec actions » n'aurait aucun effet".into(),
+ "This rule has no actions; 'active with actions' mode would have no effect".into(),
));
}
diff --git a/server/src/handlers/admin/schema_prefix.rs b/server/src/handlers/admin/schema_prefix.rs
index 39632c65..65713a3c 100644
--- a/server/src/handlers/admin/schema_prefix.rs
+++ b/server/src/handlers/admin/schema_prefix.rs
@@ -127,9 +127,7 @@ pub async fn put_schema_prefix(
if !applicable(&state) {
return Err(AppError::Validation(
- "Le préfixe de schéma ne s'applique pas à SQLite : chaque schéma est un fichier, \
- il n'y a pas d'espace de noms serveur à renommer. Changez le préfixe uniquement \
- sur PostgreSQL ou MySQL."
+ "Schema prefixes do not apply to SQLite: each schema is a file, so there is no server namespace to rename. Change the prefix only on PostgreSQL or MySQL."
.into(),
));
}
@@ -157,7 +155,7 @@ pub async fn put_schema_prefix(
&state.ws_hub,
GLOBAL_SCOPE,
format!(
- "Changement du préfixe de schéma (« {} » → « {} ») en cours…",
+ "Changing schema prefix ('{}' → '{}')…",
prefix_label(&old_prefix),
prefix_label(&new_prefix)
),
@@ -206,7 +204,7 @@ pub async fn put_schema_prefix(
let mapped = match e {
kubuno_db::AdminError::Sqlx(err) => AppError::Database(err),
kubuno_db::AdminError::BadPrefix(p) => {
- AppError::Validation(format!("Préfixe invalide : {p}"))
+ AppError::Validation(format!("Invalid prefix: {p}"))
}
other => AppError::Internal(anyhow::anyhow!(other.to_string())),
};
diff --git a/server/src/handlers/admin/security_dashboard.rs b/server/src/handlers/admin/security_dashboard.rs
index b9a76a3b..ecaba9e1 100644
--- a/server/src/handlers/admin/security_dashboard.rs
+++ b/server/src/handlers/admin/security_dashboard.rs
@@ -427,7 +427,7 @@ pub async fn security_dashboard(
.iter()
.find(|s| s.id == asked)
.map(|s| s.id)
- .ok_or_else(|| AppError::Validation(format!("panneau inconnu : « {asked} »")))?,
+ .ok_or_else(|| AppError::Validation(format!("Unknown panel: '{asked}'")))?,
),
};
let full = q.full.unwrap_or(false);
diff --git a/server/src/handlers/admin/setting_scopes.rs b/server/src/handlers/admin/setting_scopes.rs
index c2cbbd4b..7b300d8f 100644
--- a/server/src/handlers/admin/setting_scopes.rs
+++ b/server/src/handlers/admin/setting_scopes.rs
@@ -94,7 +94,7 @@ fn authorize(ctx: &AdminCtx, scope: &SettingScope, privilege: &str) -> Result<()
// like every other operation on that account.
ScopeKind::User => Ok(()),
ScopeKind::Default => Err(AppError::Validation(
- "La valeur d'usine n'est pas modifiable".into(),
+ "The factory default cannot be changed".into(),
)),
}
}
@@ -366,7 +366,7 @@ pub async fn set_scoped_value(
state.events.publish(change_event(&key, &scope, &out, true));
apply_side_effects(&state, &key, &scope).await;
- Ok(Json(json!({ "message": "Réglage enregistré" })))
+ Ok(Json(json!({ "message": "Setting saved" })))
}
/// DELETE /api/v1/admin/settings/scoped/:key - revert to the inherited value.
@@ -412,7 +412,7 @@ pub async fn clear_scoped_value(
apply_side_effects(&state, &key, &scope).await;
Ok(Json(json!({
- "message": "Valeur héritée rétablie",
+ "message": "Inherited value restored",
"value": out.effective,
})))
}
@@ -442,7 +442,7 @@ pub async fn set_scoped_lock(
state.events.publish(change_event(&key, &scope, &out, true));
Ok(Json(json!({
- "message": if dto.locked { "Réglage verrouillé" } else { "Verrou retiré" },
+ "message": if dto.locked { "Setting locked" } else { "Lock removed" },
})))
}
@@ -452,7 +452,7 @@ pub async fn set_scoped_lock(
fn guard_owned_elsewhere(key: &str) -> Result<(), AppError> {
if crate::handlers::admin::mail::owns_setting(key) {
return Err(AppError::Validation(format!(
- "'{key}' se règle depuis Administration → Courriel (PATCH /admin/mail/settings)"
+ "'{key}' is configured in Administration → Email (PATCH /admin/mail/settings)"
)));
}
// The restore drill is a *statement*, not a preference: it is written by the
@@ -461,8 +461,7 @@ fn guard_owned_elsewhere(key: &str) -> Result<(), AppError> {
// somebody vouched for it.
if key == crate::backup::policy::KEY_LAST_RESTORE_TEST {
return Err(AppError::Validation(format!(
- "'{key}' s'enregistre depuis Administration → Tâches de fond \
- (POST /admin/backup/restore-test)"
+ "'{key}' is saved in Administration → Background jobs (POST /admin/backup/restore-test)"
)));
}
Ok(())
@@ -490,11 +489,11 @@ pub(crate) fn validate_password_policy_value(key: &str, value: &Value) -> Result
return Ok(());
}
let n = value.as_i64().ok_or_else(|| {
- AppError::Validation(format!("'{key}' attend une valeur de type entier"))
+ AppError::Validation(format!("'{key}' expects an integer value"))
})?;
if !(min..=max).contains(&n) {
return Err(AppError::Validation(format!(
- "'{key}' doit être compris entre {min} et {max}"
+ "'{key}' must be between {min} and {max}"
)));
}
Ok(())
diff --git a/server/src/handlers/admin/settings.rs b/server/src/handlers/admin/settings.rs
index a461033e..d067face 100644
--- a/server/src/handlers/admin/settings.rs
+++ b/server/src/handlers/admin/settings.rs
@@ -118,7 +118,7 @@ pub async fn update_settings(
// exactly one writer, and it encrypts.
if let Some(key) = updates.keys().find(|k| crate::handlers::admin::mail::owns_setting(k)) {
return Err(AppError::Validation(format!(
- "'{key}' se règle depuis Administration → Courriel (PATCH /admin/mail/settings)"
+ "'{key}' is configured in Administration → Email (PATCH /admin/mail/settings)"
)));
}
@@ -133,7 +133,7 @@ pub async fn update_settings(
|| k.as_str() == crate::auth::methods::KEY_ADMIN_FALLBACK)
{
return Err(AppError::Validation(format!(
- "'{key}' se règle par portée depuis Administration → Sécurité → Authentification et SSO (PUT /admin/settings/scoped/{key}), pour qu'il puisse varier par unité organisationnelle et passer le garde-fou anti-verrouillage"
+ "'{key}' is configured by scope in Administration → Security → Authentication and SSO (PUT /admin/settings/scoped/{key}), so it can vary by organizational unit and pass the lockout protection check"
)));
}
@@ -200,7 +200,7 @@ pub async fn update_settings(
// At least one entry is required to commit; an empty PATCH has nothing to
// audit and nothing to change either.
let Some(last) = entries.pop() else {
- return Ok(Json(json!({ "message": "Aucun paramètre à mettre à jour", "updated": 0 })));
+ return Ok(Json(json!({ "message": "No settings to update", "updated": 0 })));
};
for entry in entries {
tx.also(entry);
@@ -217,7 +217,7 @@ pub async fn update_settings(
// evaluation; not invalidating tells the operator their fix did not take.
crate::health::invalidate();
- Ok(Json(json!({ "message": "Paramètres mis à jour", "updated": updates.len() })))
+ Ok(Json(json!({ "message": "Settings updated", "updated": updates.len() })))
}
/// Checks every module-owned key of a settings PATCH against the declaration
@@ -356,7 +356,7 @@ pub async fn get_admin_module(
params![&id],
)
.await?
- .ok_or_else(|| AppError::NotFound(format!("Module '{id}' introuvable")))?;
+ .ok_or_else(|| AppError::NotFound(format!("Module '{id}' not found")))?;
let config = row.config;
let settings_path = config.get("settings_path")
@@ -389,7 +389,7 @@ pub async fn toggle_module(
let enabled = body
.get("is_enabled")
.and_then(|v| v.as_bool())
- .ok_or_else(|| AppError::Validation("Champ 'is_enabled' requis (bool)".into()))?;
+ .ok_or_else(|| AppError::Validation("Field 'is_enabled' is required (bool)".into()))?;
// Only the flag flip is transactional-with-audit; the cascade below drives
// the in-memory registry and the event bus, which no transaction can roll
@@ -412,7 +412,7 @@ pub async fn toggle_module(
.map_err(|e| { tracing::error!(error = %e, module_id = %id, "toggle_module: lecture"); AppError::Database(e) })?;
let Some(row) = previous else {
- return Err(AppError::NotFound(format!("Module '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Module '{id}' not found")));
};
let display_name: String = row.try_get("display_name").map_err(AppError::Database)?;
let version: String = row.try_get("version").map_err(AppError::Database)?;
@@ -513,7 +513,7 @@ pub async fn toggle_module(
}
Ok(Json(json!({
- "message": if enabled { "Module activé" } else { "Module désactivé" },
+ "message": if enabled { "Module enabled" } else { "Module disabled" },
"also_disabled": also_disabled,
})))
}
diff --git a/server/src/handlers/admin/subscription.rs b/server/src/handlers/admin/subscription.rs
index 09e19646..1738707d 100644
--- a/server/src/handlers/admin/subscription.rs
+++ b/server/src/handlers/admin/subscription.rs
@@ -244,12 +244,12 @@ pub async fn register_key(
let key_text = dto.key.trim();
if key_text.is_empty() {
return Err(AppError::Validation(
- "Collez la clé de support fournie par l'éditeur.".into(),
+ "Paste the support key supplied by the publisher.".into(),
));
}
if key_text.len() > MAX_KEY_LEN {
return Err(AppError::Validation(
- "Cette clé de support est trop longue pour en être une.".into(),
+ "This support key is too long.".into(),
));
}
@@ -307,7 +307,7 @@ pub async fn register_key(
let stored = store::contract(&state.db).await?.ok_or_else(|| {
tracing::error!("subscription: contrat introuvable juste après son enregistrement");
- AppError::NotFound("Contrat de support".into())
+ AppError::NotFound("Support contract".into())
})?;
Ok(Json(json!({ "contract": contract_json(&stored, &key.trust) })))
}
@@ -326,7 +326,7 @@ pub async fn remove_key(
ctx.require(keys::SETTINGS_MANAGE)?;
let previous = store::contract(&state.db).await?.ok_or_else(|| {
- AppError::NotFound("Aucun contrat de support n'est enregistré".into())
+ AppError::NotFound("No support contract is saved".into())
})?;
let mut tx = audit.begin(&state.db).await?;
diff --git a/server/src/handlers/admin/users.rs b/server/src/handlers/admin/users.rs
index b25d209d..fdb47954 100644
--- a/server/src/handlers/admin/users.rs
+++ b/server/src/handlers/admin/users.rs
@@ -430,7 +430,7 @@ pub async fn export_users(
if users.len() as i64 > EXPORT_MAX {
return Err(AppError::Validation(format!(
- "Trop de comptes pour un seul export (maximum {EXPORT_MAX}) - restreignez la recherche ou l'unité"
+ "Too many accounts for one export (maximum {EXPORT_MAX}). Narrow the search or unit"
)));
}
@@ -566,7 +566,7 @@ pub async fn create_user(
.map_err(|e| { tracing::error!(error = %e, "create_user: unicité"); AppError::Database(e) })?;
if exists {
- return Err(AppError::Conflict("Email ou username déjà utilisé".into()));
+ return Err(AppError::Conflict("Email or username already in use".into()));
}
// No unit named means the root, resolved here rather than left to the
@@ -973,11 +973,11 @@ pub async fn bulk_set_org_unit(
ids.dedup();
if ids.is_empty() {
- return Err(AppError::Validation("Aucun compte sélectionné".into()));
+ return Err(AppError::Validation("No accounts selected".into()));
}
if ids.len() > BULK_MAX {
return Err(AppError::Validation(format!(
- "Trop de comptes en une fois (maximum {BULK_MAX})"
+ "Too many accounts at once (maximum {BULK_MAX})"
)));
}
@@ -994,7 +994,7 @@ pub async fn bulk_set_org_unit(
)
.await
.map_err(|e| { tracing::error!(error = %e, "bulk_set_org_unit: unité"); AppError::Database(e) })?
- .ok_or_else(|| AppError::NotFound(format!("Unité {}", dto.org_unit_id)))?;
+ .ok_or_else(|| AppError::NotFound(format!("Unit {}", dto.org_unit_id)))?;
// Locked one row at a time, in the sorted id order, so two concurrent bulk
// moves take the rows in the same order and queue instead of deadlocking.
@@ -1015,7 +1015,7 @@ pub async fn bulk_set_org_unit(
if previous.len() != ids.len() {
return Err(AppError::NotFound(format!(
- "{} compte(s) introuvable(s)",
+ "{} account(s) not found",
ids.len() - previous.len()
)));
}
@@ -1092,11 +1092,11 @@ fn bulk_ids(raw: &[Uuid]) -> Result, AppError> {
ids.sort_unstable();
ids.dedup();
if ids.is_empty() {
- return Err(AppError::Validation("Aucun compte sélectionné".into()));
+ return Err(AppError::Validation("No accounts selected".into()));
}
if ids.len() > BULK_MAX {
return Err(AppError::Validation(format!(
- "Trop de comptes en une fois (maximum {BULK_MAX})"
+ "Too many accounts at once (maximum {BULK_MAX})"
)));
}
Ok(ids)
@@ -1130,7 +1130,7 @@ async fn bulk_load_and_authorise(
if users.len() != ids.len() {
return Err(AppError::NotFound(format!(
- "{} compte(s) introuvable(s)",
+ "{} account(s) not found",
ids.len() - users.len()
)));
}
@@ -1478,7 +1478,7 @@ pub async fn delete_user(
state.events.publish(crate::events::AppEvent::UserDeleted { user_id: id });
- Ok(Json(json!({ "message": "Utilisateur désactivé" })))
+ Ok(Json(json!({ "message": "User disabled" })))
}
/// Body of a purge: the account's own email address, typed back.
@@ -1543,7 +1543,7 @@ pub async fn purge_user(
.target(target::USER, id, user_label(&victim))
.denied("compte encore actif"),
AppError::Validation(
- "Ce compte est encore actif : désactivez-le d'abord. La suppression définitive ne s'applique qu'à un compte déjà retiré du service.".into(),
+ "This account is still active. Disable it first; permanent deletion only applies to an account already taken out of service.".into(),
),
)
.await);
@@ -1560,7 +1560,7 @@ pub async fn purge_user(
.target(target::USER, id, user_label(&victim))
.denied("adresse de confirmation incorrecte"),
AppError::Validation(
- "L'adresse saisie ne correspond pas à celle du compte. Recopiez-la exactement pour confirmer la suppression définitive.".into(),
+ "The entered address does not match the account's address. Copy it exactly to confirm permanent deletion.".into(),
),
)
.await);
@@ -1604,7 +1604,7 @@ pub async fn purge_user(
// finish, or to say precisely what is in the way.
match e.as_database_error().and_then(|d| d.constraint()) {
Some(c) => AppError::Conflict(format!(
- "Des données liées empêchent l'effacement de ce compte (contrainte « {c} »). Elles doivent être traitées avant la suppression définitive."
+ "Related data prevents this account from being erased (constraint '{c}'). Resolve it before permanently deleting the account."
)),
None => AppError::Database(e),
}
@@ -1627,7 +1627,7 @@ pub async fn purge_user(
// that only reacts to this one still learns of it.
state.events.publish(crate::events::AppEvent::UserDeleted { user_id: id });
- Ok(Json(json!({ "message": "Compte supprimé définitivement" })))
+ Ok(Json(json!({ "message": "Account permanently deleted" })))
}
/// One zero-filled daily series over the last `days` days, up to today in UTC.
@@ -1951,7 +1951,7 @@ pub async fn revoke_user_session(
.map_err(|e| { tracing::error!(error = %e, "revoke_user_session: lecture"); AppError::Database(e) })?;
let Some(session) = session else {
- return Err(AppError::NotFound("Session introuvable".into()));
+ return Err(AppError::NotFound("Session not found".into()));
};
let device_name: Option = session.try_get("device_name").map_err(AppError::Database)?;
let device_type: Option = session.try_get("device_type").map_err(AppError::Database)?;
diff --git a/server/src/handlers/api_tokens.rs b/server/src/handlers/api_tokens.rs
index b4cd1d03..56420997 100644
--- a/server/src/handlers/api_tokens.rs
+++ b/server/src/handlers/api_tokens.rs
@@ -284,7 +284,7 @@ pub async fn revoke(
AppError::Database(e)
})?;
if affected == 0 {
- return Err(AppError::NotFound("Token introuvable".into()));
+ return Err(AppError::NotFound("Token not found".into()));
}
let token = state
@@ -319,7 +319,7 @@ pub async fn revoke(
)
.await;
- Ok(Json(json!({ "message": "Token révoqué" })))
+ Ok(Json(json!({ "message": "Token revoked" })))
}
/// Charge la liste des rôles autorisés depuis la setting `auth.api_token_allowed_roles`.
diff --git a/server/src/handlers/auth/accounts.rs b/server/src/handlers/auth/accounts.rs
index 64aeb16c..9c395c74 100644
--- a/server/src/handlers/auth/accounts.rs
+++ b/server/src/handlers/auth/accounts.rs
@@ -122,7 +122,7 @@ pub async fn switch_account(
Json(dto): Json,
) -> Result {
if dto.slot >= MAX_ACCOUNT_SLOTS {
- return Err(AppError::Validation("Emplacement de compte invalide".into()));
+ return Err(AppError::Validation("Invalid account slot".into()));
}
let raw = read_slot_cookie(&headers, dto.slot).ok_or(AppError::Unauthorized)?;
let hash = token::hash_token(&raw);
diff --git a/server/src/handlers/auth/login.rs b/server/src/handlers/auth/login.rs
index d7c375d9..699b1ba1 100644
--- a/server/src/handlers/auth/login.rs
+++ b/server/src/handlers/auth/login.rs
@@ -30,7 +30,7 @@ use super::tokens::{
request_body = LoginDto,
responses(
(status = 200, description = "Authentifié. Pour client_type 'native'/'desktop' le corps est un NativeTokenResponse ; sinon LoginResponse + cookie HttpOnly refresh_token.", body = NativeTokenResponse),
- (status = 422, description = "Identifiants invalides")
+ (status = 422, description = "Invalid credentials")
)
)]
pub async fn login(
@@ -60,7 +60,7 @@ pub async fn login(
.map_err(AppError::Internal)?;
// Même message dans tous les cas (pas d'énumération email/mot de passe)
- let invalid = || AppError::Validation("Identifiants invalides".into());
+ let invalid = || AppError::Validation("Invalid credentials".into());
// Failed sign-ins are audited for administrator accounts only: they are the
// ones whose compromise matters, and recording every miss on every unknown
@@ -451,7 +451,7 @@ pub async fn logout(
// Remove ONE parked account. The active session survives - unless the
// removed slot IS the active account.
if slot >= MAX_ACCOUNT_SLOTS {
- return Err(AppError::Validation("Emplacement de compte invalide".into()));
+ return Err(AppError::Validation("Invalid account slot".into()));
}
if let Some(raw) = read_slot_cookie(&headers, slot) {
revoke_session(&state, &raw).await;
@@ -488,7 +488,7 @@ pub async fn logout(
}
let mut response =
- (StatusCode::OK, Json(json!({ "message": "Déconnecté" }))).into_response();
+ (StatusCode::OK, Json(json!({ "message": "Signed out" }))).into_response();
for cookie in cookies_to_clear {
if let Ok(value) = header::HeaderValue::from_str(&cookie) {
response.headers_mut().append(header::SET_COOKIE, value);
diff --git a/server/src/handlers/auth/oauth.rs b/server/src/handlers/auth/oauth.rs
index 6eed1b89..f8738053 100644
--- a/server/src/handlers/auth/oauth.rs
+++ b/server/src/handlers/auth/oauth.rs
@@ -42,7 +42,7 @@ async fn load_enabled_provider(db: &DbPool, slug: &str) -> Result {
let url = format!(
"/auth/oauth/callback?error={}",
- urlencoding_encode("Création de compte via SSO désactivée pour ce fournisseur")
+ urlencoding_encode("SSO account creation is disabled for this provider")
);
return Ok(([(header::SET_COOKIE, clear_pkce)], Redirect::to(&url)).into_response());
}
@@ -238,7 +238,7 @@ pub async fn oauth_callback(
let url = format!(
"/auth/oauth/callback?error={}",
urlencoding_encode(
- "La connexion par fournisseur d'identité n'est pas autorisée pour votre unité organisationnelle."
+ "Identity provider sign-in is not allowed for your organizational unit."
)
);
return Ok(([(header::SET_COOKIE, clear_pkce)], Redirect::to(&url)).into_response());
diff --git a/server/src/handlers/auth/password_reset.rs b/server/src/handlers/auth/password_reset.rs
index d29e046f..8ca23fe0 100644
--- a/server/src/handlers/auth/password_reset.rs
+++ b/server/src/handlers/auth/password_reset.rs
@@ -36,7 +36,7 @@ pub async fn forgot_password(
Json(dto): Json,
) -> impl IntoResponse {
// Répondre identiquement quelle que soit l'existence de l'email (anti-énumération)
- let ok = Json(json!({ "message": "Si cet email existe, un lien de réinitialisation a été envoyé." }));
+ let ok = Json(json!({ "message": "If this email address exists, a password reset link has been sent." }));
let email = dto.email.trim();
// A syntactically impossible address cannot match a row; bailing out here
@@ -163,7 +163,7 @@ pub async fn reset_password(
params![&hash, chrono::Utc::now()],
)
.await?
- .ok_or_else(|| AppError::Validation("Token invalide ou expiré".into()))?;
+ .ok_or_else(|| AppError::Validation("Invalid or expired token".into()))?;
// Holding a valid link is not an exemption from the policy: this is the one
// route on which a password is chosen by somebody who has just proved
@@ -220,5 +220,5 @@ pub async fn reset_password(
tx.commit().await?;
- Ok(Json(json!({ "message": "Mot de passe réinitialisé avec succès" })))
+ Ok(Json(json!({ "message": "Password reset successfully" })))
}
diff --git a/server/src/handlers/auth/reauth.rs b/server/src/handlers/auth/reauth.rs
index 9d194037..5817d8f1 100644
--- a/server/src/handlers/auth/reauth.rs
+++ b/server/src/handlers/auth/reauth.rs
@@ -75,7 +75,7 @@ async fn deny(
entry("core.auth.reauth.failed", user).denied(reason),
)
.await;
- AppError::Validation("Preuve invalide".into())
+ AppError::Validation("Invalid proof".into())
}
#[utoipa::path(
@@ -128,7 +128,7 @@ pub async fn reauth_challenge(
responses(
(status = 200, description = "Preuve fraîche émise"),
(status = 403, description = "Un jeton d'API ne peut pas satisfaire un défi"),
- (status = 422, description = "Preuve invalide")
+ (status = 422, description = "Invalid proof")
)
)]
pub async fn reauth(
@@ -148,7 +148,7 @@ pub async fn reauth(
.map(str::trim)
.filter(|s| !s.is_empty())
.ok_or_else(|| {
- AppError::Validation("Code de double authentification requis".into())
+ AppError::Validation("Two-factor authentication code required".into())
})?;
if backup_codes::looks_like_code(submitted) {
@@ -187,11 +187,11 @@ pub async fn reauth(
.password
.as_deref()
.filter(|s| !s.is_empty())
- .ok_or_else(|| AppError::Validation("Mot de passe requis".into()))?;
+ .ok_or_else(|| AppError::Validation("Password required".into()))?;
let hash = user
.password_hash
.as_deref()
- .ok_or_else(|| AppError::Validation("Ce compte n'a pas de mot de passe local".into()))?;
+ .ok_or_else(|| AppError::Validation("This account has no local password".into()))?;
let ok = password::verify_password(submitted, hash).map_err(AppError::Internal)?;
if !ok {
return Err(deny(&state, &ctx, &user, "bad_password").await);
diff --git a/server/src/handlers/auth/register.rs b/server/src/handlers/auth/register.rs
index 696e2a91..910dd091 100644
--- a/server/src/handlers/auth/register.rs
+++ b/server/src/handlers/auth/register.rs
@@ -20,7 +20,7 @@ struct GroupIdRow {
tag = "auth",
request_body = CreateUserDto,
responses(
- (status = 201, description = "Compte créé"),
+ (status = 201, description = "Account created"),
(status = 403, description = "Inscription fermée"),
(status = 409, description = "Email ou nom d'utilisateur déjà pris")
)
@@ -64,10 +64,10 @@ pub async fn register(
if !crate::domains::store::is_verified(&state.db, &domain).await {
let accepted = crate::domains::store::verified_names(&state.db).await;
return Err(AppError::Validation(if accepted.is_empty() {
- "Les inscriptions sont réservées aux adresses des domaines de cette instance.".into()
+ "Registration is restricted to addresses on this instance's domains.".into()
} else {
format!(
- "Les inscriptions sont réservées aux adresses de : {}.",
+ "Registration is restricted to addresses on: {}.",
accepted.join(", ")
)
}));
@@ -84,7 +84,7 @@ pub async fn register(
.await?;
if exists {
- return Err(AppError::Conflict("Email ou nom d'utilisateur déjà utilisé".into()));
+ return Err(AppError::Conflict("Email or username already in use".into()));
}
// A public sign-up names no unit, so it lands at the root of the tree - not
diff --git a/server/src/handlers/auth/tokens.rs b/server/src/handlers/auth/tokens.rs
index 0b2174d1..08aaf262 100644
--- a/server/src/handlers/auth/tokens.rs
+++ b/server/src/handlers/auth/tokens.rs
@@ -321,7 +321,7 @@ async fn resolve_account_slot(
) -> Result {
if let Some(slot) = requested {
if slot >= MAX_ACCOUNT_SLOTS {
- return Err(AppError::Validation("Emplacement de compte invalide".into()));
+ return Err(AppError::Validation("Invalid account slot".into()));
}
return Ok(slot);
}
@@ -375,7 +375,7 @@ async fn resolve_account_slot(
}
first_free.ok_or_else(|| {
AppError::Validation(format!(
- "Nombre maximal de comptes simultanés atteint ({MAX_ACCOUNT_SLOTS})"
+ "Maximum number of simultaneous accounts reached ({MAX_ACCOUNT_SLOTS})"
))
})
}
diff --git a/server/src/handlers/auth/totp.rs b/server/src/handlers/auth/totp.rs
index 6e489602..54a59931 100644
--- a/server/src/handlers/auth/totp.rs
+++ b/server/src/handlers/auth/totp.rs
@@ -49,7 +49,7 @@ enum Cleared {
responses(
(status = 200, description = "2FA validée, session émise", body = NativeTokenResponse),
(status = 401, description = "Session TOTP invalide"),
- (status = 422, description = "Code incorrect")
+ (status = 422, description = "Incorrect code")
)
)]
pub async fn totp_verify(
@@ -73,7 +73,7 @@ pub async fn totp_verify(
let encrypted = user
.totp_secret
.as_deref()
- .ok_or_else(|| AppError::Validation("2FA non configurée".into()))?;
+ .ok_or_else(|| AppError::Validation("2FA is not configured".into()))?;
// A submission is routed by shape, not by which field the client filled in:
// people paste their backup code into the field the dialog happens to focus,
@@ -93,7 +93,7 @@ pub async fn totp_verify(
let code = dto
.code
.as_deref()
- .ok_or_else(|| AppError::Validation("Code requis".into()))?;
+ .ok_or_else(|| AppError::Validation("Code required".into()))?;
let valid = totp_auth::verify_code(
&state.settings.auth.jwt_secret, encrypted, code, &user.email,
)
@@ -115,7 +115,7 @@ pub async fn totp_verify(
}
// Same message either way: telling the caller *which* factor was wrong
// would confirm whether the account still has unused backup codes.
- return Err(AppError::Validation("Code incorrect".into()));
+ return Err(AppError::Validation("Incorrect code".into()));
};
// Second factor cleared: this is where an administrator's sign-in actually
diff --git a/server/src/handlers/clipboard.rs b/server/src/handlers/clipboard.rs
index 1f7d329f..51dac421 100644
--- a/server/src/handlers/clipboard.rs
+++ b/server/src/handlers/clipboard.rs
@@ -108,13 +108,13 @@ pub async fn push(
let payload_size = dto.payload.to_string().len();
if payload_size > MAX_PAYLOAD_BYTES {
return Err(AppError::Validation(format!(
- "Contenu trop volumineux pour l'historique du presse-papiers ({} Ko, maximum {} Ko)",
+ "Content is too large for clipboard history ({} KB, maximum {} KB)",
payload_size / 1024,
MAX_PAYLOAD_BYTES / 1024
)));
}
if dto.payload.is_null() {
- return Err(AppError::Validation("Contenu vide".into()));
+ return Err(AppError::Validation("Content is empty".into()));
}
let fp = fingerprint(&dto.payload);
@@ -216,7 +216,7 @@ pub async fn update(
) -> Result, AppError> {
dto.validate().map_err(|e| AppError::Validation(e.to_string()))?;
let Some(pinned) = dto.pinned else {
- return Err(AppError::Validation("Rien à modifier".into()));
+ return Err(AppError::Validation("Nothing to change".into()));
};
// No RETURNING on the update (MySQL has none): flip the pin on the identity
@@ -234,7 +234,7 @@ pub async fn update(
e
})?;
if affected == 0 {
- return Err(AppError::NotFound("Élément introuvable".into()));
+ return Err(AppError::NotFound("Item not found".into()));
}
let item = state
@@ -271,7 +271,7 @@ pub async fn delete(
e
})?;
if done == 0 {
- return Err(AppError::NotFound("Élément introuvable".into()));
+ return Err(AppError::NotFound("Item not found".into()));
}
Ok(Json(json!({ "ok": true })))
}
diff --git a/server/src/handlers/devices.rs b/server/src/handlers/devices.rs
index fb18d8f4..9b4c5493 100644
--- a/server/src/handlers/devices.rs
+++ b/server/src/handlers/devices.rs
@@ -399,7 +399,7 @@ pub async fn declare(
.await
.ok_or_else(|| {
AppError::Validation(
- "Appareil non identifié : l'application doit envoyer sa clé d'appareil".into(),
+ "Unidentified device: the app must send its device key".into(),
)
})?;
diff --git a/server/src/handlers/gate.rs b/server/src/handlers/gate.rs
index 421502ad..1f8a40ce 100644
--- a/server/src/handlers/gate.rs
+++ b/server/src/handlers/gate.rs
@@ -43,7 +43,7 @@ pub async fn gate(
) -> Result, AppError> {
if request.trigger.trim().is_empty() {
return Err(AppError::Validation(
- "Le portail exige le déclencheur auquel l'opération correspond".into(),
+ "The gate requires the trigger corresponding to this operation".into(),
));
}
diff --git a/server/src/handlers/holidays.rs b/server/src/handlers/holidays.rs
index 0f0b4181..22dc834d 100644
--- a/server/src/handlers/holidays.rs
+++ b/server/src/handlers/holidays.rs
@@ -64,7 +64,7 @@ pub struct FeedParams {
fn parse_date(raw: &str, field: &str) -> Result {
raw.trim()
.parse::()
- .map_err(|_| AppError::Validation(format!("Paramètre « {field} » : date attendue au format AAAA-MM-JJ")))
+ .map_err(|_| AppError::Validation(format!("Parameter '{field}': expected a date in YYYY-MM-DD format")))
}
fn parse_categories(raw: Option<&str>) -> Result, AppError> {
@@ -117,22 +117,22 @@ pub async fn feed(
let from = match params.from.as_deref() {
Some(raw) => parse_date(raw, "from")?,
None => NaiveDate::from_ymd_opt(today.year(), 1, 1)
- .ok_or_else(|| AppError::Validation("Année hors de portée".into()))?,
+ .ok_or_else(|| AppError::Validation("Year out of range".into()))?,
};
let to = match params.to.as_deref() {
Some(raw) => parse_date(raw, "to")?,
None => NaiveDate::from_ymd_opt(from.year() + 1, 1, 1)
.map(|d| d.pred_opt().unwrap_or(d))
- .ok_or_else(|| AppError::Validation("Année hors de portée".into()))?,
+ .ok_or_else(|| AppError::Validation("Year out of range".into()))?,
};
if to < from {
return Err(AppError::Validation(
- "La date de fin précède la date de début".into(),
+ "The end date precedes the start date".into(),
));
}
if (to - from).num_days() > MAX_SPAN_DAYS {
return Err(AppError::Validation(
- "Plage trop large : cinq ans au maximum par requête".into(),
+ "Range too large: maximum five years per request".into(),
));
}
diff --git a/server/src/handlers/labels.rs b/server/src/handlers/labels.rs
index 29367806..0d60bc52 100644
--- a/server/src/handlers/labels.rs
+++ b/server/src/handlers/labels.rs
@@ -28,7 +28,7 @@ use crate::{
fn normalized_color(color: Option<&str>) -> Result {
let c = color.unwrap_or("#1a73e8").trim().to_string();
if !c.starts_with('#') || !(4..=9).contains(&c.len()) || !c[1..].chars().all(|ch| ch.is_ascii_hexdigit()) {
- return Err(AppError::Validation("Couleur invalide (attendu #rrggbb)".into()));
+ return Err(AppError::Validation("Invalid color (expected #rrggbb)".into()));
}
Ok(c)
}
@@ -62,7 +62,7 @@ async fn require_manage(db: &DbPool, user_id: Uuid, label_id: Uuid) -> Result<()
match access(db, user_id, label_id).await? {
Some((_, true)) => Ok(()),
Some((_, false)) => Err(AppError::Forbidden),
- None => Err(AppError::NotFound("Étiquette introuvable".into())),
+ None => Err(AppError::NotFound("Label not found".into())),
}
}
@@ -123,7 +123,7 @@ pub async fn create(
dto.validate().map_err(|e| AppError::Validation(e.to_string()))?;
let name = dto.name.trim();
if name.is_empty() {
- return Err(AppError::Validation("Nom vide".into()));
+ return Err(AppError::Validation("Name is empty".into()));
}
let color = normalized_color(dto.color.as_deref())?;
@@ -198,7 +198,7 @@ pub async fn update(
)
.await?;
if affected == 0 {
- return Err(AppError::NotFound("Étiquette introuvable".into()));
+ return Err(AppError::NotFound("Label not found".into()));
}
let label = state
.db
@@ -513,7 +513,7 @@ pub async fn list_links(
Path(id): Path,
) -> Result, AppError> {
if access(&state.db, user.id, id).await?.is_none() {
- return Err(AppError::NotFound("Étiquette introuvable".into()));
+ return Err(AppError::NotFound("Label not found".into()));
}
// Portable `label_access` derived table (see `database::compat`). It takes
// `$1..$3` (the user id, thrice); `$4` is the label id and `$5` the owner
@@ -554,7 +554,7 @@ pub async fn remove_link(
)
.await?;
if res == 0 {
- return Err(AppError::NotFound("Lien introuvable".into()));
+ return Err(AppError::NotFound("Link not found".into()));
}
Ok(Json(json!({ "ok": true })))
}
@@ -614,12 +614,12 @@ pub async fn set_shares(
params![id],
)
.await?
- .ok_or_else(|| AppError::NotFound("Étiquette introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Label not found".into()))?;
for s in &dto.shares {
if s.user_id.is_some() == s.group_id.is_some() {
return Err(AppError::Validation(
- "Chaque partage vise soit un utilisateur, soit un groupe".into(),
+ "Each share must target either a user or a group".into(),
));
}
}
@@ -656,7 +656,7 @@ pub async fn set_shares(
.await
.map_err(|e| {
tracing::error!(label_id = %id, error = %e, "insertion d'un partage d'étiquette");
- AppError::Validation("Destinataire inconnu".into())
+ AppError::Validation("Unknown recipient".into())
})?;
kept += 1;
}
diff --git a/server/src/handlers/me_export.rs b/server/src/handlers/me_export.rs
index ed613976..82fb7343 100644
--- a/server/src/handlers/me_export.rs
+++ b/server/src/handlers/me_export.rs
@@ -105,7 +105,7 @@ async fn gate(state: &AppState, user_id: Uuid) -> Result<(), AppError> {
if policy::self_service_enabled(&state.db, user_id).await {
return Ok(());
}
- Err(AppError::NotFound("Ressource introuvable".into()))
+ Err(AppError::NotFound("Resource not found".into()))
}
/// The denormalised name the archive and the history keep.
@@ -258,12 +258,12 @@ pub async fn request_my_export(
// ── Validation, before anything is read from the database ───────────────
if dto.services.len() > MAX_SERVICES {
return Err(AppError::Validation(
- "Trop de services demandés dans une seule requête".into(),
+ "Too many services requested in a single request".into(),
));
}
if dto.services.iter().any(|s| s.len() > MAX_SERVICE_ID) {
return Err(AppError::Validation(
- "Identifiant de service invalide".into(),
+ "Invalid service identifier".into(),
));
}
@@ -274,8 +274,7 @@ pub async fn request_my_export(
// whatever happens; this exists so the ordinary case gets a sentence.
if let Some(run) = runs::active_for_user(&state.db, user.id).await? {
return Err(AppError::Conflict(format!(
- "Une demande est déjà en cours depuis le {}. Attendez qu'elle se termine \
- avant d'en faire une nouvelle.",
+ "A request has been in progress since {}. Wait for it to finish before submitting another.",
run.requested_at.format("%d/%m/%Y %H:%M UTC")
)));
}
@@ -367,7 +366,7 @@ pub async fn request_my_export(
let job_id = jobs::enqueue_run(&state.db, export_id).await?;
Ok(Json(json!({
- "message": "Demande enregistrée",
+ "message": "Request saved",
"export_id": export_id,
"job_id": job_id,
"services": services,
@@ -431,32 +430,32 @@ pub async fn download_my_export(
// Somebody else's export - administrative or personal - is simply not found
// here. Not "forbidden": from this route's point of view it does not exist.
let Some(run) = runs::get_own(&state.db, id, user.id).await? else {
- return Err(AppError::NotFound("Archive introuvable".into()));
+ return Err(AppError::NotFound("Archive not found".into()));
};
let now = Utc::now();
if run.status != "ready" {
- return Err(AppError::Conflict("Cette archive n'est pas prête".into()));
+ return Err(AppError::Conflict("This archive is not ready".into()));
}
if run.file_deleted {
return Err(AppError::NotFound(
- "Cette archive a été supprimée du serveur".into(),
+ "This archive has been deleted from the server".into(),
));
}
if now < run.available_at {
return Err(AppError::Conflict(format!(
- "Cette archive sera disponible à partir du {}",
+ "This archive will be available from {}",
run.available_at.format("%d/%m/%Y %H:%M UTC")
)));
}
if now >= run.expires_at {
return Err(AppError::NotFound(
- "Cette archive a expiré. Demandez-en une nouvelle.".into(),
+ "This archive has expired. Request a new one.".into(),
));
}
if run.download_exhausted() {
return Err(AppError::Conflict(
- "Cette archive a atteint son nombre de téléchargements. Demandez-en une nouvelle."
+ "This archive has reached its download limit. Request a new one."
.into(),
));
}
@@ -464,13 +463,13 @@ pub async fn download_my_export(
let (Some(destination), Some(file_name)) =
(run.destination.as_deref(), run.file_name.as_deref())
else {
- return Err(AppError::NotFound("Archive introuvable sur le disque".into()));
+ return Err(AppError::NotFound("Archive not found on disk".into()));
};
// Re-validated even though it came from our own row: this is the one handler
// here that turns a database string into an open file descriptor.
if !archive::is_export_file(file_name) {
tracing::error!(export_id = %id, "export: nom d'archive non reconnu - téléchargement refusé");
- return Err(AppError::NotFound("Archive introuvable sur le disque".into()));
+ return Err(AppError::NotFound("Archive not found on disk".into()));
}
let path = std::path::Path::new(destination).join(file_name);
@@ -478,7 +477,7 @@ pub async fn download_my_export(
// must not cost the person one of their downloads.
let file = tokio::fs::File::open(&path).await.map_err(|e| {
tracing::error!(error = %e, export_id = %id, "export: ouverture de l'archive impossible");
- AppError::NotFound("Archive introuvable sur le disque".into())
+ AppError::NotFound("Archive not found on disk".into())
})?;
// The ceiling, claimed atomically. `None` means another request took the last
@@ -486,7 +485,7 @@ pub async fn download_my_export(
// would lose.
let Some(left) = runs::claim_download(&state.db, id, user.id).await? else {
return Err(AppError::Conflict(
- "Cette archive a atteint son nombre de téléchargements. Demandez-en une nouvelle."
+ "This archive has reached its download limit. Request a new one."
.into(),
));
};
diff --git a/server/src/handlers/modules/mod.rs b/server/src/handlers/modules/mod.rs
index b6096fbc..809aa8e7 100644
--- a/server/src/handlers/modules/mod.rs
+++ b/server/src/handlers/modules/mod.rs
@@ -292,10 +292,10 @@ mod tests {
#[test]
fn rejects_empty_or_duplicate_group_id() {
let err = validate_setting_groups("mail", &[group("")], &[]).unwrap_err();
- assert!(matches!(err, AppError::Validation(ref m) if m.contains("id vide")));
+ assert!(matches!(err, AppError::Validation(ref m) if m.contains("empty ID")));
let err = validate_setting_groups("mail", &[group("a"), group("a")], &[]).unwrap_err();
- assert!(matches!(err, AppError::Validation(ref m) if m.contains("deux fois")));
+ assert!(matches!(err, AppError::Validation(ref m) if m.contains("twice")));
let long = "a".repeat(MAX_GROUP_ID_LEN + 1);
assert!(validate_setting_groups("mail", &[group(&long)], &[]).is_err());
@@ -306,7 +306,7 @@ mod tests {
let mut blank = group("services");
blank.label = " ".into();
let err = validate_setting_groups("mail", &[blank], &[]).unwrap_err();
- assert!(matches!(err, AppError::Validation(ref m) if m.contains("libellé")));
+ assert!(matches!(err, AppError::Validation(ref m) if m.contains("label")));
let mut no_icon = group("services");
no_icon.icon = Some(" ".into());
@@ -391,7 +391,7 @@ mod tests {
d.min = Some(100);
d.max = Some(10);
let err = validate_settings_schema("mail", &[d]).unwrap_err();
- assert!(matches!(err, AppError::Validation(ref m) if m.contains("supérieur à max")));
+ assert!(matches!(err, AppError::Validation(ref m) if m.contains("greater than max")));
}
#[test]
diff --git a/server/src/handlers/modules/registration.rs b/server/src/handlers/modules/registration.rs
index b6226433..99a63a1f 100644
--- a/server/src/handlers/modules/registration.rs
+++ b/server/src/handlers/modules/registration.rs
@@ -77,7 +77,7 @@ pub struct RegisterModuleDto {
/// One page of a module's administration surface.
fn validate_module_id(id: &str) -> Result<(), AppError> {
if id.is_empty() || id.len() > 50 {
- return Err(AppError::Validation("module_id: 1-50 caractères".into()));
+ return Err(AppError::Validation("module_id: 1-50 characters".into()));
}
if !id.chars().all(|c| c.is_ascii_alphanumeric() || c == '-' || c == '_') {
return Err(AppError::Validation(
@@ -86,7 +86,7 @@ fn validate_module_id(id: &str) -> Result<(), AppError> {
}
if RESERVED_MODULE_IDS.contains(&id) {
return Err(AppError::Validation(format!(
- "L'identifiant '{id}' est réservé par le core"
+ "Identifier '{id}' is reserved by the core"
)));
}
Ok(())
@@ -358,7 +358,7 @@ pub async fn register_module(
tokio::spawn(async move { crate::handlers::theme_mirror::sync(&st).await });
}
- Ok((StatusCode::CREATED, Json(json!({ "message": "Module enregistré" }))))
+ Ok((StatusCode::CREATED, Json(json!({ "message": "Module registered" }))))
}
/// GET /api/v1/modules/:module/config
@@ -505,7 +505,7 @@ pub async fn module_heartbeat(
if found {
Ok(Json(json!({ "ok": true })))
} else {
- Err(AppError::NotFound(format!("Module '{module_id}' non enregistré")))
+ Err(AppError::NotFound(format!("Module '{module_id}' is not registered")))
}
}
@@ -518,5 +518,5 @@ pub async fn unregister_module(
state.modules.write().await.unregister(&module_id);
crate::modules::manager::mark_stopped(&state.db, &module_id).await?;
state.events.publish(AppEvent::ModuleUnregistered { module_id });
- Ok(Json(json!({ "message": "Module désenregistré" })))
+ Ok(Json(json!({ "message": "Module unregistered" })))
}
diff --git a/server/src/handlers/modules/settings_schema.rs b/server/src/handlers/modules/settings_schema.rs
index ddb069c9..715a1d52 100644
--- a/server/src/handlers/modules/settings_schema.rs
+++ b/server/src/handlers/modules/settings_schema.rs
@@ -129,7 +129,7 @@ impl SettingDef {
};
let Some(n) = n else {
return Err(AppError::Validation(format!(
- "'{}' attend un entier",
+ "'{}' expects an integer",
self.key
)));
};
@@ -137,14 +137,14 @@ impl SettingDef {
if let Some(min) = self.min {
if n < min {
return Err(AppError::Validation(format!(
- "'{label}' doit être supérieur ou égal à {min}"
+ "'{label}' must be greater than or equal to {min}"
)));
}
}
if let Some(max) = self.max {
if n > max {
return Err(AppError::Validation(format!(
- "'{label}' doit être inférieur ou égal à {max}"
+ "'{label}' must be less than or equal to {max}"
)));
}
}
@@ -172,7 +172,7 @@ pub fn validate_settings_schema(module_id: &str, defs: &[SettingDef]) -> Result<
if let Some(risk) = &def.risk {
if !VALID_RISKS.contains(&risk.as_str()) {
return Err(AppError::Validation(format!(
- "{where_}: risk '{risk}' inconnu (attendu : info, warning ou danger)"
+ "{where_}: unknown risk '{risk}' (expected: info, warning, or danger)"
)));
}
}
@@ -180,14 +180,14 @@ pub fn validate_settings_schema(module_id: &str, defs: &[SettingDef]) -> Result<
if def.min.is_some() || def.max.is_some() {
if def.value_type != "int" {
return Err(AppError::Validation(format!(
- "{where_}: min/max ne s'appliquent qu'à type = \"int\" (ici \"{}\")",
+ "{where_}: min/max only apply to type = \"int\" (received \"{}\")",
def.value_type
)));
}
if let (Some(min), Some(max)) = (def.min, def.max) {
if min > max {
return Err(AppError::Validation(format!(
- "{where_}: min ({min}) est supérieur à max ({max})"
+ "{where_}: min ({min}) is greater than max ({max})"
)));
}
}
@@ -195,7 +195,7 @@ pub fn validate_settings_schema(module_id: &str, defs: &[SettingDef]) -> Result<
if def.multiline && def.value_type != "string" {
return Err(AppError::Validation(format!(
- "{where_}: multiline ne s'applique qu'à type = \"string\" (ici \"{}\")",
+ "{where_}: multiline only applies to type = \"string\" (received \"{}\")",
def.value_type
)));
}
@@ -203,20 +203,19 @@ pub fn validate_settings_schema(module_id: &str, defs: &[SettingDef]) -> Result<
if let Some(parent) = &def.depends_on {
if parent.trim().is_empty() {
return Err(AppError::Validation(format!(
- "{where_}: depends_on est vide"
+ "{where_}: depends_on is empty"
)));
}
if parent == &def.key {
return Err(AppError::Validation(format!(
- "{where_}: depends_on se référence lui-même"
+ "{where_}: depends_on references itself"
)));
}
// Resolved against this manifest on purpose: a typo would otherwise
// hide the setting for good, with nothing to point at.
if !bool_keys.contains(parent.as_str()) {
return Err(AppError::Validation(format!(
- "{where_}: depends_on = '{parent}' ne désigne aucun réglage \
- booléen déclaré par ce module"
+ "{where_}: depends_on = '{parent}' does not name a boolean setting declared by this module"
)));
}
}
@@ -249,12 +248,12 @@ pub fn validate_setting_groups(
let id = g.id.as_str();
if id.is_empty() {
return Err(AppError::Validation(format!(
- "{module_id}: un groupe de réglages a un id vide"
+ "{module_id}: a settings group has an empty ID"
)));
}
if id.len() > MAX_GROUP_ID_LEN {
return Err(AppError::Validation(format!(
- "{module_id}: l'id de groupe '{id}' dépasse {MAX_GROUP_ID_LEN} caractères"
+ "{module_id}: group ID '{id}' exceeds {MAX_GROUP_ID_LEN} characters"
)));
}
if !id
@@ -262,24 +261,23 @@ pub fn validate_setting_groups(
.all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '-')
{
return Err(AppError::Validation(format!(
- "{module_id}: l'id de groupe '{id}' n'est pas un slug d'URL \
- (minuscules, chiffres et tirets uniquement)"
+ "{module_id}: group ID '{id}' is not a URL slug (only lowercase letters, numbers, and hyphens)"
)));
}
if !seen.insert(id) {
return Err(AppError::Validation(format!(
- "{module_id}: l'id de groupe '{id}' est déclaré deux fois"
+ "{module_id}: group ID '{id}' is declared twice"
)));
}
if g.label.trim().is_empty() {
return Err(AppError::Validation(format!(
- "{module_id}: le groupe '{id}' n'a pas de libellé"
+ "{module_id}: group '{id}' has no label"
)));
}
if let Some(icon) = &g.icon {
if icon.trim().is_empty() {
return Err(AppError::Validation(format!(
- "{module_id}: le groupe '{id}' déclare une icône vide"
+ "{module_id}: group '{id}' declares an empty icon"
)));
}
}
@@ -289,8 +287,7 @@ pub fn validate_setting_groups(
let Some(group) = &def.group else { continue };
if !seen.contains(group.as_str()) {
return Err(AppError::Validation(format!(
- "{module_id}.{}: group = '{group}' ne désigne aucun \
- [[setting_groups]] déclaré par ce module",
+ "{module_id}.{}: group = '{group}' does not name a [[setting_groups]] declared by this module",
def.key
)));
}
diff --git a/server/src/handlers/push.rs b/server/src/handlers/push.rs
index 28a2bf87..ca70f629 100644
--- a/server/src/handlers/push.rs
+++ b/server/src/handlers/push.rs
@@ -26,10 +26,10 @@ pub async fn register_device(
Json(dto): Json,
) -> Result, AppError> {
if !matches!(dto.provider.as_str(), "unifiedpush" | "apns" | "fcm") {
- return Err(AppError::Validation("provider inconnu".into()));
+ return Err(AppError::Validation("Unknown provider".into()));
}
if dto.device_token.trim().is_empty() {
- return Err(AppError::Validation("device_token requis".into()));
+ return Err(AppError::Validation("device_token is required".into()));
}
// Re-registering the same (provider, token) re-binds it to this user.
@@ -102,9 +102,9 @@ pub async fn delete_device(
.await?;
if affected == 0 {
- return Err(AppError::NotFound("Device introuvable".into()));
+ return Err(AppError::NotFound("Device not found".into()));
}
- Ok(Json(json!({ "message": "Device supprimé" })))
+ Ok(Json(json!({ "message": "Device removed" })))
}
/// GET /api/v1/me/push/preferences - list opt-out preferences.
@@ -160,5 +160,5 @@ pub async fn set_preference(
.execute(&sql, params![user.id, &module_id, &event_type, dto.enabled])
.await?;
- Ok(Json(json!({ "message": "Préférence enregistrée" })))
+ Ok(Json(json!({ "message": "Preference saved" })))
}
diff --git a/server/src/handlers/storage_mounts.rs b/server/src/handlers/storage_mounts.rs
index 8c01d497..f97364ad 100644
--- a/server/src/handlers/storage_mounts.rs
+++ b/server/src/handlers/storage_mounts.rs
@@ -24,7 +24,7 @@ use crate::{
///
/// This used to collapse every variant into `Internal`, so an unreachable NAS,
/// a renamed directory and credentials that can no longer be decrypted all came
-/// back as the same bare 500 "Erreur interne" - and the last of those is the
+/// back as the same bare 500 "Internal error" - and the last of those is the
/// only one the user can actually do something about.
fn remote_err(e: RemoteError) -> AppError {
match e {
@@ -151,7 +151,7 @@ pub async fn create(
Json(dto): Json,
) -> Result<(StatusCode, Json), AppError> {
if dto.name.trim().is_empty() {
- return Err(AppError::Validation("Nom requis".into()));
+ return Err(AppError::Validation("Name required".into()));
}
let mount_name = dto.name.to_lowercase().chars()
.map(|c| if c.is_alphanumeric() || c == '-' { c } else { '-' })
@@ -255,7 +255,7 @@ pub async fn smb_shares(
) -> Result, AppError> {
let host = dto.host.trim();
if host.is_empty() {
- return Err(AppError::Validation("Hôte requis".into()));
+ return Err(AppError::Validation("Host required".into()));
}
// The edit form never holds the password (write-only), so fall back to the
@@ -319,7 +319,7 @@ pub async fn update(
let provider = row.0;
let name = match dto.name.as_deref().map(str::trim) {
- Some("") => return Err(AppError::Validation("Nom requis".into())),
+ Some("") => return Err(AppError::Validation("Name required".into())),
other => other,
};
diff --git a/server/src/handlers/storage_usage.rs b/server/src/handlers/storage_usage.rs
index 850d1889..175e8b97 100644
--- a/server/src/handlers/storage_usage.rs
+++ b/server/src/handlers/storage_usage.rs
@@ -78,7 +78,7 @@ fn declaring_module(
// Unidentified caller naming nobody: there is no identity to fall back
// on, and guessing one would attribute bytes at random.
(None, None) => Err(AppError::Validation(
- "module_id requis : l'appelant n'est pas identifié par son secret interne".into(),
+ "module_id is required: the caller was not identified by its internal secret".into(),
)),
}
}
diff --git a/server/src/handlers/themes.rs b/server/src/handlers/themes.rs
index 063b7f79..ccddb1f9 100644
--- a/server/src/handlers/themes.rs
+++ b/server/src/handlers/themes.rs
@@ -110,7 +110,7 @@ fn is_valid_theme_id(id: &str) -> bool {
fn theme_file_path(themes_dir: &str, id: &str) -> Result {
if !is_valid_theme_id(id) {
return Err(AppError::Validation(
- "ID de thème invalide (caractères autorisés : a-z, 0-9, -, _)".into(),
+ "Invalid theme ID (allowed characters: a-z, 0-9, -, _)".into(),
));
}
Ok(format!("{}/{}.json", themes_dir, id))
@@ -120,7 +120,7 @@ fn theme_file_path(themes_dir: &str, id: &str) -> Result {
fn theme_dir_path(themes_dir: &str, id: &str) -> Result {
if !is_valid_theme_id(id) {
return Err(AppError::Validation(
- "ID de thème invalide (caractères autorisés : a-z, 0-9, -, _)".into(),
+ "Invalid theme ID (allowed characters: a-z, 0-9, -, _)".into(),
));
}
Ok(std::path::Path::new(themes_dir).join(id))
@@ -191,15 +191,15 @@ pub async fn create_theme(
ctx.require(keys::THEMES_MANAGE)?;
if BUILTIN_IDS.contains(&theme.id.as_str()) {
return Err(AppError::Validation(
- "Impossible de remplacer un thème livré avec l'application".into(),
+ "Cannot replace a theme bundled with the application".into(),
));
}
if theme.name.trim().is_empty() {
- return Err(AppError::Validation("Le thème doit avoir un nom".into()));
+ return Err(AppError::Validation("The theme must have a name".into()));
}
if theme.vars.is_empty() {
return Err(AppError::Validation(
- "Le thème doit contenir des variables de couleur".into(),
+ "The theme must contain color variables".into(),
));
}
@@ -258,16 +258,16 @@ pub async fn import_theme_zip(
while let Some(field) = multipart
.next_field()
.await
- .map_err(|e| AppError::Validation(format!("Champ invalide : {e}")))?
+ .map_err(|e| AppError::Validation(format!("Invalid field: {e}")))?
{
if field.name() == Some("file") {
let data = field
.bytes()
.await
- .map_err(|e| AppError::Validation(format!("Lecture du fichier : {e}")))?;
+ .map_err(|e| AppError::Validation(format!("Reading file: {e}")))?;
if data.len() > MAX_ZIP_BYTES {
return Err(AppError::Validation(format!(
- "L'archive ne doit pas dépasser {} Mo",
+ "The archive must not exceed {} MB",
MAX_ZIP_BYTES / (1024 * 1024)
)));
}
@@ -276,7 +276,7 @@ pub async fn import_theme_zip(
}
let zip_bytes =
- zip_bytes.ok_or_else(|| AppError::Validation("Champ 'file' (archive .zip) manquant".into()))?;
+ zip_bytes.ok_or_else(|| AppError::Validation("Missing 'file' field (.zip archive)".into()))?;
let themes_dir = state.settings.server.themes_dir.clone();
// The `zip` crate is synchronous and extraction touches the filesystem - run
@@ -331,7 +331,7 @@ fn extract_theme_zip(zip_bytes: Vec, themes_dir: &str) -> Result, themes_dir: &str) -> Result p,
- None => return Err("Nom de fichier non sûr dans l'archive".into()),
+ None => return Err("Unsafe file name in archive".into()),
};
let ext = rel
.extension()
@@ -376,7 +376,7 @@ fn extract_theme_zip(zip_bytes: Vec, themes_dir: &str) -> Result MAX_FILE_UNCOMPRESSED {
@@ -384,16 +384,16 @@ fn extract_theme_zip(zip_bytes: Vec, themes_dir: &str) -> Result MAX_TOTAL_UNCOMPRESSED {
- return Err("Archive décompressée trop volumineuse".into());
+ return Err("Uncompressed archive is too large".into());
}
let out_path = dest.join(&rel);
if let Some(parent) = out_path.parent() {
std::fs::create_dir_all(parent)
- .map_err(|e| format!("Création de dossier : {e}"))?;
+ .map_err(|e| format!("Creating folder: {e}"))?;
}
let mut out = std::fs::File::create(&out_path)
- .map_err(|e| format!("Écriture de {} : {e}", rel.display()))?;
+ .map_err(|e| format!("Writing {}: {e}", rel.display()))?;
std::io::copy(&mut file, &mut out)
.map_err(|e| format!("Copie de {} : {e}", rel.display()))?;
}
@@ -408,7 +408,7 @@ pub async fn serve_theme_asset(
Path((id, asset_path)): Path<(String, String)>,
) -> Result {
if !is_valid_theme_id(&id) {
- return Err(AppError::NotFound("thème".into()));
+ return Err(AppError::NotFound("theme".into()));
}
if asset_path
.split('/')
@@ -463,12 +463,12 @@ pub async fn set_theme_trust(
) -> Result, AppError> {
ctx.require_superuser("approbation d'un thème")?;
if !is_valid_theme_id(&id) {
- return Err(AppError::Validation("ID de thème invalide".into()));
+ return Err(AppError::Validation("Invalid theme ID".into()));
}
if BUILTIN_IDS.contains(&id.as_str()) {
// Built-ins carry no scripts - nothing to trust.
return Err(AppError::Validation(
- "Les thèmes intégrés n'exécutent aucun script".into(),
+ "Built-in themes do not run scripts".into(),
));
}
@@ -546,7 +546,7 @@ pub async fn delete_theme(
}
if !removed {
- return Err(AppError::NotFound(format!("Thème '{id}' introuvable")));
+ return Err(AppError::NotFound(format!("Theme '{id}' not found")));
}
// Drop it from the trust list as well, so a re-import starts untrusted.
diff --git a/server/src/handlers/users.rs b/server/src/handlers/users.rs
index 149d8bf1..4fccdc04 100644
--- a/server/src/handlers/users.rs
+++ b/server/src/handlers/users.rs
@@ -395,7 +395,7 @@ pub async fn change_password(
.map_err(AppError::Internal)?;
if !ok {
- return Err(AppError::Validation("Ancien mot de passe incorrect".into()));
+ return Err(AppError::Validation("Incorrect current password".into()));
}
// Validate before touching the database: the DTO's own rules (length), plus
@@ -406,7 +406,7 @@ pub async fn change_password(
if dto.new_password == dto.old_password {
return Err(AppError::Validation(
- "Le nouveau mot de passe doit être différent de l'actuel".into(),
+ "The new password must be different from the current password".into(),
));
}
@@ -460,7 +460,7 @@ pub async fn change_password(
// replaced, the proof goes with it.
reauth_store::revoke_all(&state.db, user.id).await;
- Ok(Json(json!({ "message": "Mot de passe mis à jour" })))
+ Ok(Json(json!({ "message": "Password updated" })))
}
/// `GET /api/v1/me/security` - everything the settings page needs to talk about
@@ -536,10 +536,10 @@ pub async fn revoke_session(
.await?;
if affected == 0 {
- return Err(AppError::NotFound("Session introuvable".into()));
+ return Err(AppError::NotFound("Session not found".into()));
}
- Ok(Json(json!({ "message": "Session révoquée" })))
+ Ok(Json(json!({ "message": "Session revoked" })))
}
pub async fn revoke_all_sessions(
@@ -556,7 +556,7 @@ pub async fn revoke_all_sessions(
)
.await?;
- Ok(Json(json!({ "message": "Toutes les sessions révoquées" })))
+ Ok(Json(json!({ "message": "All sessions revoked" })))
}
#[derive(Deserialize)]
@@ -767,7 +767,7 @@ pub async fn user_card(
// opened is not an error the reader can act on, and every module would have
// to render a failure where there is simply nothing to publish.
if !policy.enabled && caller.id != id {
- return Err(AppError::NotFound("Compte introuvable".into()));
+ return Err(AppError::NotFound("Account not found".into()));
}
#[allow(clippy::type_complexity)]
@@ -791,7 +791,7 @@ pub async fn user_card(
let (uid, username, display_name, first_name, last_name, avatar_url, email,
name_pronunciation, pronouns, work_location, introduction, org_unit_id) =
- row.ok_or_else(|| AppError::NotFound("Compte introuvable".into()))?;
+ row.ok_or_else(|| AppError::NotFound("Account not found".into()))?;
// Narrowed directories answer only inside the caller's own unit and its
// sub-units - the same anchor the search uses, so one policy, one meaning.
@@ -813,7 +813,7 @@ pub async fn user_card(
AppError::Database(e)
})?;
if same != Some(true) {
- return Err(AppError::NotFound("Compte introuvable".into()));
+ return Err(AppError::NotFound("Account not found".into()));
}
}
@@ -939,7 +939,7 @@ pub async fn setup_totp(
AuthUser(user): AuthUser,
) -> Result, AppError> {
if user.totp_enabled {
- return Err(AppError::Conflict("La 2FA est déjà activée".into()));
+ return Err(AppError::Conflict("2FA is already enabled".into()));
}
let (secret_base32, uri, encrypted) = totp_auth::generate_secret(
@@ -974,7 +974,7 @@ pub async fn enable_totp(
let encrypted = user
.totp_pending_secret
.as_deref()
- .ok_or_else(|| AppError::Validation("Démarrez d'abord la configuration 2FA".into()))?;
+ .ok_or_else(|| AppError::Validation("Start 2FA setup first".into()))?;
let valid = totp_auth::verify_code(
&state.settings.auth.jwt_secret, encrypted, &dto.code, &user.email,
@@ -982,7 +982,7 @@ pub async fn enable_totp(
.map_err(AppError::Internal)?;
if !valid {
- return Err(AppError::Validation("Code incorrect".into()));
+ return Err(AppError::Validation("Incorrect code".into()));
}
state
@@ -1040,7 +1040,7 @@ pub async fn disable_totp(
let user = proof.user().clone();
if !user.totp_enabled {
- return Err(AppError::Validation("La 2FA n'est pas activée".into()));
+ return Err(AppError::Validation("2FA is not enabled".into()));
}
let encrypted = user
@@ -1054,7 +1054,7 @@ pub async fn disable_totp(
.map_err(AppError::Internal)?;
if !valid {
- return Err(AppError::Validation("Code incorrect".into()));
+ return Err(AppError::Validation("Incorrect code".into()));
}
state
@@ -1118,19 +1118,19 @@ pub async fn upload_avatar(
while let Some(field) = multipart
.next_field()
.await
- .map_err(|e| AppError::Validation(format!("Champ invalide : {e}")))?
+ .map_err(|e| AppError::Validation(format!("Invalid field: {e}")))?
{
let name = field.name().map(|s| s.to_owned());
let content_type = field.content_type().unwrap_or("image/jpeg").to_owned();
match name.as_deref() {
Some("avatar") | Some("original") => {
if !content_type.starts_with("image/") {
- return Err(AppError::Validation("Le fichier doit être une image".into()));
+ return Err(AppError::Validation("The file must be an image".into()));
}
let bytes = field.bytes().await
.map_err(|e| AppError::Validation(format!("Lecture fichier : {e}")))?;
if bytes.len() > 10 * 1024 * 1024 {
- return Err(AppError::Validation("L'image ne doit pas dépasser 10 Mo".into()));
+ return Err(AppError::Validation("The image must not exceed 10 MB".into()));
}
if name.as_deref() == Some("avatar") { data = Some((bytes, content_type)); }
else { original = Some((bytes, content_type)); }
@@ -1139,7 +1139,7 @@ pub async fn upload_avatar(
}
}
- let (bytes, content_type) = data.ok_or_else(|| AppError::Validation("Champ 'avatar' manquant".into()))?;
+ let (bytes, content_type) = data.ok_or_else(|| AppError::Validation("Missing 'avatar' field".into()))?;
let ext = ext_for(&content_type);
let path = format!("avatars/{}.{}", user.id, ext);
@@ -1193,7 +1193,7 @@ pub async fn get_avatar(
.unwrap());
}
}
- Err(AppError::NotFound("Avatar introuvable".into()))
+ Err(AppError::NotFound("Avatar not found".into()))
}
/// GET /api/v1/users/:id/avatar/original - serve l'image originale (pour re-recadrage)
@@ -1212,7 +1212,7 @@ pub async fn get_avatar_original(
.unwrap());
}
}
- Err(AppError::NotFound("Image originale introuvable".into()))
+ Err(AppError::NotFound("Original image not found".into()))
}
/// Largest answer accepted from a remote instance's login route.
@@ -1234,21 +1234,21 @@ pub async fn linked_account_login(
let raw_url = body
.get("instance_url")
.and_then(|v| v.as_str())
- .ok_or_else(|| AppError::Validation("instance_url requis".into()))?;
+ .ok_or_else(|| AppError::Validation("instance_url is required".into()))?;
let login = body.get("email").and_then(|v| v.as_str()).unwrap_or("");
let password = body.get("password").and_then(|v| v.as_str()).unwrap_or("");
if raw_url.len() > 2048 || login.len() > 320 || password.len() > 1024 {
- return Err(AppError::Validation("Données invalides".into()));
+ return Err(AppError::Validation("Invalid data".into()));
}
- let unreachable = || AppError::Validation("Impossible de joindre l'instance".into());
+ let unreachable = || AppError::Validation("Cannot reach the instance".into());
let target = crate::network::outbound::resolve_public_http(raw_url.trim_end_matches('/'))
.await
.map_err(|e| {
tracing::warn!(user_id = %user.id, reason = ?e, "linked account: instance URL refused");
match e {
crate::network::outbound::OutboundError::InvalidUrl => {
- AppError::Validation("URL invalide".into())
+ AppError::Validation("Invalid URL".into())
}
_ => unreachable(),
}
@@ -1386,7 +1386,7 @@ pub async fn internal_get_user(
tracing::error!(error = %e, %id, "annuaire interne : lecture d'un compte impossible");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Compte introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Account not found".into()))?;
Ok(Json(directory_entry(row)))
}
@@ -1527,7 +1527,7 @@ pub async fn internal_provisioning_user(
tracing::error!(error = %e, %id, "provisioning mail : lecture d'un compte impossible");
AppError::Database(e)
})?
- .ok_or_else(|| AppError::NotFound("Compte introuvable".into()))?;
+ .ok_or_else(|| AppError::NotFound("Account not found".into()))?;
Ok(Json(provisioning_entry(row)))
}
diff --git a/server/src/health/checks.rs b/server/src/health/checks.rs
index abbdddbc..a78878c5 100644
--- a/server/src/health/checks.rs
+++ b/server/src/health/checks.rs
@@ -840,7 +840,7 @@ fn instance_locale(f: &Facts) -> Check {
None => Observed::new(
"locale_unknown",
json!({ "locale": raw }),
- format!("'{raw}' - aucune langue livrée"),
+ format!("'{raw}' — not a supported language"),
),
Some(code) if f.instance_locale_chosen => {
Observed::new("locale_chosen", json!({ "locale": code }), code.to_string())
diff --git a/server/src/holidays/model.rs b/server/src/holidays/model.rs
index 8a67bcd6..31af80c7 100644
--- a/server/src/holidays/model.rs
+++ b/server/src/holidays/model.rs
@@ -66,7 +66,7 @@ impl Category {
"observance" => Self::Observance,
other => {
return Err(AppError::Validation(format!(
- "Catégorie « {other} » inconnue"
+ "Unknown category '{other}'"
)))
}
})
@@ -115,7 +115,7 @@ impl Observance {
"saturday_to_friday" => Self::SaturdayToFriday,
other => {
return Err(AppError::Validation(format!(
- "Règle de report « {other} » inconnue"
+ "Unknown observance rule '{other}'"
)))
}
})
@@ -191,7 +191,7 @@ impl Rule {
params
.get(name)
.and_then(Value::as_i64)
- .ok_or_else(|| AppError::Validation(format!("Règle « {kind} » : champ « {name} » manquant")))
+ .ok_or_else(|| AppError::Validation(format!("Rule '{kind}': missing field '{name}'")))
};
match kind {
@@ -210,7 +210,7 @@ impl Rule {
"julian" => EasterBasis::Julian,
other => {
return Err(AppError::Validation(format!(
- "Règle « easter » : base « {other} » inconnue (gregorian ou julian)"
+ "Rule 'easter': unknown base '{other}' (gregorian or julian)"
)))
}
};
@@ -234,14 +234,14 @@ impl Rule {
let raw = params
.get("dates")
.and_then(Value::as_array)
- .ok_or_else(|| AppError::Validation("Règle « dates » : liste manquante".into()))?;
+ .ok_or_else(|| AppError::Validation("Rule 'dates': missing list".into()))?;
let mut dates = Vec::with_capacity(raw.len());
for entry in raw {
let text = entry.as_str().ok_or_else(|| {
- AppError::Validation("Règle « dates » : une date doit être une chaîne AAAA-MM-JJ".into())
+ AppError::Validation("Rule 'dates': each date must be a YYYY-MM-DD string".into())
})?;
dates.push(text.parse::().map_err(|_| {
- AppError::Validation(format!("Date « {text} » invalide (attendu AAAA-MM-JJ)"))
+ AppError::Validation(format!("Invalid date '{text}' (expected YYYY-MM-DD)"))
})?);
}
dates.sort_unstable();
@@ -251,7 +251,7 @@ impl Rule {
Ok(rule)
}
other => Err(AppError::Validation(format!(
- "Type de règle « {other} » inconnu"
+ "Unknown rule type '{other}'"
))),
}
}
@@ -278,7 +278,7 @@ impl Rule {
}
Self::Easter { offset, .. } => {
if !(-400..=400).contains(offset) {
- return bad("Décalage de Pâques hors de portée (±400 jours)".into());
+ return bad("Easter offset out of range (±400 days)".into());
}
Ok(())
}
@@ -290,13 +290,13 @@ impl Rule {
return bad("Jour de la semaine invalide (1 = lundi … 7 = dimanche)".into());
}
if *nth != -1 && !(1..=5).contains(nth) {
- return bad("Rang invalide (1 à 5, ou -1 pour le dernier)".into());
+ return bad("Invalid rank (1 to 5, or -1 for last)".into());
}
Ok(())
}
Self::Dates { dates } => {
if dates.is_empty() {
- return bad("Une règle « dates » doit citer au moins une date".into());
+ return bad("A 'dates' rule must list at least one date".into());
}
Ok(())
}
diff --git a/server/src/holidays/store.rs b/server/src/holidays/store.rs
index 5a7d7e5f..426b7eba 100644
--- a/server/src/holidays/store.rs
+++ b/server/src/holidays/store.rs
@@ -253,7 +253,7 @@ pub async fn calendar(db: &DbPool, id: Uuid) -> Result None,
Ok(Ok(Err(e))) => Some(format!("{e:#}")),
- Ok(Err(_panic)) => Some("Le gestionnaire a paniqué".to_string()),
- Err(_) => Some(format!("Délai d'exécution dépassé ({}s)", timeout.as_secs())),
+ Ok(Err(_panic)) => Some("The handler panicked".to_string()),
+ Err(_) => Some(format!("Execution timed out ({}s)", timeout.as_secs())),
};
let elapsed_ms = started.elapsed().as_millis();
diff --git a/server/src/mailer/send.rs b/server/src/mailer/send.rs
index d9106554..f84d9042 100644
--- a/server/src/mailer/send.rs
+++ b/server/src/mailer/send.rs
@@ -141,7 +141,7 @@ impl lettre::message::header::Header for AutoSubmitted {
/// mail clients read as "prefer the last part they understand".
fn build_message(cfg: &MailConfig, msg: &Outgoing) -> Result {
let from = cfg.from_mailbox().parse().map_err(|e: lettre::address::AddressError| SendError {
- stage: "Adresse d'expédition invalide",
+ stage: "Invalid sender address",
raw: truncate(&e.to_string(), MAX_ERROR_LEN),
})?;
diff --git a/server/src/models/api_token.rs b/server/src/models/api_token.rs
index f2ca0d26..1c3f69ea 100644
--- a/server/src/models/api_token.rs
+++ b/server/src/models/api_token.rs
@@ -35,7 +35,7 @@ pub struct ApiToken {
#[derive(Debug, Deserialize, Validate)]
pub struct CreateApiTokenDto {
- #[validate(length(min = 1, max = 255, message = "Nom: 1-255 caractères"))]
+ #[validate(length(min = 1, max = 255, message = "Name: 1-255 characters"))]
pub name: String,
/// Privilege keys the token may exercise.
diff --git a/server/src/models/clipboard.rs b/server/src/models/clipboard.rs
index 60e9c0bf..499c4cab 100644
--- a/server/src/models/clipboard.rs
+++ b/server/src/models/clipboard.rs
@@ -27,9 +27,9 @@ pub struct ClipboardItem {
/// size cap - a client is never trusted with either.
#[derive(Debug, Deserialize, Validate)]
pub struct PushClipboardDto {
- #[validate(length(min = 1, max = 100, message = "Module: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Module: 1-100 characters"))]
pub module: String,
- #[validate(length(min = 1, max = 100, message = "Type: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Type: 1-100 characters"))]
pub kind: String,
#[validate(length(max = 500))]
pub title: Option,
diff --git a/server/src/models/group.rs b/server/src/models/group.rs
index fff3bd47..b22093c1 100644
--- a/server/src/models/group.rs
+++ b/server/src/models/group.rs
@@ -30,7 +30,7 @@ pub struct UserGroupMember {
#[derive(Debug, Deserialize, Validate)]
pub struct CreateGroupDto {
- #[validate(length(min = 1, max = 100, message = "Nom: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Name: 1-100 characters"))]
pub name: String,
pub description: Option,
#[serde(default)]
@@ -43,7 +43,7 @@ pub struct CreateGroupDto {
#[derive(Debug, Deserialize, Validate)]
pub struct UpdateGroupDto {
- #[validate(length(min = 1, max = 100, message = "Nom: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Name: 1-100 characters"))]
pub name: Option,
pub description: Option,
pub permissions: Option>,
diff --git a/server/src/models/label.rs b/server/src/models/label.rs
index cf478042..a9d47435 100644
--- a/server/src/models/label.rs
+++ b/server/src/models/label.rs
@@ -33,7 +33,7 @@ pub struct LabelLink {
#[derive(Debug, Deserialize, Validate)]
pub struct CreateLabelDto {
- #[validate(length(min = 1, max = 100, message = "Nom: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Name: 1-100 characters"))]
pub name: String,
#[validate(length(max = 20))]
pub color: Option,
@@ -43,7 +43,7 @@ pub struct CreateLabelDto {
#[derive(Debug, Deserialize, Validate)]
pub struct UpdateLabelDto {
- #[validate(length(min = 1, max = 100, message = "Nom: 1-100 caractères"))]
+ #[validate(length(min = 1, max = 100, message = "Name: 1-100 characters"))]
pub name: Option,
#[validate(length(max = 20))]
pub color: Option,
diff --git a/server/src/models/user.rs b/server/src/models/user.rs
index 6e14fa8a..b2aaf4f3 100644
--- a/server/src/models/user.rs
+++ b/server/src/models/user.rs
@@ -162,11 +162,11 @@ pub struct User {
#[derive(Debug, Deserialize, Validate, ToSchema)]
pub struct CreateUserDto {
- #[validate(email(message = "Email invalide"))]
+ #[validate(email(message = "Invalid email address"))]
pub email: String,
- #[validate(length(min = 3, max = 100, message = "Username: 3-100 caractères"))]
+ #[validate(length(min = 3, max = 100, message = "Username: 3-100 characters"))]
pub username: String,
- #[validate(length(min = 8, message = "Mot de passe: 8 caractères minimum"))]
+ #[validate(length(min = 8, message = "Password: minimum 8 characters"))]
pub password: String,
pub display_name: Option,
}
@@ -176,7 +176,7 @@ fn validate_http_url(url: &str) -> Result<(), ValidationError> {
Ok(())
} else {
let mut e = ValidationError::new("url");
- e.message = Some(std::borrow::Cow::Borrowed("L'URL doit utiliser le schéma http ou https"));
+ e.message = Some(std::borrow::Cow::Borrowed("The URL must use the http or https scheme"));
Err(e)
}
}
@@ -262,7 +262,7 @@ fn tidy_text(slot: &mut Option