mirror of
https://github.com/Linkatplug/Gotify-Windows-Basic-Client.git
synced 2026-12-06 08:46:21 +00:00
Gotify Lite 2.1.0 : interface en 5 langues, README en anglais
- Traductions fr/en/nl/de/es (fenêtre, menu de l'icône, notifications), langue de Windows par défaut et choix dans Paramètres → Général - Tests : chaque libellé traduit, espaces réservés cohérents - README en anglais (version française dans README.fr.md), captures anglaises - Notes de version 2.1.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
58ed49188b
commit
b8c3b829c6
17 files changed
+820
-232
No files matched your search
+11
-17
@@ -1,21 +1,15 @@
|
||||
## Gotify Lite 2.0.0 — réécriture complète
|
||||
## Gotify Lite 2.1.0 — now in 5 languages
|
||||
|
||||
Nouveau client, écrit en Rust : **un seul `.exe` (~6 Mo), sans .NET ni installation**.
|
||||
Le service de fond consomme environ 7 Mo de mémoire ; la fenêtre n'est chargée que lorsqu'elle est ouverte.
|
||||
### New
|
||||
- The app is translated into **English, French, Dutch, German and Spanish** (window, tray menu, notifications)
|
||||
- The language follows Windows by default and can be changed in *Settings → General → Language*
|
||||
- English documentation ([README](https://github.com/Linkatplug/Gotify-Windows-Basic-Client#readme)); French version in [README.fr.md](https://github.com/Linkatplug/Gotify-Windows-Basic-Client/blob/master/README.fr.md)
|
||||
|
||||
### Nouveautés
|
||||
- Notifications **natives** Windows (centre de notifications, Ne pas déranger, réglages par appli), avec l'icône de l'application Gotify
|
||||
- Seuils de priorité : ignorer / discret / bannière / persistante
|
||||
- **Silence** (30 min à indéfini), **heures calmes**, coupure par application, seuil qui passe malgré le silence
|
||||
- Reconnexion automatique (y compris après veille) et **rattrapage des messages manqués**
|
||||
- Historique : recherche, filtre par appli, suppression, icônes et images jointes
|
||||
- Démarrage avec Windows, thème Système / Clair / Sombre, taille de fenêtre mémorisée
|
||||
- Dossier des données modifiable avec migration
|
||||
- Token chiffré (DPAPI), TLS natif Windows
|
||||
- Nouveau logo
|
||||
### Install
|
||||
Download `gotify-lite.exe` below and run it. To update, quit Gotify Lite from the tray icon and replace the executable: your settings are kept.
|
||||
The executable isn't code-signed: SmartScreen may ask you to click *More info → Run anyway*.
|
||||
You need a Gotify **client** token (Clients → Create client).
|
||||
|
||||
### Installation
|
||||
Téléchargez `gotify-lite.exe` ci-dessous et lancez-le. L'exécutable n'est pas signé : SmartScreen peut demander
|
||||
*Informations complémentaires → Exécuter quand même*. Il vous faut un token **client** Gotify (Clients → Créer un client).
|
||||
---
|
||||
|
||||
Les réglages de la v1 ne sont pas repris : saisissez de nouveau l'URL et le token.
|
||||
**Nouveautés (FR)** : l'application est traduite en anglais, français, néerlandais, allemand et espagnol ; la langue suit Windows et se change dans *Paramètres → Général → Langue*. Pour mettre à jour, quittez Gotify Lite et remplacez l'exécutable : vos réglages sont conservés.
|
||||
Generated
+1
-1
@@ -1255,7 +1255,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gotify-lite"
|
||||
version = "2.0.0"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"eframe",
|
||||
"image",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "gotify-lite"
|
||||
version = "2.0.0"
|
||||
version = "2.1.0"
|
||||
edition = "2024"
|
||||
description = "Client Gotify léger pour Windows (tray + notifications natives)"
|
||||
license = "MIT"
|
||||
@@ -17,7 +17,7 @@ ureq = { version = "3", default-features = false, features = ["native-tls", "gzi
|
||||
windows = { version = "0.61", features = [
|
||||
"Win32_Foundation", "Win32_System_Registry", "Win32_Security_Cryptography",
|
||||
"Win32_System_Threading", "Win32_UI_WindowsAndMessaging", "Win32_UI_Shell",
|
||||
"Win32_System_LibraryLoader", "Win32_System_Com", "Win32_UI_Shell_Common", "Win32_System_DataExchange", "Win32_System_Memory", "Win32_System_SystemInformation", "UI_Notifications", "Data_Xml_Dom", "Foundation",
|
||||
"Win32_System_LibraryLoader", "Win32_Globalization", "Win32_System_Com", "Win32_UI_Shell_Common", "Win32_System_DataExchange", "Win32_System_Memory", "Win32_System_SystemInformation", "UI_Notifications", "Data_Xml_Dom", "Foundation",
|
||||
] }
|
||||
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp", "ico", "bmp"] }
|
||||
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<p align="center">
|
||||
<img src="docs/logo.png" width="120" alt="Gotify Lite">
|
||||
</p>
|
||||
|
||||
<h1 align="center">Gotify Lite</h1>
|
||||
|
||||
<p align="center"><a href="README.md">English</a> · <b>Français</b></p>
|
||||
|
||||
<p align="center">
|
||||
Client <a href="https://gotify.net">Gotify</a> léger pour Windows 10/11 : icône dans la zone de notification,
|
||||
notifications <b>natives</b> Windows, historique des messages, mode silence, thème clair/sombre.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest"><b>⬇ Télécharger gotify-lite.exe</b></a>
|
||||
</p>
|
||||
|
||||
Un seul `.exe` d'environ 6 Mo, **sans installation ni runtime** (ni .NET ni Python).
|
||||
|
||||
| Messages | Paramètres |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|
||||
## Léger
|
||||
|
||||
| | Mémoire mesurée |
|
||||
|---|---|
|
||||
| Service de fond (icône + connexion temps réel) | **≈ 7 Mo**, ~0 % CPU au repos |
|
||||
| Fenêtre messages/réglages | ≈ 130 Mo, **seulement quand elle est ouverte** |
|
||||
|
||||
La fenêtre tourne dans un processus séparé, lancé au clic sur l'icône et libéré dès sa fermeture.
|
||||
Le service de fond ne charge aucun moteur graphique.
|
||||
|
||||
## Fonctions
|
||||
|
||||
**Réception**
|
||||
- Temps réel par WebSocket, reconnexion automatique (1 s → 60 s) et après une sortie de veille.
|
||||
- Messages manqués pendant une coupure notifiés à la reconnexion (résumé au-delà de 3).
|
||||
|
||||
**Notifications Windows natives**
|
||||
- Centre de notifications, *Ne pas déranger*, réglages par appli dans *Paramètres → Système → Notifications → Gotify Lite*.
|
||||
- Icône de l'application Gotify d'origine ; clic → ouvre l'URL `client::notification.click.url` (http/https) ou la fenêtre.
|
||||
- Priorités : ignorer en dessous de *N*, bannière à partir de *N* (sinon discret dans le centre de notifications),
|
||||
notification persistante à partir de *N*.
|
||||
- Bouton « Envoyer une notification de test ».
|
||||
|
||||
**Silence**
|
||||
- 30 min / 1 h / 4 h / jusqu'à demain 8 h / indéfiniment, depuis le menu de l'icône ou les réglages.
|
||||
- Heures calmes quotidiennes, et seuil de priorité qui passe malgré le silence.
|
||||
- Couper une application Gotify précise (clic droit dans la liste, ou réglages).
|
||||
- L'icône change d'aspect : couleur = connecté, gris = déconnecté, pastille orange = silence.
|
||||
|
||||
**Fenêtre**
|
||||
- Historique : recherche, filtre par appli, suppression d'un message, d'une appli ou de tout (sur le serveur).
|
||||
- Icônes des applications et images jointes (`client::notification.bigImageUrl`), désactivables.
|
||||
- Interface en français, anglais, néerlandais, allemand et espagnol (langue de Windows par défaut, modifiable dans *Paramètres → Général*).
|
||||
- Thème Système / Clair / Sombre ; taille, position et état maximisé mémorisés.
|
||||
- Coller (Ctrl+V ou bouton 📋) l'URL et le token.
|
||||
|
||||
**Système**
|
||||
- Démarrage avec Windows (sans droits admin).
|
||||
- Dossier des données modifiable, avec migration automatique des fichiers existants.
|
||||
- Token chiffré avec DPAPI (utilisable uniquement par votre session Windows).
|
||||
- TLS natif Windows (SChannel) : les autorités de certification installées dans Windows sont reconnues.
|
||||
- Signale quand Windows bloque les notifications, avec un bouton vers le bon réglage.
|
||||
|
||||
## Démarrer
|
||||
|
||||
1. Téléchargez [`gotify-lite.exe`](https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest)
|
||||
et placez-le où vous voulez (par ex. `%LOCALAPPDATA%\Programs\GotifyLite\`).
|
||||
L'exécutable n'est pas signé : au premier lancement, Windows SmartScreen peut demander
|
||||
*Informations complémentaires → Exécuter quand même*.
|
||||
2. Lancez-le : les réglages s'ouvrent.
|
||||
3. Dans l'interface web Gotify : **Clients → Créer un client**, copiez le token (*client*, pas *application*).
|
||||
4. Collez l'URL et le token, puis **Enregistrer et connecter**. Cochez *Lancer au démarrage de Windows* si besoin.
|
||||
|
||||
Clic gauche sur l'icône : fenêtre. Clic droit : silence, activer/désactiver, paramètres, reconnecter, quitter.
|
||||
|
||||
### Données
|
||||
|
||||
Par défaut : `%APPDATA%\GotifyLite\config.json` (réglages) et `%LOCALAPPDATA%\GotifyLite\`
|
||||
(état, icônes, journal, fenêtre). Un dossier personnalisé (*Paramètres → Dossier des données*) regroupe tout.
|
||||
|
||||
### Désinstaller
|
||||
|
||||
Décochez *Lancer au démarrage de Windows*, quittez depuis l'icône, puis supprimez l'exécutable et le dossier des données.
|
||||
|
||||
## Compiler
|
||||
|
||||
Prérequis : [Rust](https://rustup.rs) (stable, cible MSVC).
|
||||
|
||||
```powershell
|
||||
cargo build --release # target\release\gotify-lite.exe
|
||||
cargo test
|
||||
```
|
||||
|
||||
Chaque étiquette `v*` poussée déclenche la GitHub Action qui compile et publie l'exécutable dans une release.
|
||||
|
||||
## Architecture
|
||||
|
||||
| Fichier | Rôle |
|
||||
|---|---|
|
||||
| `src/daemon.rs` | Icône, menu, boucle Win32, thread WebSocket, rattrapage |
|
||||
| `src/ui.rs` | Fenêtre egui (messages + réglages) |
|
||||
| `src/gotify.rs` | API REST (ureq) + flux WebSocket (tungstenite) |
|
||||
| `src/notify.rs` | Notifications toast WinRT |
|
||||
| `src/config.rs` | Réglages + règle de décision (`Config::decide`) |
|
||||
| `src/sys.rs` | Registre, DPAPI, dossier des données, instance unique, dates |
|
||||
| `src/i18n.rs` | Traductions (fr, en, nl, de, es) et détection de la langue |
|
||||
| `src/icon.rs` | Icônes incluses dans le binaire |
|
||||
| `build.rs` | Génère les icônes (zone de notification, fenêtre, .ico) depuis `assets/logo.jpg` |
|
||||
|
||||
## Historique
|
||||
|
||||
La version 1 (C# / WPF) est disponible dans l'historique git et les anciennes releases.
|
||||
La version 2 est une réécriture complète en Rust.
|
||||
|
||||
## Licence
|
||||
|
||||
MIT
|
||||
@@ -4,113 +4,124 @@
|
||||
|
||||
<h1 align="center">Gotify Lite</h1>
|
||||
|
||||
<p align="center"><b>English</b> · <a href="README.fr.md">Français</a></p>
|
||||
|
||||
<p align="center">
|
||||
Client <a href="https://gotify.net">Gotify</a> léger pour Windows 10/11 : icône dans la zone de notification,
|
||||
notifications <b>natives</b> Windows, historique des messages, mode silence, thème clair/sombre.
|
||||
A lightweight <a href="https://gotify.net">Gotify</a> client for Windows 10/11: system tray icon,
|
||||
<b>native</b> Windows notifications, message history, do-not-disturb, light/dark theme.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest"><b>⬇ Télécharger gotify-lite.exe</b></a>
|
||||
<a href="https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest"><b>⬇ Download gotify-lite.exe</b></a>
|
||||
</p>
|
||||
|
||||
Un seul `.exe` d'environ 6 Mo, **sans installation ni runtime** (ni .NET ni Python).
|
||||
A single ~6 MB `.exe`, **no installer and no runtime** (no .NET, no Python).
|
||||
Available in English, French, Dutch, German and Spanish.
|
||||
|
||||
| Messages | Paramètres |
|
||||
| Messages | Settings |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
## Léger
|
||||
## Lightweight
|
||||
|
||||
| | Mémoire mesurée |
|
||||
| | Measured memory |
|
||||
|---|---|
|
||||
| Service de fond (icône + connexion temps réel) | **≈ 7 Mo**, ~0 % CPU au repos |
|
||||
| Fenêtre messages/réglages | ≈ 130 Mo, **seulement quand elle est ouverte** |
|
||||
| Background service (tray icon + real-time connection) | **≈ 7 MB**, ~0% CPU when idle |
|
||||
| Messages/settings window | ≈ 130 MB, **only while it is open** |
|
||||
|
||||
La fenêtre tourne dans un processus séparé, lancé au clic sur l'icône et libéré dès sa fermeture.
|
||||
Le service de fond ne charge aucun moteur graphique.
|
||||
The window runs in a separate process, started when you click the tray icon and released as soon as you close it.
|
||||
The background service doesn't load any graphics engine.
|
||||
|
||||
## Fonctions
|
||||
## Features
|
||||
|
||||
**Réception**
|
||||
- Temps réel par WebSocket, reconnexion automatique (1 s → 60 s) et après une sortie de veille.
|
||||
- Messages manqués pendant une coupure notifiés à la reconnexion (résumé au-delà de 3).
|
||||
**Receiving**
|
||||
- Real-time over WebSocket, automatic reconnection (1 s → 60 s backoff) and after waking from sleep.
|
||||
- Messages missed while offline are notified on reconnect (summarized when there are more than 3).
|
||||
|
||||
**Notifications Windows natives**
|
||||
- Centre de notifications, *Ne pas déranger*, réglages par appli dans *Paramètres → Système → Notifications → Gotify Lite*.
|
||||
- Icône de l'application Gotify d'origine ; clic → ouvre l'URL `client::notification.click.url` (http/https) ou la fenêtre.
|
||||
- Priorités : ignorer en dessous de *N*, bannière à partir de *N* (sinon discret dans le centre de notifications),
|
||||
notification persistante à partir de *N*.
|
||||
- Bouton « Envoyer une notification de test ».
|
||||
**Native Windows notifications**
|
||||
- Notification center, *Do not disturb*, per-app settings in *Settings → System → Notifications → Gotify Lite*.
|
||||
- Shows the originating Gotify application's icon; clicking opens `client::notification.click.url` (http/https) or the window.
|
||||
- Priorities: ignore below *N*, banner from *N* (otherwise silently in the notification center),
|
||||
stays on screen from *N*.
|
||||
- "Send a test notification" button.
|
||||
|
||||
**Silence**
|
||||
- 30 min / 1 h / 4 h / jusqu'à demain 8 h / indéfiniment, depuis le menu de l'icône ou les réglages.
|
||||
- Heures calmes quotidiennes, et seuil de priorité qui passe malgré le silence.
|
||||
- Couper une application Gotify précise (clic droit dans la liste, ou réglages).
|
||||
- L'icône change d'aspect : couleur = connecté, gris = déconnecté, pastille orange = silence.
|
||||
**Do not disturb**
|
||||
- 30 min / 1 h / 4 h / until 8 AM tomorrow / indefinitely, from the tray menu or the settings.
|
||||
- Daily quiet hours, plus a priority threshold that still gets through while muted.
|
||||
- Mute a specific Gotify application (right-click it in the list, or in the settings).
|
||||
- The tray icon reflects the state: colored = connected, grey = disconnected, orange badge = muted.
|
||||
|
||||
**Fenêtre**
|
||||
- Historique : recherche, filtre par appli, suppression d'un message, d'une appli ou de tout (sur le serveur).
|
||||
- Icônes des applications et images jointes (`client::notification.bigImageUrl`), désactivables.
|
||||
- Thème Système / Clair / Sombre ; taille, position et état maximisé mémorisés.
|
||||
- Coller (Ctrl+V ou bouton 📋) l'URL et le token.
|
||||
**Window**
|
||||
- History: search, filter by application, delete a message, an application's messages or everything (on the server).
|
||||
- Application icons and attached images (`client::notification.bigImageUrl`), can be turned off.
|
||||
- Language: follows Windows by default, can be changed in *Settings → General*.
|
||||
- System / Light / Dark theme; size, position and maximized state are remembered.
|
||||
- Paste (Ctrl+V or 📋 button) the URL and the token.
|
||||
|
||||
**Système**
|
||||
- Démarrage avec Windows (sans droits admin).
|
||||
- Dossier des données modifiable, avec migration automatique des fichiers existants.
|
||||
- Token chiffré avec DPAPI (utilisable uniquement par votre session Windows).
|
||||
- TLS natif Windows (SChannel) : les autorités de certification installées dans Windows sont reconnues.
|
||||
- Signale quand Windows bloque les notifications, avec un bouton vers le bon réglage.
|
||||
**System**
|
||||
- Start with Windows (no admin rights needed).
|
||||
- Movable data folder, with automatic migration of existing files.
|
||||
- Token encrypted with DPAPI (only usable by your Windows account).
|
||||
- Native Windows TLS (SChannel): certificate authorities installed in Windows are trusted.
|
||||
- Warns when Windows is blocking notifications, with a button to the right setting.
|
||||
|
||||
## Démarrer
|
||||
## Getting started
|
||||
|
||||
1. Téléchargez [`gotify-lite.exe`](https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest)
|
||||
et placez-le où vous voulez (par ex. `%LOCALAPPDATA%\Programs\GotifyLite\`).
|
||||
L'exécutable n'est pas signé : au premier lancement, Windows SmartScreen peut demander
|
||||
*Informations complémentaires → Exécuter quand même*.
|
||||
2. Lancez-le : les réglages s'ouvrent.
|
||||
3. Dans l'interface web Gotify : **Clients → Créer un client**, copiez le token (*client*, pas *application*).
|
||||
4. Collez l'URL et le token, puis **Enregistrer et connecter**. Cochez *Lancer au démarrage de Windows* si besoin.
|
||||
1. Download [`gotify-lite.exe`](https://github.com/Linkatplug/Gotify-Windows-Basic-Client/releases/latest)
|
||||
and put it wherever you like (e.g. `%LOCALAPPDATA%\Programs\GotifyLite\`).
|
||||
The executable isn't code-signed: on first launch, Windows SmartScreen may ask you to click
|
||||
*More info → Run anyway*.
|
||||
2. Run it: the settings window opens.
|
||||
3. In the Gotify web UI: **Clients → Create client**, then copy its token (a *client* token, not an *application* token).
|
||||
4. Paste the URL and the token, then click **Save and connect**. Check *Start with Windows* if you want.
|
||||
|
||||
Clic gauche sur l'icône : fenêtre. Clic droit : silence, activer/désactiver, paramètres, reconnecter, quitter.
|
||||
Left-click the tray icon: window. Right-click: do not disturb, enable/disable, settings, reconnect, quit.
|
||||
|
||||
### Données
|
||||
### Data
|
||||
|
||||
Par défaut : `%APPDATA%\GotifyLite\config.json` (réglages) et `%LOCALAPPDATA%\GotifyLite\`
|
||||
(état, icônes, journal, fenêtre). Un dossier personnalisé (*Paramètres → Dossier des données*) regroupe tout.
|
||||
By default: `%APPDATA%\GotifyLite\config.json` (settings) and `%LOCALAPPDATA%\GotifyLite\`
|
||||
(state, icons, log, window). A custom folder (*Settings → Data folder*) keeps everything in one place.
|
||||
|
||||
### Désinstaller
|
||||
### Uninstall
|
||||
|
||||
Décochez *Lancer au démarrage de Windows*, quittez depuis l'icône, puis supprimez l'exécutable et le dossier des données.
|
||||
Uncheck *Start with Windows*, quit from the tray icon, then delete the executable and the data folder.
|
||||
|
||||
## Compiler
|
||||
## Building
|
||||
|
||||
Prérequis : [Rust](https://rustup.rs) (stable, cible MSVC).
|
||||
Requirements: [Rust](https://rustup.rs) (stable, MSVC target).
|
||||
|
||||
```powershell
|
||||
cargo build --release # target\release\gotify-lite.exe
|
||||
cargo test
|
||||
```
|
||||
|
||||
Chaque étiquette `v*` poussée déclenche la GitHub Action qui compile et publie l'exécutable dans une release.
|
||||
Every pushed `v*` tag triggers the GitHub Action that builds the executable and publishes it in a release.
|
||||
|
||||
### Translations
|
||||
|
||||
Strings live in `src/i18n.rs`: the French text is the key, followed by its English, Dutch, German and Spanish
|
||||
translations. `cargo test` checks that every string used in the code is translated and that `{}` placeholders match.
|
||||
Corrections and new languages are welcome.
|
||||
|
||||
## Architecture
|
||||
|
||||
| Fichier | Rôle |
|
||||
| File | Role |
|
||||
|---|---|
|
||||
| `src/daemon.rs` | Icône, menu, boucle Win32, thread WebSocket, rattrapage |
|
||||
| `src/ui.rs` | Fenêtre egui (messages + réglages) |
|
||||
| `src/gotify.rs` | API REST (ureq) + flux WebSocket (tungstenite) |
|
||||
| `src/notify.rs` | Notifications toast WinRT |
|
||||
| `src/config.rs` | Réglages + règle de décision (`Config::decide`) |
|
||||
| `src/sys.rs` | Registre, DPAPI, dossier des données, instance unique, dates |
|
||||
| `src/icon.rs` | Icônes incluses dans le binaire |
|
||||
| `build.rs` | Génère les icônes (zone de notification, fenêtre, .ico) depuis `assets/logo.jpg` |
|
||||
| `src/daemon.rs` | Tray icon, menu, Win32 loop, WebSocket thread, catch-up |
|
||||
| `src/ui.rs` | egui window (messages + settings) |
|
||||
| `src/gotify.rs` | REST API (ureq) + WebSocket stream (tungstenite) |
|
||||
| `src/notify.rs` | WinRT toast notifications |
|
||||
| `src/config.rs` | Settings + delivery rules (`Config::decide`) |
|
||||
| `src/i18n.rs` | Translations (fr, en, nl, de, es) and language detection |
|
||||
| `src/sys.rs` | Registry, DPAPI, data folder, single instance, dates |
|
||||
| `src/icon.rs` | Icons embedded in the binary |
|
||||
| `build.rs` | Generates the icons (tray, window, .ico) from `assets/logo.jpg` |
|
||||
|
||||
## Historique
|
||||
## History
|
||||
|
||||
La version 1 (C# / WPF) est disponible dans l'historique git et les anciennes releases.
|
||||
La version 2 est une réécriture complète en Rust.
|
||||
Version 1 (C# / WPF) is still available in the git history and the older releases.
|
||||
Version 2 is a complete rewrite in Rust.
|
||||
|
||||
## Licence
|
||||
## License
|
||||
|
||||
MIT
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 102 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 81 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
@@ -44,6 +44,8 @@ pub struct Config {
|
||||
pub theme: String,
|
||||
/// Afficher les images (icônes d'applis, images jointes) dans la fenêtre.
|
||||
pub show_images: bool,
|
||||
/// "auto" (langue de Windows) ou code : en, fr, nl, de, es.
|
||||
pub language: String,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@@ -67,6 +69,7 @@ impl Default for Config {
|
||||
catch_up: true,
|
||||
theme: "system".into(),
|
||||
show_images: true,
|
||||
language: "auto".into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+90
-34
@@ -15,6 +15,7 @@ use windows::Win32::System::Threading::GetCurrentThreadId;
|
||||
use windows::Win32::UI::WindowsAndMessaging::*;
|
||||
|
||||
use crate::config::{Config, MUTE_FOREVER, State};
|
||||
use crate::i18n::{self, Lang, t};
|
||||
use crate::gotify::{self, Client, Message};
|
||||
use crate::icon::{self, Look};
|
||||
use crate::notify::{Notifier, Toast};
|
||||
@@ -78,6 +79,7 @@ pub fn run() {
|
||||
sys::register_app(&icon_path);
|
||||
|
||||
let cfg = Config::load();
|
||||
i18n::set(&cfg.language);
|
||||
let first_run = !cfg.is_configured();
|
||||
let shared = Arc::new(Shared {
|
||||
cfg: Mutex::new(cfg),
|
||||
@@ -106,6 +108,8 @@ struct TrayUi {
|
||||
status_item: MenuItem,
|
||||
unmute: MenuItem,
|
||||
notif_toggle: CheckMenuItem,
|
||||
texts: Vec<(MenuText, &'static str)>,
|
||||
lang: Lang,
|
||||
look: Look,
|
||||
tooltip: String,
|
||||
notifier: Notifier,
|
||||
@@ -113,6 +117,23 @@ struct TrayUi {
|
||||
ticks: u32,
|
||||
}
|
||||
|
||||
/// Élément de menu dont le libellé suit la langue choisie.
|
||||
enum MenuText {
|
||||
Item(MenuItem),
|
||||
Check(CheckMenuItem),
|
||||
Sub(Submenu),
|
||||
}
|
||||
|
||||
impl MenuText {
|
||||
fn set(&self, s: &str) {
|
||||
match self {
|
||||
MenuText::Item(i) => i.set_text(s),
|
||||
MenuText::Check(i) => i.set_text(s),
|
||||
MenuText::Sub(i) => i.set_text(s),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum Ev {
|
||||
Menu(MenuEvent),
|
||||
Tray(TrayIconEvent),
|
||||
@@ -141,26 +162,27 @@ fn tray_loop(shared: Arc<Shared>) {
|
||||
}));
|
||||
|
||||
let menu = Menu::new();
|
||||
let status_item = MenuItem::with_id("status", "Connexion…", false, None);
|
||||
let open = MenuItem::with_id("open", "Ouvrir Gotify Lite", true, None);
|
||||
let notif_toggle = CheckMenuItem::with_id("toggle", "Notifications activées", true, shared.cfg.lock().unwrap().notifications, None);
|
||||
let mute = Submenu::with_id_and_items(
|
||||
"mute",
|
||||
"Silence",
|
||||
true,
|
||||
&[
|
||||
&MenuItem::with_id("mute:30", "30 minutes", true, None),
|
||||
&MenuItem::with_id("mute:60", "1 heure", true, None),
|
||||
&MenuItem::with_id("mute:240", "4 heures", true, None),
|
||||
&MenuItem::with_id("mute:morning", "Jusqu'à demain 8 h", true, None),
|
||||
&MenuItem::with_id("mute:forever", "Jusqu'à réactivation", true, None),
|
||||
],
|
||||
)
|
||||
.expect("menu");
|
||||
let unmute = MenuItem::with_id("unmute", "Réactiver le son et les bannières", false, None);
|
||||
let settings = MenuItem::with_id("settings", "Paramètres…", true, None);
|
||||
let reconnect = MenuItem::with_id("reconnect", "Reconnecter", true, None);
|
||||
let quit = MenuItem::with_id("quit", "Quitter", true, None);
|
||||
let item = |id: &str, key: &'static str, enabled: bool| MenuItem::with_id(id, t(key), enabled, None);
|
||||
let status_item = MenuItem::with_id("status", t!("Connexion…"), false, None);
|
||||
let open = item("open", "Ouvrir Gotify Lite", true);
|
||||
let notif_toggle =
|
||||
CheckMenuItem::with_id("toggle", t!("Notifications activées"), true, shared.cfg.lock().unwrap().notifications, None);
|
||||
let mute_items = [
|
||||
("mute:30", "30 minutes"),
|
||||
("mute:60", "1 heure"),
|
||||
("mute:240", "4 heures"),
|
||||
("mute:morning", "Jusqu'à demain 8 h"),
|
||||
("mute:forever", "Jusqu'à réactivation"),
|
||||
]
|
||||
.map(|(id, key)| (item(id, key, true), key));
|
||||
let mute = Submenu::with_id("mute", t!("Silence"), true);
|
||||
for (m, _) in &mute_items {
|
||||
let _ = mute.append(m);
|
||||
}
|
||||
let unmute = item("unmute", "Réactiver le son et les bannières", false);
|
||||
let settings = item("settings", "Paramètres…", true);
|
||||
let reconnect = item("reconnect", "Reconnecter", true);
|
||||
let quit = item("quit", "Quitter", true);
|
||||
let _ = menu.append_items(&[
|
||||
&status_item,
|
||||
&PredefinedMenuItem::separator(),
|
||||
@@ -173,6 +195,16 @@ fn tray_loop(shared: Arc<Shared>) {
|
||||
&reconnect,
|
||||
&quit,
|
||||
]);
|
||||
let mut texts = vec![
|
||||
(MenuText::Item(open), "Ouvrir Gotify Lite"),
|
||||
(MenuText::Check(notif_toggle.clone()), "Notifications activées"),
|
||||
(MenuText::Sub(mute), "Silence"),
|
||||
(MenuText::Item(unmute.clone()), "Réactiver le son et les bannières"),
|
||||
(MenuText::Item(settings), "Paramètres…"),
|
||||
(MenuText::Item(reconnect), "Reconnecter"),
|
||||
(MenuText::Item(quit), "Quitter"),
|
||||
];
|
||||
texts.extend(mute_items.into_iter().map(|(m, k)| (MenuText::Item(m), k)));
|
||||
|
||||
let tray = TrayIconBuilder::new()
|
||||
.with_icon(make_icon(Look::Disconnected))
|
||||
@@ -183,7 +215,19 @@ fn tray_loop(shared: Arc<Shared>) {
|
||||
.expect("tray");
|
||||
let notifier = Notifier::new();
|
||||
let blocked = notifier.blocked_reason();
|
||||
let mut ui = TrayUi { tray, status_item, unmute, notif_toggle, look: Look::Disconnected, tooltip: String::new(), notifier, blocked, ticks: 0 };
|
||||
let mut ui = TrayUi {
|
||||
tray,
|
||||
status_item,
|
||||
unmute,
|
||||
notif_toggle,
|
||||
texts,
|
||||
lang: i18n::current(),
|
||||
look: Look::Disconnected,
|
||||
tooltip: String::new(),
|
||||
notifier,
|
||||
blocked,
|
||||
ticks: 0,
|
||||
};
|
||||
|
||||
let quit_ev = sys::quit_event();
|
||||
unsafe { SetTimer(None, 0, 1000, None) };
|
||||
@@ -234,6 +278,7 @@ fn tray_loop(shared: Arc<Shared>) {
|
||||
if m != cfg_mtime {
|
||||
cfg_mtime = m;
|
||||
let new = Config::load();
|
||||
i18n::set(&new.language);
|
||||
let mut cur = shared.cfg.lock().unwrap();
|
||||
let reconnect = new.connection_key() != cur.connection_key();
|
||||
*cur = new;
|
||||
@@ -293,14 +338,14 @@ fn handle_menu(shared: &Shared, id: &str) {
|
||||
pub fn describe_mute(cfg: &Config) -> Option<String> {
|
||||
let now = sys::now_unix();
|
||||
if cfg.mute_until == MUTE_FOREVER {
|
||||
return Some("Silence activé".into());
|
||||
return Some(t!("Silence activé").into());
|
||||
}
|
||||
if cfg.mute_until > now {
|
||||
let mins = (cfg.mute_until - now).div_ceil(60);
|
||||
return Some(if mins >= 60 { format!("Silence encore {} h {:02}", mins / 60, mins % 60) } else { format!("Silence encore {mins} min") });
|
||||
return Some(if mins >= 60 { tf!("Silence encore {} h {}", mins / 60, format!("{:02}", mins % 60)) } else { tf!("Silence encore {} min", mins) });
|
||||
}
|
||||
if cfg.quiet_hours_active(sys::local_minutes()) {
|
||||
return Some("Heures calmes".into());
|
||||
return Some(t!("Heures calmes").into());
|
||||
}
|
||||
None
|
||||
}
|
||||
@@ -311,10 +356,10 @@ fn refresh_tray(shared: &Shared, ui: &mut TrayUi, last_state: &mut State) {
|
||||
let mute = describe_mute(&cfg);
|
||||
|
||||
let (status_text, connected) = match &status {
|
||||
Status::Unconfigured => ("Non configuré — cliquez pour régler".to_string(), false),
|
||||
Status::Connecting => ("Connexion…".to_string(), false),
|
||||
Status::Connected(host) => (format!("Connecté à {host}"), true),
|
||||
Status::Error(e) => (format!("Déconnecté : {e}"), false),
|
||||
Status::Unconfigured => (t!("Non configuré — cliquez pour régler").to_string(), false),
|
||||
Status::Connecting => (t!("Connexion…").to_string(), false),
|
||||
Status::Connected(host) => (tf!("Connecté à {}", host), true),
|
||||
Status::Error(e) => (tf!("Déconnecté : {}", e), false),
|
||||
};
|
||||
let look = if !connected {
|
||||
Look::Disconnected
|
||||
@@ -327,9 +372,20 @@ fn refresh_tray(shared: &Shared, ui: &mut TrayUi, last_state: &mut State) {
|
||||
let _ = ui.tray.set_icon(Some(make_icon(look)));
|
||||
ui.look = look;
|
||||
}
|
||||
if ui.lang != i18n::current() {
|
||||
ui.lang = i18n::current();
|
||||
for (item, key) in &ui.texts {
|
||||
item.set(t(key));
|
||||
}
|
||||
ui.tooltip.clear(); // force la mise à jour du libellé d'état
|
||||
}
|
||||
let mut tooltip = format!("{}\n{}", sys::APP_NAME, status_text);
|
||||
if !cfg.notifications {
|
||||
tooltip.push_str("\nNotifications désactivées");
|
||||
if let Some(b) = ui.blocked {
|
||||
tooltip.push_str("\n⚠ ");
|
||||
tooltip.push_str(t(b));
|
||||
} else if !cfg.notifications {
|
||||
tooltip.push('\n');
|
||||
tooltip.push_str(t!("Notifications désactivées"));
|
||||
} else if let Some(m) = &mute {
|
||||
tooltip.push('\n');
|
||||
tooltip.push_str(m);
|
||||
@@ -397,7 +453,7 @@ fn worker(shared: Arc<Shared>) {
|
||||
if let Err(e) = &result {
|
||||
sys::log(&format!("flux : {e}"));
|
||||
}
|
||||
shared.set_status(Status::Error(result.err().unwrap_or_else(|| "connexion fermée par le serveur".into())));
|
||||
shared.set_status(Status::Error(result.err().unwrap_or_else(|| t!("connexion fermée par le serveur").into())));
|
||||
if started.elapsed() > Duration::from_secs(60) {
|
||||
backoff = 1;
|
||||
}
|
||||
@@ -454,7 +510,7 @@ fn session(shared: &Shared, cfg: &Config, notifier: &Notifier) -> Result<(), Str
|
||||
loop {
|
||||
let msg = ws.read().map_err(|e| match e {
|
||||
tungstenite::Error::Io(io) if io.kind() == std::io::ErrorKind::TimedOut || io.kind() == std::io::ErrorKind::WouldBlock => {
|
||||
"plus de nouvelles du serveur (timeout)".to_string()
|
||||
t!("plus de nouvelles du serveur (timeout)").to_string()
|
||||
}
|
||||
other => other.to_string(),
|
||||
})?;
|
||||
@@ -471,7 +527,7 @@ fn session(shared: &Shared, cfg: &Config, notifier: &Notifier) -> Result<(), Str
|
||||
last_id = m.id;
|
||||
save_last_id(last_id);
|
||||
}
|
||||
tungstenite::Message::Close(_) => return Err("connexion fermée par le serveur".into()),
|
||||
tungstenite::Message::Close(_) => return Err(t!("connexion fermée par le serveur").into()),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -528,7 +584,7 @@ fn summary(shared: &Shared, notifier: &Notifier, missed: &[&Message], more: bool
|
||||
.take(4)
|
||||
.map(|m| format!("• {}", m.title.clone().filter(|t| !t.is_empty()).unwrap_or_else(|| m.message.chars().take(60).collect())))
|
||||
.collect();
|
||||
let title = format!("{}{} messages reçus pendant votre absence", visible.len(), if more { "+" } else { "" });
|
||||
let title = tf!("{} messages reçus pendant votre absence", format!("{}{}", visible.len(), if more { "+" } else { "" }));
|
||||
notifier.show(&Toast {
|
||||
title: &title,
|
||||
body: &lines.join("\n"),
|
||||
|
||||
+11
-11
@@ -123,7 +123,7 @@ impl Client {
|
||||
.map_err(describe)?
|
||||
.body_mut()
|
||||
.read_json::<T>()
|
||||
.map_err(|e| format!("Réponse invalide : {e}"))
|
||||
.map_err(|e| tf!("Réponse invalide : {}", e))
|
||||
}
|
||||
|
||||
fn delete(&self, path: &str) -> Result<()> {
|
||||
@@ -207,13 +207,13 @@ impl Client {
|
||||
|
||||
fn describe(e: ureq::Error) -> String {
|
||||
match e {
|
||||
ureq::Error::StatusCode(401) | ureq::Error::StatusCode(403) => "Token refusé (401/403) : vérifiez qu'il s'agit d'un token *client*".into(),
|
||||
ureq::Error::StatusCode(404) => "Introuvable (404) : vérifiez l'URL du serveur".into(),
|
||||
ureq::Error::StatusCode(c) => format!("Erreur HTTP {c}"),
|
||||
ureq::Error::StatusCode(401) | ureq::Error::StatusCode(403) => t!("Token refusé (401/403) : vérifiez qu'il s'agit d'un token *client*").into(),
|
||||
ureq::Error::StatusCode(404) => t!("Introuvable (404) : vérifiez l'URL du serveur").into(),
|
||||
ureq::Error::StatusCode(c) => tf!("Erreur HTTP {}", c),
|
||||
other => {
|
||||
let s = other.to_string();
|
||||
if s.to_lowercase().contains("certificate") || s.contains("0x800B") {
|
||||
format!("Certificat TLS refusé : {s}")
|
||||
tf!("Certificat TLS refusé : {}", s)
|
||||
} else {
|
||||
s
|
||||
}
|
||||
@@ -232,17 +232,17 @@ pub fn connect_stream(cfg: &Config, read_timeout: Duration) -> Result<(Stream, T
|
||||
} else if let Some(rest) = base.strip_prefix("http://") {
|
||||
format!("ws://{rest}/stream")
|
||||
} else {
|
||||
return Err("L'URL doit commencer par http:// ou https://".into());
|
||||
return Err(t!("L'URL doit commencer par http:// ou https://").into());
|
||||
};
|
||||
let mut req = ws_url.as_str().into_client_request().map_err(|e| e.to_string())?;
|
||||
let token = tungstenite::http::HeaderValue::from_str(cfg.token.trim()).map_err(|_| "Token invalide".to_string())?;
|
||||
let token = tungstenite::http::HeaderValue::from_str(cfg.token.trim()).map_err(|_| t!("Token invalide").to_string())?;
|
||||
req.headers_mut().insert("X-Gotify-Key", token);
|
||||
|
||||
let uri = req.uri().clone();
|
||||
let host = uri.host().ok_or("URL sans hôte")?.trim_start_matches('[').trim_end_matches(']').to_string();
|
||||
let host = uri.host().ok_or_else(|| t!("URL sans hôte").to_string())?.trim_start_matches('[').trim_end_matches(']').to_string();
|
||||
let port = uri.port_u16().unwrap_or(if uri.scheme_str() == Some("wss") { 443 } else { 80 });
|
||||
let addrs: Vec<_> = (host.as_str(), port).to_socket_addrs().map_err(|e| format!("DNS : {e}"))?.collect();
|
||||
let mut last_err = String::from("aucune adresse");
|
||||
let mut last_err = t!("aucune adresse").to_string();
|
||||
let tcp = addrs
|
||||
.iter()
|
||||
.find_map(|a| match TcpStream::connect_timeout(a, Duration::from_secs(10)) {
|
||||
@@ -252,7 +252,7 @@ pub fn connect_stream(cfg: &Config, read_timeout: Duration) -> Result<(Stream, T
|
||||
None
|
||||
}
|
||||
})
|
||||
.ok_or_else(|| format!("Connexion impossible à {host}:{port} : {last_err}"))?;
|
||||
.ok_or_else(|| tf!("Connexion impossible à {}:{} : {}", host, port, last_err))?;
|
||||
tcp.set_nodelay(true).ok();
|
||||
tcp.set_read_timeout(Some(Duration::from_secs(15))).ok(); // handshake
|
||||
let handle = tcp.try_clone().map_err(|e| e.to_string())?;
|
||||
@@ -269,7 +269,7 @@ pub fn connect_stream(cfg: &Config, read_timeout: Duration) -> Result<(Stream, T
|
||||
};
|
||||
let (mut ws, _resp) = tungstenite::client_tls_with_config(req, tcp, None, Some(connector)).map_err(|e| match e {
|
||||
tungstenite::HandshakeError::Failure(tungstenite::Error::Http(r)) if r.status() == 401 => {
|
||||
"Token refusé (401) : utilisez un token *client*".to_string()
|
||||
t!("Token refusé (401) : utilisez un token *client*").to_string()
|
||||
}
|
||||
other => other.to_string(),
|
||||
})?;
|
||||
|
||||
+381
@@ -0,0 +1,381 @@
|
||||
//! Traductions. Le texte français sert de clé (style gettext) ; chaque ligne du tableau
|
||||
//! contient obligatoirement les 5 langues, et un test vérifie que chaque texte de l'appli y figure.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Display;
|
||||
use std::sync::OnceLock;
|
||||
use std::sync::atomic::{AtomicU8, Ordering};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
|
||||
pub enum Lang {
|
||||
Fr = 0,
|
||||
En = 1,
|
||||
Nl = 2,
|
||||
De = 3,
|
||||
Es = 4,
|
||||
}
|
||||
|
||||
/// (code, nom affiché dans sa propre langue)
|
||||
pub const LANGUAGES: [(&str, &str); 5] =
|
||||
[("en", "English"), ("fr", "Français"), ("nl", "Nederlands"), ("de", "Deutsch"), ("es", "Español")];
|
||||
|
||||
static CURRENT: AtomicU8 = AtomicU8::new(Lang::En as u8);
|
||||
|
||||
fn from_code(code: &str) -> Option<Lang> {
|
||||
Some(match code.get(..2)?.to_ascii_lowercase().as_str() {
|
||||
"fr" => Lang::Fr,
|
||||
"en" => Lang::En,
|
||||
"nl" => Lang::Nl,
|
||||
"de" => Lang::De,
|
||||
"es" => Lang::Es,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
|
||||
/// Langue de l'interface Windows (anglais si non prise en charge).
|
||||
pub fn system_lang() -> Lang {
|
||||
use windows::Win32::Globalization::GetUserDefaultUILanguage;
|
||||
let primary = unsafe { GetUserDefaultUILanguage() } & 0x3ff;
|
||||
match primary {
|
||||
0x0c => Lang::Fr,
|
||||
0x13 => Lang::Nl,
|
||||
0x07 => Lang::De,
|
||||
0x0a => Lang::Es,
|
||||
_ => Lang::En,
|
||||
}
|
||||
}
|
||||
|
||||
/// `"auto"` (ou inconnu) = langue de Windows.
|
||||
pub fn set(code: &str) {
|
||||
let l = from_code(code).unwrap_or_else(system_lang);
|
||||
CURRENT.store(l as u8, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
pub fn current() -> Lang {
|
||||
match CURRENT.load(Ordering::Relaxed) {
|
||||
0 => Lang::Fr,
|
||||
2 => Lang::Nl,
|
||||
3 => Lang::De,
|
||||
4 => Lang::Es,
|
||||
_ => Lang::En,
|
||||
}
|
||||
}
|
||||
|
||||
fn index() -> &'static HashMap<&'static str, &'static [&'static str; 5]> {
|
||||
static I: OnceLock<HashMap<&'static str, &'static [&'static str; 5]>> = OnceLock::new();
|
||||
I.get_or_init(|| TABLE.iter().map(|row| (row[0], row)).collect())
|
||||
}
|
||||
|
||||
/// Traduit `key` (texte français) ; renvoie la clé si elle est absente du tableau.
|
||||
pub fn t(key: &str) -> &str {
|
||||
match index().get(key) {
|
||||
Some(row) => row[current() as usize],
|
||||
None => key,
|
||||
}
|
||||
}
|
||||
|
||||
/// Traduit puis remplace chaque `{}` par l'argument suivant.
|
||||
pub fn tf(key: &str, args: &[&dyn Display]) -> String {
|
||||
let mut out = String::new();
|
||||
let mut args = args.iter();
|
||||
let mut parts = t(key).split("{}").peekable();
|
||||
while let Some(p) = parts.next() {
|
||||
out.push_str(p);
|
||||
if parts.peek().is_some()
|
||||
&& let Some(a) = args.next()
|
||||
{
|
||||
out.push_str(&a.to_string());
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! t {
|
||||
($k:literal) => {
|
||||
$crate::i18n::t($k)
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! tf {
|
||||
($k:literal, $($a:expr),+ $(,)?) => {
|
||||
$crate::i18n::tf($k, &[$(&$a as &dyn std::fmt::Display),+])
|
||||
};
|
||||
}
|
||||
|
||||
// Français | English | Nederlands | Deutsch | Español
|
||||
static TABLE: &[[&str; 5]] = &[
|
||||
// ---- En-tête, onglets, état
|
||||
["Messages", "Messages", "Berichten", "Nachrichten", "Mensajes"],
|
||||
["Paramètres", "Settings", "Instellingen", "Einstellungen", "Ajustes"],
|
||||
["Service arrêté", "Service stopped", "Service gestopt", "Dienst gestoppt", "Servicio detenido"],
|
||||
["Connecté · {}", "Connected · {}", "Verbonden · {}", "Verbunden · {}", "Conectado · {}"],
|
||||
["Connexion…", "Connecting…", "Verbinden…", "Verbinde…", "Conectando…"],
|
||||
["Non configuré", "Not configured", "Niet geconfigureerd", "Nicht eingerichtet", "Sin configurar"],
|
||||
["Déconnecté", "Disconnected", "Niet verbonden", "Getrennt", "Desconectado"],
|
||||
["Démarrer", "Start", "Starten", "Starten", "Iniciar"],
|
||||
["⚠ {} : aucune bannière ne peut s'afficher.", "⚠ {}: no banner can be shown.", "⚠ {}: er kunnen geen meldingen verschijnen.", "⚠ {}: Es können keine Banner angezeigt werden.", "⚠ {}: no se pueden mostrar avisos."],
|
||||
["Ouvrir les paramètres Windows", "Open Windows settings", "Windows-instellingen openen", "Windows-Einstellungen öffnen", "Abrir la configuración de Windows"],
|
||||
// ---- Messages
|
||||
["Aucun serveur configuré.", "No server configured.", "Geen server ingesteld.", "Kein Server eingerichtet.", "Ningún servidor configurado."],
|
||||
["Configurer le serveur", "Set up server", "Server instellen", "Server einrichten", "Configurar servidor"],
|
||||
["Toutes ({})", "All ({})", "Alle ({})", "Alle ({})", "Todas ({})"],
|
||||
["Réactiver les notifications", "Unmute notifications", "Meldingen weer inschakelen", "Benachrichtigungen wieder aktivieren", "Reactivar notificaciones"],
|
||||
["Couper les notifications", "Mute notifications", "Meldingen dempen", "Benachrichtigungen stummschalten", "Silenciar notificaciones"],
|
||||
["🔍 Rechercher…", "🔍 Search…", "🔍 Zoeken…", "🔍 Suchen…", "🔍 Buscar…"],
|
||||
["⟳ Actualiser", "⟳ Refresh", "⟳ Vernieuwen", "⟳ Aktualisieren", "⟳ Actualizar"],
|
||||
["les messages de {}", "the messages from {}", "de berichten van {}", "die Nachrichten von {}", "los mensajes de {}"],
|
||||
["tous les messages", "all messages", "alle berichten", "alle Nachrichten", "todos los mensajes"],
|
||||
["Annuler", "Cancel", "Annuleren", "Abbrechen", "Cancelar"],
|
||||
["Supprimer", "Delete", "Verwijderen", "Löschen", "Eliminar"],
|
||||
["Supprimer {} du serveur ?", "Delete {} from the server?", "{} van de server verwijderen?", "{} vom Server löschen?", "¿Eliminar {} del servidor?"],
|
||||
["🗑 Tout supprimer", "🗑 Delete all", "🗑 Alles verwijderen", "🗑 Alle löschen", "🗑 Eliminar todo"],
|
||||
["Supprime {} du serveur", "Deletes {} from the server", "Verwijdert {} van de server", "Löscht {} vom Server", "Elimina {} del servidor"],
|
||||
["Aucun message", "No messages", "Geen berichten", "Keine Nachrichten", "Sin mensajes"],
|
||||
["Charger plus", "Load more", "Meer laden", "Mehr laden", "Cargar más"],
|
||||
["Priorité", "Priority", "Prioriteit", "Priorität", "Prioridad"],
|
||||
["Supprimer du serveur", "Delete from server", "Van server verwijderen", "Vom Server löschen", "Eliminar del servidor"],
|
||||
["Ouvrir l'image", "Open image", "Afbeelding openen", "Bild öffnen", "Abrir imagen"],
|
||||
["🖼 Image jointe (non chargée)", "🖼 Attached image (not loaded)", "🖼 Bijgevoegde afbeelding (niet geladen)", "🖼 Angehängtes Bild (nicht geladen)", "🖼 Imagen adjunta (no cargada)"],
|
||||
["Impossible d'enregistrer : {}", "Could not save: {}", "Opslaan mislukt: {}", "Speichern fehlgeschlagen: {}", "No se pudo guardar: {}"],
|
||||
// ---- Réglages : serveur
|
||||
["Serveur", "Server", "Server", "Server", "Servidor"],
|
||||
["URL", "URL", "URL", "URL", "URL"],
|
||||
["https://gotify.exemple.fr", "https://gotify.example.com", "https://gotify.voorbeeld.nl", "https://gotify.beispiel.de", "https://gotify.ejemplo.es"],
|
||||
["📋 Coller", "📋 Paste", "📋 Plakken", "📋 Einfügen", "📋 Pegar"],
|
||||
["Coller depuis le presse-papiers", "Paste from clipboard", "Plakken vanaf klembord", "Aus der Zwischenablage einfügen", "Pegar desde el portapapeles"],
|
||||
["Token client", "Client token", "Client-token", "Client-Token", "Token de cliente"],
|
||||
[
|
||||
"Dans l'interface web Gotify : Clients → Créer un client, puis copiez son token (pas un token d'application).",
|
||||
"In the Gotify web UI: Clients → Create client, then copy its token (not an application token).",
|
||||
"In de Gotify-webinterface: Clients → Client aanmaken, kopieer dan het token (geen applicatietoken).",
|
||||
"In der Gotify-Weboberfläche: Clients → Client erstellen, dann dessen Token kopieren (kein Anwendungs-Token).",
|
||||
"En la interfaz web de Gotify: Clients → Crear cliente y copia su token (no un token de aplicación).",
|
||||
],
|
||||
["Enregistrer et connecter", "Save and connect", "Opslaan en verbinden", "Speichern und verbinden", "Guardar y conectar"],
|
||||
["Tester la connexion", "Test connection", "Verbinding testen", "Verbindung testen", "Probar conexión"],
|
||||
["Connecté en tant que « {} » — Gotify {}", "Connected as “{}” — Gotify {}", "Verbonden als ‘{}’ — Gotify {}", "Verbunden als „{}“ — Gotify {}", "Conectado como «{}» — Gotify {}"],
|
||||
["Accepter les certificats non valides (auto-signés)", "Accept invalid (self-signed) certificates", "Ongeldige (zelfondertekende) certificaten accepteren", "Ungültige (selbstsignierte) Zertifikate akzeptieren", "Aceptar certificados no válidos (autofirmados)"],
|
||||
[
|
||||
"À éviter : préférez installer votre autorité de certification dans Windows.",
|
||||
"Not recommended: install your certificate authority in Windows instead.",
|
||||
"Af te raden: installeer liever uw certificaatautoriteit in Windows.",
|
||||
"Nicht empfohlen: Installieren Sie besser Ihre Zertifizierungsstelle in Windows.",
|
||||
"No recomendado: mejor instala tu autoridad de certificación en Windows.",
|
||||
],
|
||||
// ---- Réglages : notifications
|
||||
["Notifications", "Notifications", "Meldingen", "Benachrichtigungen", "Notificaciones"],
|
||||
["Afficher les notifications Windows", "Show Windows notifications", "Windows-meldingen tonen", "Windows-Benachrichtigungen anzeigen", "Mostrar notificaciones de Windows"],
|
||||
["Jouer un son", "Play a sound", "Geluid afspelen", "Ton abspielen", "Reproducir sonido"],
|
||||
["Ignorer en dessous de la priorité", "Ignore below priority", "Negeren onder prioriteit", "Ignorieren unter Priorität", "Ignorar por debajo de la prioridad"],
|
||||
["Bannière à partir de la priorité", "Banner from priority", "Melding vanaf prioriteit", "Banner ab Priorität", "Aviso a partir de la prioridad"],
|
||||
[
|
||||
"En dessous : discret, directement dans le centre de notifications.",
|
||||
"Below that: silent, straight to the notification center.",
|
||||
"Daaronder: stil, direct naar het meldingencentrum.",
|
||||
"Darunter: lautlos, direkt in die Mitteilungszentrale.",
|
||||
"Por debajo: discreto, directamente al centro de notificaciones.",
|
||||
],
|
||||
["Reste affichée à partir de la priorité", "Stays on screen from priority", "Blijft zichtbaar vanaf prioriteit", "Bleibt sichtbar ab Priorität", "Permanece visible a partir de la prioridad"],
|
||||
[
|
||||
"La notification reste à l'écran jusqu'à ce que vous la fermiez.",
|
||||
"The notification stays on screen until you dismiss it.",
|
||||
"De melding blijft zichtbaar tot u ze sluit.",
|
||||
"Die Benachrichtigung bleibt sichtbar, bis Sie sie schließen.",
|
||||
"La notificación permanece en pantalla hasta que la cierres.",
|
||||
],
|
||||
["jamais", "never", "nooit", "nie", "nunca"],
|
||||
["Afficher les messages manqués à la reconnexion", "Show missed messages after reconnecting", "Gemiste berichten tonen na opnieuw verbinden", "Verpasste Nachrichten nach erneuter Verbindung anzeigen", "Mostrar mensajes perdidos al reconectar"],
|
||||
["Notifications par application", "Notifications per application", "Meldingen per applicatie", "Benachrichtigungen pro Anwendung", "Notificaciones por aplicación"],
|
||||
["🔔 Envoyer une notification de test", "🔔 Send a test notification", "🔔 Testmelding versturen", "🔔 Testbenachrichtigung senden", "🔔 Enviar notificación de prueba"],
|
||||
["Paramètres de notification Windows…", "Windows notification settings…", "Windows-meldingsinstellingen…", "Windows-Benachrichtigungseinstellungen…", "Configuración de notificaciones de Windows…"],
|
||||
[
|
||||
"Style des bannières, écran de verrouillage, Ne pas déranger…",
|
||||
"Banner style, lock screen, Do not disturb…",
|
||||
"Stijl van meldingen, vergrendelscherm, Niet storen…",
|
||||
"Bannerstil, Sperrbildschirm, Nicht stören…",
|
||||
"Estilo de avisos, pantalla de bloqueo, No molestar…",
|
||||
],
|
||||
[
|
||||
"Gotify Lite n'apparaît dans les paramètres Windows qu'après sa première notification.",
|
||||
"Gotify Lite only shows up in Windows settings after its first notification.",
|
||||
"Gotify Lite verschijnt pas in de Windows-instellingen na de eerste melding.",
|
||||
"Gotify Lite erscheint erst nach der ersten Benachrichtigung in den Windows-Einstellungen.",
|
||||
"Gotify Lite solo aparece en la configuración de Windows tras su primera notificación.",
|
||||
],
|
||||
// ---- Réglages : silence
|
||||
["Silence", "Do not disturb", "Niet storen", "Nicht stören", "No molestar"],
|
||||
["Indéfiniment", "Indefinitely", "Onbeperkt", "Unbegrenzt", "Indefinidamente"],
|
||||
["Réactiver", "Resume", "Hervatten", "Fortsetzen", "Reanudar"],
|
||||
["Heures calmes chaque jour de", "Quiet hours every day from", "Stille uren elke dag van", "Ruhezeit täglich von", "Horas de silencio cada día de"],
|
||||
["à", "to", "tot", "bis", "a"],
|
||||
["Pendant un silence, laisser passer à partir de la priorité", "While muted, still show from priority", "Tijdens stilte toch tonen vanaf prioriteit", "Bei Ruhe trotzdem anzeigen ab Priorität", "En silencio, mostrar igualmente a partir de la prioridad"],
|
||||
[
|
||||
"En silence, les messages arrivent quand même dans le centre de notifications, sans son ni bannière.",
|
||||
"While muted, messages still reach the notification center, without sound or banner.",
|
||||
"Tijdens stilte komen berichten nog steeds in het meldingencentrum, zonder geluid of melding.",
|
||||
"Bei Ruhe landen Nachrichten weiterhin in der Mitteilungszentrale, ohne Ton und Banner.",
|
||||
"En silencio, los mensajes siguen llegando al centro de notificaciones, sin sonido ni aviso.",
|
||||
],
|
||||
// ---- Réglages : général
|
||||
["Général", "General", "Algemeen", "Allgemein", "General"],
|
||||
["Lancer au démarrage de Windows", "Start with Windows", "Starten met Windows", "Mit Windows starten", "Iniciar con Windows"],
|
||||
["Afficher les images (icônes des applications, images jointes)", "Show images (application icons, attached images)", "Afbeeldingen tonen (applicatiepictogrammen, bijlagen)", "Bilder anzeigen (Anwendungssymbole, angehängte Bilder)", "Mostrar imágenes (iconos de aplicaciones, imágenes adjuntas)"],
|
||||
["Thème", "Theme", "Thema", "Design", "Tema"],
|
||||
["Système", "System", "Systeem", "System", "Sistema"],
|
||||
["☀ Clair", "☀ Light", "☀ Licht", "☀ Hell", "☀ Claro"],
|
||||
["🌙 Sombre", "🌙 Dark", "🌙 Donker", "🌙 Dunkel", "🌙 Oscuro"],
|
||||
["Langue", "Language", "Taal", "Sprache", "Idioma"],
|
||||
["Automatique (Windows)", "Automatic (Windows)", "Automatisch (Windows)", "Automatisch (Windows)", "Automático (Windows)"],
|
||||
["Arrêter le service de fond", "Stop background service", "Achtergronddienst stoppen", "Hintergrunddienst beenden", "Detener servicio en segundo plano"],
|
||||
["Gotify Lite {} · réglages enregistrés automatiquement", "Gotify Lite {} · settings are saved automatically", "Gotify Lite {} · instellingen worden automatisch opgeslagen", "Gotify Lite {} · Einstellungen werden automatisch gespeichert", "Gotify Lite {} · los ajustes se guardan automáticamente"],
|
||||
// ---- Réglages : dossier des données
|
||||
["Dossier des données", "Data folder", "Gegevensmap", "Datenordner", "Carpeta de datos"],
|
||||
["Emplacement :", "Location:", "Locatie:", "Speicherort:", "Ubicación:"],
|
||||
["(par défaut)", "(default)", "(standaard)", "(Standard)", "(predeterminada)"],
|
||||
["📂 Ouvrir", "📂 Open", "📂 Openen", "📂 Öffnen", "📂 Abrir"],
|
||||
["Changer…", "Change…", "Wijzigen…", "Ändern…", "Cambiar…"],
|
||||
["Revenir à l'emplacement par défaut", "Back to default location", "Terug naar standaardlocatie", "Zurück zum Standardort", "Volver a la ubicación predeterminada"],
|
||||
["Données déplacées vers {}", "Data moved to {}", "Gegevens verplaatst naar {}", "Daten verschoben nach {}", "Datos movidos a {}"],
|
||||
[
|
||||
"Déplacer les réglages, l'historique local et les icônes vers :\n{}",
|
||||
"Move settings, local history and icons to:\n{}",
|
||||
"Instellingen, lokale geschiedenis en pictogrammen verplaatsen naar:\n{}",
|
||||
"Einstellungen, lokalen Verlauf und Symbole verschieben nach:\n{}",
|
||||
"Mover ajustes, historial local e iconos a:\n{}",
|
||||
],
|
||||
["Déplacer les données", "Move data", "Gegevens verplaatsen", "Daten verschieben", "Mover datos"],
|
||||
[
|
||||
"Le token reste chiffré pour votre session Windows : il n'est utilisable que par votre compte.",
|
||||
"The token stays encrypted for your Windows session: only your account can use it.",
|
||||
"Het token blijft versleuteld voor uw Windows-sessie: alleen uw account kan het gebruiken.",
|
||||
"Das Token bleibt für Ihre Windows-Sitzung verschlüsselt: Nur Ihr Konto kann es verwenden.",
|
||||
"El token permanece cifrado para tu sesión de Windows: solo tu cuenta puede usarlo.",
|
||||
],
|
||||
["Choisir le dossier des données de Gotify Lite", "Choose the Gotify Lite data folder", "Kies de gegevensmap van Gotify Lite", "Datenordner für Gotify Lite wählen", "Elige la carpeta de datos de Gotify Lite"],
|
||||
["C'est déjà le dossier utilisé.", "This folder is already in use.", "Deze map is al in gebruik.", "Dieser Ordner wird bereits verwendet.", "Esta carpeta ya está en uso."],
|
||||
["Impossible de créer {} : {}", "Could not create {}: {}", "Kan {} niet aanmaken: {}", "{} konnte nicht erstellt werden: {}", "No se pudo crear {}: {}"],
|
||||
["Dossier non accessible en écriture : {}", "Folder is not writable: {}", "Map is niet beschrijfbaar: {}", "Ordner ist nicht beschreibbar: {}", "La carpeta no admite escritura: {}"],
|
||||
["Copie de {} : {}", "Copying {}: {}", "Kopiëren van {}: {}", "Kopieren von {}: {}", "Copiando {}: {}"],
|
||||
["Copie des icônes : {}", "Copying icons: {}", "Pictogrammen kopiëren: {}", "Symbole kopieren: {}", "Copiando iconos: {}"],
|
||||
["Impossible d'enregistrer le nouveau dossier dans le registre.", "Could not save the new folder in the registry.", "Kan de nieuwe map niet in het register opslaan.", "Der neue Ordner konnte nicht in der Registry gespeichert werden.", "No se pudo guardar la nueva carpeta en el registro."],
|
||||
// ---- Notifications
|
||||
["Notification de test", "Test notification", "Testmelding", "Testbenachrichtigung", "Notificación de prueba"],
|
||||
["Gotify Lite fonctionne : les messages de votre serveur s'afficheront ainsi.", "Gotify Lite works: messages from your server will look like this.", "Gotify Lite werkt: berichten van uw server zien er zo uit.", "Gotify Lite funktioniert: Nachrichten Ihres Servers sehen so aus.", "Gotify Lite funciona: los mensajes de tu servidor se verán así."],
|
||||
["{} messages reçus pendant votre absence", "{} messages received while you were away", "{} berichten ontvangen tijdens uw afwezigheid", "{} Nachrichten während Ihrer Abwesenheit erhalten", "{} mensajes recibidos durante tu ausencia"],
|
||||
["Ouvrir", "Open", "Openen", "Öffnen", "Abrir"],
|
||||
["Fermer", "Dismiss", "Sluiten", "Schließen", "Cerrar"],
|
||||
["Les notifications Windows sont désactivées pour votre session", "Windows notifications are turned off for your session", "Windows-meldingen zijn uitgeschakeld voor uw sessie", "Windows-Benachrichtigungen sind für Ihre Sitzung deaktiviert", "Las notificaciones de Windows están desactivadas para tu sesión"],
|
||||
["Les notifications de Gotify Lite sont désactivées dans Windows", "Gotify Lite notifications are turned off in Windows", "Meldingen van Gotify Lite zijn uitgeschakeld in Windows", "Benachrichtigungen von Gotify Lite sind in Windows deaktiviert", "Las notificaciones de Gotify Lite están desactivadas en Windows"],
|
||||
["Les notifications sont désactivées par une stratégie de groupe", "Notifications are disabled by group policy", "Meldingen zijn uitgeschakeld via groepsbeleid", "Benachrichtigungen sind per Gruppenrichtlinie deaktiviert", "Las notificaciones están desactivadas por una directiva de grupo"],
|
||||
["Notifications refusées par Windows", "Notifications refused by Windows", "Meldingen geweigerd door Windows", "Benachrichtigungen von Windows abgelehnt", "Notificaciones rechazadas por Windows"],
|
||||
["Notifications bloquées par Windows", "Notifications blocked by Windows", "Meldingen geblokkeerd door Windows", "Benachrichtigungen von Windows blockiert", "Notificaciones bloqueadas por Windows"],
|
||||
// ---- Icône (zone de notification)
|
||||
["Ouvrir Gotify Lite", "Open Gotify Lite", "Gotify Lite openen", "Gotify Lite öffnen", "Abrir Gotify Lite"],
|
||||
["Notifications activées", "Notifications enabled", "Meldingen ingeschakeld", "Benachrichtigungen aktiviert", "Notificaciones activadas"],
|
||||
["30 minutes", "30 minutes", "30 minuten", "30 Minuten", "30 minutos"],
|
||||
["1 heure", "1 hour", "1 uur", "1 Stunde", "1 hora"],
|
||||
["4 heures", "4 hours", "4 uur", "4 Stunden", "4 horas"],
|
||||
["Jusqu'à demain 8 h", "Until 8 AM tomorrow", "Tot morgen 8 uur", "Bis morgen 8 Uhr", "Hasta mañana a las 8"],
|
||||
["Jusqu'à réactivation", "Until turned back on", "Tot ik het weer aanzet", "Bis zur Reaktivierung", "Hasta reactivarlo"],
|
||||
["Réactiver le son et les bannières", "Turn sound and banners back on", "Geluid en meldingen weer aanzetten", "Ton und Banner wieder aktivieren", "Reactivar sonido y avisos"],
|
||||
["Paramètres…", "Settings…", "Instellingen…", "Einstellungen…", "Ajustes…"],
|
||||
["Reconnecter", "Reconnect", "Opnieuw verbinden", "Neu verbinden", "Reconectar"],
|
||||
["Quitter", "Quit", "Afsluiten", "Beenden", "Salir"],
|
||||
["Silence activé", "Do not disturb on", "Niet storen aan", "Nicht stören aktiv", "No molestar activado"],
|
||||
["Silence encore {} h {}", "Muted for {} h {} more", "Nog {} u {} stil", "Noch {} Std. {} Ruhe", "Silencio durante {} h {} más"],
|
||||
["Silence encore {} min", "Muted for {} more min", "Nog {} min stil", "Noch {} Min. Ruhe", "Silencio durante {} min más"],
|
||||
["Heures calmes", "Quiet hours", "Stille uren", "Ruhezeit", "Horas de silencio"],
|
||||
["Non configuré — cliquez pour régler", "Not configured — click to set up", "Niet geconfigureerd — klik om in te stellen", "Nicht eingerichtet — zum Einrichten klicken", "Sin configurar — haz clic para configurar"],
|
||||
["Connecté à {}", "Connected to {}", "Verbonden met {}", "Verbunden mit {}", "Conectado a {}"],
|
||||
["Déconnecté : {}", "Disconnected: {}", "Niet verbonden: {}", "Getrennt: {}", "Desconectado: {}"],
|
||||
["Notifications désactivées", "Notifications off", "Meldingen uit", "Benachrichtigungen aus", "Notificaciones desactivadas"],
|
||||
["connexion fermée par le serveur", "connection closed by server", "verbinding gesloten door server", "Verbindung vom Server getrennt", "conexión cerrada por el servidor"],
|
||||
["plus de nouvelles du serveur (timeout)", "no response from server (timeout)", "geen reactie van server (time-out)", "keine Antwort vom Server (Zeitüberschreitung)", "sin respuesta del servidor (tiempo agotado)"],
|
||||
// ---- Erreurs réseau
|
||||
["Réponse invalide : {}", "Invalid response: {}", "Ongeldig antwoord: {}", "Ungültige Antwort: {}", "Respuesta no válida: {}"],
|
||||
["Token refusé (401/403) : vérifiez qu'il s'agit d'un token *client*", "Token rejected (401/403): make sure it is a *client* token", "Token geweigerd (401/403): controleer of het een *client*-token is", "Token abgelehnt (401/403): Prüfen Sie, ob es ein *Client*-Token ist", "Token rechazado (401/403): comprueba que sea un token de *cliente*"],
|
||||
["Introuvable (404) : vérifiez l'URL du serveur", "Not found (404): check the server URL", "Niet gevonden (404): controleer de server-URL", "Nicht gefunden (404): Server-URL prüfen", "No encontrado (404): comprueba la URL del servidor"],
|
||||
["Erreur HTTP {}", "HTTP error {}", "HTTP-fout {}", "HTTP-Fehler {}", "Error HTTP {}"],
|
||||
["Certificat TLS refusé : {}", "TLS certificate rejected: {}", "TLS-certificaat geweigerd: {}", "TLS-Zertifikat abgelehnt: {}", "Certificado TLS rechazado: {}"],
|
||||
["L'URL doit commencer par http:// ou https://", "The URL must start with http:// or https://", "De URL moet beginnen met http:// of https://", "Die URL muss mit http:// oder https:// beginnen", "La URL debe empezar por http:// o https://"],
|
||||
["Token invalide", "Invalid token", "Ongeldig token", "Ungültiges Token", "Token no válido"],
|
||||
["URL sans hôte", "URL has no host", "URL zonder host", "URL ohne Host", "URL sin host"],
|
||||
["aucune adresse", "no address", "geen adres", "keine Adresse", "ninguna dirección"],
|
||||
["Connexion impossible à {}:{} : {}", "Cannot connect to {}:{}: {}", "Kan geen verbinding maken met {}:{}: {}", "Keine Verbindung zu {}:{}: {}", "No se puede conectar a {}:{}: {}"],
|
||||
["Token refusé (401) : utilisez un token *client*", "Token rejected (401): use a *client* token", "Token geweigerd (401): gebruik een *client*-token", "Token abgelehnt (401): Verwenden Sie ein *Client*-Token", "Token rechazado (401): usa un token de *cliente*"],
|
||||
// ---- Dates relatives
|
||||
["à l'instant", "just now", "zojuist", "gerade eben", "ahora mismo"],
|
||||
["il y a {} min", "{} min ago", "{} min geleden", "vor {} Min.", "hace {} min"],
|
||||
["il y a {} h", "{} h ago", "{} u geleden", "vor {} Std.", "hace {} h"],
|
||||
["hier", "yesterday", "gisteren", "gestern", "ayer"],
|
||||
["il y a {} j", "{} d ago", "{} d geleden", "vor {} T.", "hace {} d"],
|
||||
];
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
/// Chaque `t!("…")` / `tf!("…", …)` du code doit exister dans le tableau.
|
||||
#[test]
|
||||
fn every_key_translated() {
|
||||
let dir = concat!(env!("CARGO_MANIFEST_DIR"), "/src");
|
||||
let mut missing = Vec::new();
|
||||
for e in std::fs::read_dir(dir).unwrap() {
|
||||
let path = e.unwrap().path();
|
||||
if path.ends_with("i18n.rs") {
|
||||
continue;
|
||||
}
|
||||
let src = std::fs::read_to_string(path).unwrap();
|
||||
for mac in ["t!(\"", "tf!(\""] {
|
||||
for (i, _) in src.match_indices(mac) {
|
||||
// Ignore `format!(`, `print!(`… : le macro doit commencer un identifiant.
|
||||
if src[..i].chars().next_back().is_some_and(|c| c.is_alphanumeric() || c == '_') {
|
||||
continue;
|
||||
}
|
||||
let rest = &src[i + mac.len()..];
|
||||
let mut key = String::new();
|
||||
let mut chars = rest.chars();
|
||||
while let Some(c) = chars.next() {
|
||||
match c {
|
||||
'\\' => match chars.next() {
|
||||
Some('n') => key.push('\n'),
|
||||
Some(o) => key.push(o),
|
||||
None => {}
|
||||
},
|
||||
'"' => break,
|
||||
c => key.push(c),
|
||||
}
|
||||
}
|
||||
if !index().contains_key(key.as_str()) {
|
||||
missing.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
assert!(missing.is_empty(), "textes non traduits : {missing:#?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn placeholders_match() {
|
||||
for row in TABLE {
|
||||
let n = row[0].matches("{}").count();
|
||||
for s in row {
|
||||
assert_eq!(s.matches("{}").count(), n, "{row:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_duplicate_keys() {
|
||||
assert_eq!(index().len(), TABLE.len());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn format() {
|
||||
CURRENT.store(Lang::En as u8, Ordering::Relaxed);
|
||||
assert_eq!(tf("Connexion impossible à {}:{} : {}", &[&"h", &443, &"x"]), "Cannot connect to h:443: x");
|
||||
assert_eq!(t("texte inconnu"), "texte inconnu");
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
//! `--ui` : fenêtre messages/réglages (processus séparé, fermé après usage).
|
||||
|
||||
mod config;
|
||||
#[macro_use]
|
||||
mod i18n;
|
||||
mod daemon;
|
||||
mod gotify;
|
||||
mod icon;
|
||||
|
||||
+4
-2
@@ -77,8 +77,10 @@ impl Notifier {
|
||||
let audio = if d.sound { "" } else { r#"<audio silent="true"/>"# };
|
||||
let actions = if d.sticky {
|
||||
format!(
|
||||
r#"<actions><action content="Ouvrir" activationType="protocol" arguments="{}"/><action content="Fermer" activationType="system" arguments="dismiss"/></actions>"#,
|
||||
esc(t.launch)
|
||||
r#"<actions><action content="{}" activationType="protocol" arguments="{}"/><action content="{}" activationType="system" arguments="dismiss"/></actions>"#,
|
||||
esc(t!("Ouvrir")),
|
||||
esc(t.launch),
|
||||
esc(t!("Fermer"))
|
||||
)
|
||||
} else {
|
||||
String::new()
|
||||
|
||||
+12
-12
@@ -71,19 +71,19 @@ pub fn migrate_data(target: Option<PathBuf>) -> Result<PathBuf, String> {
|
||||
};
|
||||
let same = |a: &Path, b: &Path| a.canonicalize().ok().zip(b.canonicalize().ok()).is_some_and(|(x, y)| x == y) || a == b;
|
||||
if same(&old_r, &new_r) && same(&old_l, &new_l) {
|
||||
return Err("C'est déjà le dossier utilisé.".into());
|
||||
return Err(t!("C'est déjà le dossier utilisé.").into());
|
||||
}
|
||||
for d in [&new_r, &new_l] {
|
||||
std::fs::create_dir_all(d).map_err(|e| format!("Impossible de créer {} : {e}", d.display()))?;
|
||||
std::fs::create_dir_all(d).map_err(|e| tf!("Impossible de créer {} : {}", d.display(), e))?;
|
||||
let probe = d.join(".gotify-lite-test");
|
||||
std::fs::write(&probe, b"ok").map_err(|e| format!("Dossier non accessible en écriture : {e}"))?;
|
||||
std::fs::write(&probe, b"ok").map_err(|e| tf!("Dossier non accessible en écriture : {}", e))?;
|
||||
let _ = std::fs::remove_file(probe);
|
||||
}
|
||||
let copy = |from: &Path, to: &Path, names: &[&str]| -> Result<(), String> {
|
||||
for n in names {
|
||||
let src = from.join(n);
|
||||
if src.exists() && !same(&src, &to.join(n)) {
|
||||
std::fs::copy(&src, to.join(n)).map_err(|e| format!("Copie de {n} : {e}"))?;
|
||||
std::fs::copy(&src, to.join(n)).map_err(|e| tf!("Copie de {} : {}", n, e))?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
@@ -91,14 +91,14 @@ pub fn migrate_data(target: Option<PathBuf>) -> Result<PathBuf, String> {
|
||||
copy(&old_r, &new_r, ROAMING_FILES)?;
|
||||
copy(&old_l, &new_l, LOCAL_FILES)?;
|
||||
if old_l.join("icons").is_dir() && !same(&old_l.join("icons"), &new_l.join("icons")) {
|
||||
copy_dir(&old_l.join("icons"), &new_l.join("icons")).map_err(|e| format!("Copie des icônes : {e}"))?;
|
||||
copy_dir(&old_l.join("icons"), &new_l.join("icons")).map_err(|e| tf!("Copie des icônes : {}", e))?;
|
||||
}
|
||||
|
||||
// Bascule.
|
||||
match &target {
|
||||
Some(t) => {
|
||||
if !reg_set_str(APP_KEY, Some(DATA_VALUE), &t.display().to_string()) {
|
||||
return Err("Impossible d'enregistrer le nouveau dossier dans le registre.".into());
|
||||
return Err(t!("Impossible d'enregistrer le nouveau dossier dans le registre.").into());
|
||||
}
|
||||
}
|
||||
None => reg_delete_value(APP_KEY, DATA_VALUE),
|
||||
@@ -132,7 +132,7 @@ pub fn pick_folder(start: &Path) -> Option<PathBuf> {
|
||||
let dlg: IFileOpenDialog = CoCreateInstance(&FileOpenDialog, None, CLSCTX_INPROC_SERVER).ok()?;
|
||||
let opts = dlg.GetOptions().ok()?;
|
||||
dlg.SetOptions(opts | FOS_PICKFOLDERS | FOS_FORCEFILESYSTEM).ok()?;
|
||||
let _ = dlg.SetTitle(w!("Choisir le dossier des données de Gotify Lite"));
|
||||
let _ = dlg.SetTitle(&HSTRING::from(t!("Choisir le dossier des données de Gotify Lite")));
|
||||
if let Ok(item) = SHCreateItemFromParsingName::<_, _, IShellItem>(&HSTRING::from(start.as_os_str()), None) {
|
||||
let _ = dlg.SetFolder(&item);
|
||||
}
|
||||
@@ -383,11 +383,11 @@ pub fn relative_time(date: &str) -> String {
|
||||
let Some(t) = parse_rfc3339(date) else { return String::new() };
|
||||
let diff = now_unix() as i64 - t;
|
||||
match diff {
|
||||
i64::MIN..=44 => "à l'instant".into(),
|
||||
45..=3599 => format!("il y a {} min", (diff + 30) / 60),
|
||||
3600..=86399 => format!("il y a {} h", diff / 3600),
|
||||
86400..=172799 => "hier".into(),
|
||||
_ if diff < 30 * 86400 => format!("il y a {} j", diff / 86400),
|
||||
i64::MIN..=44 => t!("à l'instant").into(),
|
||||
45..=3599 => tf!("il y a {} min", (diff + 30) / 60),
|
||||
3600..=86399 => tf!("il y a {} h", diff / 3600),
|
||||
86400..=172799 => t!("hier").into(),
|
||||
_ if diff < 30 * 86400 => tf!("il y a {} j", diff / 86400),
|
||||
_ => date.get(..10).map(|d| format!("{}/{}/{}", &d[8..10], &d[5..7], &d[..4])).unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,6 +193,7 @@ impl Gui {
|
||||
rx,
|
||||
ctx: ctx.clone(),
|
||||
};
|
||||
crate::i18n::set(&g.cfg.language);
|
||||
g.apply_theme();
|
||||
install_system_fonts(ctx);
|
||||
let mut style = (*ctx.global_style()).clone();
|
||||
@@ -300,6 +301,7 @@ impl Gui {
|
||||
self.cfg = Config::load();
|
||||
self.saved = self.cfg.clone();
|
||||
self.apply_theme();
|
||||
crate::i18n::set(&self.cfg.language);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,12 +312,15 @@ impl Gui {
|
||||
if self.cfg.theme != self.saved.theme {
|
||||
self.apply_theme();
|
||||
}
|
||||
if self.cfg.language != self.saved.language {
|
||||
crate::i18n::set(&self.cfg.language);
|
||||
}
|
||||
match self.cfg.save() {
|
||||
Ok(()) => {
|
||||
self.saved = self.cfg.clone();
|
||||
self.cfg_mtime = Config::mtime();
|
||||
}
|
||||
Err(e) => self.error = Some(format!("Impossible d'enregistrer : {e}")),
|
||||
Err(e) => self.error = Some(tf!("Impossible d'enregistrer : {}", e)),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,20 +373,20 @@ impl Gui {
|
||||
ui.add(egui::Image::from_texture(&*logo).fit_to_exact_size(egui::vec2(26.0, 26.0)));
|
||||
ui.heading(RichText::new("Gotify Lite").strong());
|
||||
ui.add_space(12.0);
|
||||
ui.selectable_value(&mut self.tab, Tab::Messages, "Messages");
|
||||
ui.selectable_value(&mut self.tab, Tab::Settings, "Paramètres");
|
||||
ui.selectable_value(&mut self.tab, Tab::Messages, t!("Messages"));
|
||||
ui.selectable_value(&mut self.tab, Tab::Settings, t!("Paramètres"));
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
let (dot, text) = if !self.daemon_running {
|
||||
(Color32::from_rgb(200, 60, 60), "Service arrêté".to_string())
|
||||
(Color32::from_rgb(200, 60, 60), t!("Service arrêté").to_string())
|
||||
} else {
|
||||
match self.state.status.as_str() {
|
||||
"connected" => (Color32::from_rgb(40, 170, 90), format!("Connecté · {}", self.state.detail)),
|
||||
"connecting" => (Color32::from_rgb(220, 160, 30), "Connexion…".into()),
|
||||
"unconfigured" => (Color32::GRAY, "Non configuré".into()),
|
||||
_ => (Color32::from_rgb(200, 60, 60), "Déconnecté".into()),
|
||||
"connected" => (Color32::from_rgb(40, 170, 90), tf!("Connecté · {}", self.state.detail)),
|
||||
"connecting" => (Color32::from_rgb(220, 160, 30), t!("Connexion…").into()),
|
||||
"unconfigured" => (Color32::GRAY, t!("Non configuré").into()),
|
||||
_ => (Color32::from_rgb(200, 60, 60), t!("Déconnecté").into()),
|
||||
}
|
||||
};
|
||||
if !self.daemon_running && ui.button("Démarrer").clicked() {
|
||||
if !self.daemon_running && ui.button(t!("Démarrer")).clicked() {
|
||||
sys::spawn_daemon();
|
||||
}
|
||||
let r = ui.label(text);
|
||||
@@ -403,8 +408,8 @@ impl Gui {
|
||||
if !self.cfg.is_configured() {
|
||||
ui.add_space(40.0);
|
||||
ui.vertical_centered(|ui| {
|
||||
ui.label("Aucun serveur configuré.");
|
||||
if ui.button("Configurer le serveur").clicked() {
|
||||
ui.label(t!("Aucun serveur configuré."));
|
||||
if ui.button(t!("Configurer le serveur")).clicked() {
|
||||
self.tab = Tab::Settings;
|
||||
}
|
||||
});
|
||||
@@ -414,7 +419,7 @@ impl Gui {
|
||||
egui::Panel::left("apps").resizable(false).exact_size(180.0).show(ui, |ui| {
|
||||
ui.add_space(6.0);
|
||||
let total = self.messages.len();
|
||||
if ui.selectable_label(self.filter.is_none(), format!("Toutes ({total})")).clicked() {
|
||||
if ui.selectable_label(self.filter.is_none(), tf!("Toutes ({})", total)).clicked() {
|
||||
self.filter = None;
|
||||
self.confirm_delete = false;
|
||||
}
|
||||
@@ -437,7 +442,7 @@ impl Gui {
|
||||
self.confirm_delete = false;
|
||||
}
|
||||
r.context_menu(|ui| {
|
||||
let txt = if muted { "Réactiver les notifications" } else { "Couper les notifications" };
|
||||
let txt = if muted { t!("Réactiver les notifications") } else { t!("Couper les notifications") };
|
||||
if ui.button(txt).clicked() {
|
||||
if muted {
|
||||
self.cfg.muted_apps.retain(|a| *a != id);
|
||||
@@ -453,8 +458,8 @@ impl Gui {
|
||||
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.add(egui::TextEdit::singleline(&mut self.search).hint_text("🔍 Rechercher…").desired_width(220.0));
|
||||
if ui.add_enabled(!self.loading, egui::Button::new("⟳ Actualiser")).clicked() {
|
||||
ui.add(egui::TextEdit::singleline(&mut self.search).hint_text(t!("🔍 Rechercher…")).desired_width(220.0));
|
||||
if ui.add_enabled(!self.loading, egui::Button::new(t!("⟳ Actualiser"))).clicked() {
|
||||
self.reload(false);
|
||||
}
|
||||
if self.loading {
|
||||
@@ -462,14 +467,14 @@ impl Gui {
|
||||
}
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
let what = match self.filter {
|
||||
Some(a) => format!("les messages de {}", self.app_name(a)),
|
||||
None => "tous les messages".into(),
|
||||
Some(a) => tf!("les messages de {}", self.app_name(a)),
|
||||
None => t!("tous les messages").into(),
|
||||
};
|
||||
if self.confirm_delete {
|
||||
if ui.button("Annuler").clicked() {
|
||||
if ui.button(t!("Annuler")).clicked() {
|
||||
self.confirm_delete = false;
|
||||
}
|
||||
if ui.button(RichText::new("Supprimer").color(Color32::from_rgb(220, 70, 70))).clicked() {
|
||||
if ui.button(RichText::new(t!("Supprimer")).color(Color32::from_rgb(220, 70, 70))).clicked() {
|
||||
self.confirm_delete = false;
|
||||
let app = self.filter;
|
||||
self.job(move |c| match app {
|
||||
@@ -477,8 +482,8 @@ impl Gui {
|
||||
None => c.delete_all().map(|_| Done::DeletedMany(None)).unwrap_or_else(Done::Error),
|
||||
});
|
||||
}
|
||||
ui.label(format!("Supprimer {what} du serveur ?"));
|
||||
} else if ui.button("🗑 Tout supprimer").on_hover_text(format!("Supprime {what} du serveur")).clicked() {
|
||||
ui.label(tf!("Supprimer {} du serveur ?", what));
|
||||
} else if ui.button(t!("🗑 Tout supprimer")).on_hover_text(tf!("Supprime {} du serveur", what)).clicked() {
|
||||
self.confirm_delete = true;
|
||||
}
|
||||
});
|
||||
@@ -504,14 +509,14 @@ impl Gui {
|
||||
egui::ScrollArea::vertical().auto_shrink(false).show(ui, |ui| {
|
||||
if list.is_empty() && !self.loading {
|
||||
ui.add_space(30.0);
|
||||
ui.vertical_centered(|ui| ui.weak("Aucun message"));
|
||||
ui.vertical_centered(|ui| ui.weak(t!("Aucun message")));
|
||||
}
|
||||
for m in &list {
|
||||
self.message_card(ui, m);
|
||||
}
|
||||
if self.next_since.is_some() && self.search.is_empty() {
|
||||
ui.vertical_centered(|ui| {
|
||||
if ui.add_enabled(!self.loading, egui::Button::new("Charger plus")).clicked() {
|
||||
if ui.add_enabled(!self.loading, egui::Button::new(t!("Charger plus"))).clicked() {
|
||||
self.reload(true);
|
||||
}
|
||||
});
|
||||
@@ -536,9 +541,9 @@ impl Gui {
|
||||
ui.add(egui::Image::from_texture(&t).fit_to_exact_size(egui::vec2(22.0, 22.0)).corner_radius(5));
|
||||
}
|
||||
ui.label(RichText::new(self.app_name(m.appid).to_string()).strong());
|
||||
ui.label(RichText::new(format!("P{p}")).small().color(accent)).on_hover_text("Priorité");
|
||||
ui.label(RichText::new(format!("P{p}")).small().color(accent)).on_hover_text(t!("Priorité"));
|
||||
ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {
|
||||
if ui.small_button("🗑").on_hover_text("Supprimer du serveur").clicked() {
|
||||
if ui.small_button("🗑").on_hover_text(t!("Supprimer du serveur")).clicked() {
|
||||
let id = m.id;
|
||||
self.job(move |c| c.delete_message(id).map(|_| Done::Deleted(id)).unwrap_or_else(Done::Error));
|
||||
}
|
||||
@@ -568,7 +573,7 @@ impl Gui {
|
||||
.corner_radius(6)
|
||||
.sense(egui::Sense::click()),
|
||||
);
|
||||
if r.on_hover_text("Ouvrir l'image").clicked() {
|
||||
if r.on_hover_text(t!("Ouvrir l'image")).clicked() {
|
||||
sys::open_url(&url);
|
||||
}
|
||||
}
|
||||
@@ -576,7 +581,7 @@ impl Gui {
|
||||
ui.spinner();
|
||||
}
|
||||
_ => {
|
||||
if ui.link("🖼 Image jointe (non chargée)").clicked() {
|
||||
if ui.link(t!("🖼 Image jointe (non chargée)")).clicked() {
|
||||
sys::open_url(&url);
|
||||
}
|
||||
}
|
||||
@@ -592,22 +597,22 @@ impl Gui {
|
||||
egui::CentralPanel::default().show(ui, |ui| {
|
||||
egui::ScrollArea::vertical().auto_shrink(false).show(ui, |ui| {
|
||||
ui.set_max_width(640.0);
|
||||
section(ui, "Serveur");
|
||||
section(ui, t!("Serveur"));
|
||||
egui::Grid::new("srv").num_columns(2).spacing([12.0, 8.0]).show(ui, |ui| {
|
||||
ui.label("URL");
|
||||
ui.label(t!("URL"));
|
||||
ui.horizontal(|ui| {
|
||||
ui.add(egui::TextEdit::singleline(&mut self.url_edit).hint_text("https://gotify.exemple.fr").desired_width(320.0));
|
||||
if ui.small_button("📋 Coller").on_hover_text("Coller depuis le presse-papiers").clicked() {
|
||||
ui.add(egui::TextEdit::singleline(&mut self.url_edit).hint_text(t!("https://gotify.exemple.fr")).desired_width(320.0));
|
||||
if ui.small_button(t!("📋 Coller")).on_hover_text(t!("Coller depuis le presse-papiers")).clicked() {
|
||||
if let Some(t) = sys::clipboard_text() {
|
||||
self.url_edit = t;
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.end_row();
|
||||
ui.label("Token client");
|
||||
ui.label(t!("Token client"));
|
||||
ui.horizontal(|ui| {
|
||||
ui.add(egui::TextEdit::singleline(&mut self.token_edit).password(!self.show_token).desired_width(320.0));
|
||||
if ui.small_button("📋 Coller").on_hover_text("Coller depuis le presse-papiers").clicked() {
|
||||
if ui.small_button(t!("📋 Coller")).on_hover_text(t!("Coller depuis le presse-papiers")).clicked() {
|
||||
if let Some(t) = sys::clipboard_text() {
|
||||
self.token_edit = t;
|
||||
}
|
||||
@@ -618,17 +623,17 @@ impl Gui {
|
||||
});
|
||||
ui.end_row();
|
||||
});
|
||||
ui.weak("Dans l'interface web Gotify : Clients → Créer un client, puis copiez son token (pas un token d'application).");
|
||||
ui.weak(t!("Dans l'interface web Gotify : Clients → Créer un client, puis copiez son token (pas un token d'application)."));
|
||||
ui.horizontal(|ui| {
|
||||
let changed = gotify::normalize_url(&self.url_edit) != self.cfg.server_url || self.token_edit.trim() != self.cfg.token;
|
||||
if ui.add_enabled(!self.testing, egui::Button::new(if changed { "Enregistrer et connecter" } else { "Tester la connexion" })).clicked() {
|
||||
if ui.add_enabled(!self.testing, egui::Button::new(if changed { t!("Enregistrer et connecter") } else { t!("Tester la connexion") })).clicked() {
|
||||
self.cfg.server_url = gotify::normalize_url(&self.url_edit);
|
||||
self.url_edit = self.cfg.server_url.clone();
|
||||
self.cfg.token = self.token_edit.trim().to_string();
|
||||
self.testing = true;
|
||||
self.test = None;
|
||||
self.job(|c| {
|
||||
Done::Test(c.version().and_then(|v| c.current_user().map(|u| format!("Connecté en tant que « {} » — Gotify {}", u.name, v.version))))
|
||||
Done::Test(c.version().and_then(|v| c.current_user().map(|u| tf!("Connecté en tant que « {} » — Gotify {}", u.name, v.version))))
|
||||
});
|
||||
}
|
||||
if self.testing {
|
||||
@@ -644,29 +649,29 @@ impl Gui {
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
ui.checkbox(&mut self.cfg.accept_invalid_certs, "Accepter les certificats non valides (auto-signés)")
|
||||
.on_hover_text("À éviter : préférez installer votre autorité de certification dans Windows.");
|
||||
ui.checkbox(&mut self.cfg.accept_invalid_certs, t!("Accepter les certificats non valides (auto-signés)"))
|
||||
.on_hover_text(t!("À éviter : préférez installer votre autorité de certification dans Windows."));
|
||||
|
||||
section(ui, "Notifications");
|
||||
ui.checkbox(&mut self.cfg.notifications, "Afficher les notifications Windows");
|
||||
section(ui, t!("Notifications"));
|
||||
ui.checkbox(&mut self.cfg.notifications, t!("Afficher les notifications Windows"));
|
||||
ui.add_enabled_ui(self.cfg.notifications, |ui| {
|
||||
ui.checkbox(&mut self.cfg.sound, "Jouer un son");
|
||||
ui.checkbox(&mut self.cfg.sound, t!("Jouer un son"));
|
||||
egui::Grid::new("prio").num_columns(2).spacing([12.0, 8.0]).show(ui, |ui| {
|
||||
ui.label("Ignorer en dessous de la priorité");
|
||||
ui.label(t!("Ignorer en dessous de la priorité"));
|
||||
ui.add(egui::Slider::new(&mut self.cfg.min_priority, 0..=10));
|
||||
ui.end_row();
|
||||
ui.label("Bannière à partir de la priorité")
|
||||
.on_hover_text("En dessous : discret, directement dans le centre de notifications.");
|
||||
ui.label(t!("Bannière à partir de la priorité"))
|
||||
.on_hover_text(t!("En dessous : discret, directement dans le centre de notifications."));
|
||||
ui.add(egui::Slider::new(&mut self.cfg.banner_min_priority, 0..=10));
|
||||
ui.end_row();
|
||||
ui.label("Reste affichée à partir de la priorité")
|
||||
.on_hover_text("La notification reste à l'écran jusqu'à ce que vous la fermiez.");
|
||||
ui.add(egui::Slider::new(&mut self.cfg.sticky_min_priority, 0..=11).custom_formatter(|v, _| if v > 10.0 { "jamais".into() } else { format!("{v}") }));
|
||||
ui.label(t!("Reste affichée à partir de la priorité"))
|
||||
.on_hover_text(t!("La notification reste à l'écran jusqu'à ce que vous la fermiez."));
|
||||
ui.add(egui::Slider::new(&mut self.cfg.sticky_min_priority, 0..=11).custom_formatter(|v, _| if v > 10.0 { t!("jamais").to_string() } else { format!("{v}") }));
|
||||
ui.end_row();
|
||||
});
|
||||
ui.checkbox(&mut self.cfg.catch_up, "Afficher les messages manqués à la reconnexion");
|
||||
ui.checkbox(&mut self.cfg.catch_up, t!("Afficher les messages manqués à la reconnexion"));
|
||||
if !self.apps.is_empty() {
|
||||
ui.collapsing("Notifications par application", |ui| {
|
||||
ui.collapsing(t!("Notifications par application"), |ui| {
|
||||
for a in &self.apps {
|
||||
let mut on = !self.cfg.muted_apps.contains(&a.id);
|
||||
if ui.checkbox(&mut on, &a.name).changed() {
|
||||
@@ -681,16 +686,16 @@ impl Gui {
|
||||
}
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("🔔 Envoyer une notification de test").clicked() {
|
||||
if ui.button(t!("🔔 Envoyer une notification de test")).clicked() {
|
||||
send_test_toast(self.cfg.sound);
|
||||
}
|
||||
if ui.button("Paramètres de notification Windows…").on_hover_text("Style des bannières, écran de verrouillage, Ne pas déranger…").clicked() {
|
||||
if ui.button(t!("Paramètres de notification Windows…")).on_hover_text(t!("Style des bannières, écran de verrouillage, Ne pas déranger…")).clicked() {
|
||||
sys::open_url("ms-settings:notifications");
|
||||
}
|
||||
});
|
||||
ui.weak("Gotify Lite n'apparaît dans les paramètres Windows qu'après sa première notification.");
|
||||
ui.weak(t!("Gotify Lite n'apparaît dans les paramètres Windows qu'après sa première notification."));
|
||||
|
||||
section(ui, "Silence");
|
||||
section(ui, t!("Silence"));
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
let now = sys::now_unix();
|
||||
for (label, mins) in [("30 min", 30u64), ("1 h", 60), ("4 h", 240), ("8 h", 480)] {
|
||||
@@ -698,46 +703,60 @@ impl Gui {
|
||||
self.cfg.mute_until = now + mins * 60;
|
||||
}
|
||||
}
|
||||
if ui.button("Indéfiniment").clicked() {
|
||||
if ui.button(t!("Indéfiniment")).clicked() {
|
||||
self.cfg.mute_until = MUTE_FOREVER;
|
||||
}
|
||||
if ui.add_enabled(self.cfg.manual_mute_active(now), egui::Button::new("Réactiver")).clicked() {
|
||||
if ui.add_enabled(self.cfg.manual_mute_active(now), egui::Button::new(t!("Réactiver"))).clicked() {
|
||||
self.cfg.mute_until = 0;
|
||||
}
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
ui.horizontal(|ui| {
|
||||
ui.checkbox(&mut self.cfg.quiet_enabled, "Heures calmes chaque jour de");
|
||||
ui.checkbox(&mut self.cfg.quiet_enabled, t!("Heures calmes chaque jour de"));
|
||||
ui.add_enabled_ui(self.cfg.quiet_enabled, |ui| {
|
||||
time_edit(ui, &mut self.cfg.quiet_start);
|
||||
ui.label("à");
|
||||
ui.label(t!("à"));
|
||||
time_edit(ui, &mut self.cfg.quiet_end);
|
||||
});
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Pendant un silence, laisser passer à partir de la priorité");
|
||||
ui.add(egui::Slider::new(&mut self.cfg.silence_bypass_priority, 0..=11).custom_formatter(|v, _| if v > 10.0 { "jamais".into() } else { format!("{v}") }));
|
||||
ui.label(t!("Pendant un silence, laisser passer à partir de la priorité"));
|
||||
ui.add(egui::Slider::new(&mut self.cfg.silence_bypass_priority, 0..=11).custom_formatter(|v, _| if v > 10.0 { t!("jamais").to_string() } else { format!("{v}") }));
|
||||
});
|
||||
ui.weak("En silence, les messages arrivent quand même dans le centre de notifications, sans son ni bannière.");
|
||||
ui.weak(t!("En silence, les messages arrivent quand même dans le centre de notifications, sans son ni bannière."));
|
||||
|
||||
section(ui, "Général");
|
||||
if ui.checkbox(&mut self.autostart, "Lancer au démarrage de Windows").changed() {
|
||||
section(ui, t!("Général"));
|
||||
if ui.checkbox(&mut self.autostart, t!("Lancer au démarrage de Windows")).changed() {
|
||||
sys::set_autostart(self.autostart);
|
||||
self.autostart = sys::autostart_enabled();
|
||||
}
|
||||
ui.checkbox(&mut self.cfg.show_images, "Afficher les images (icônes des applications, images jointes)");
|
||||
ui.checkbox(&mut self.cfg.show_images, t!("Afficher les images (icônes des applications, images jointes)"));
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Thème");
|
||||
ui.selectable_value(&mut self.cfg.theme, "system".to_string(), "Système");
|
||||
ui.selectable_value(&mut self.cfg.theme, "light".to_string(), "☀ Clair");
|
||||
ui.selectable_value(&mut self.cfg.theme, "dark".to_string(), "🌙 Sombre");
|
||||
ui.label(t!("Thème"));
|
||||
ui.selectable_value(&mut self.cfg.theme, "system".to_string(), t!("Système"));
|
||||
ui.selectable_value(&mut self.cfg.theme, "light".to_string(), t!("☀ Clair"));
|
||||
ui.selectable_value(&mut self.cfg.theme, "dark".to_string(), t!("🌙 Sombre"));
|
||||
});
|
||||
if self.daemon_running && ui.button("Arrêter le service de fond").clicked() {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(t!("Langue"));
|
||||
let current = if self.cfg.language == "auto" {
|
||||
t!("Automatique (Windows)").to_string()
|
||||
} else {
|
||||
crate::i18n::LANGUAGES.iter().find(|(c, _)| *c == self.cfg.language).map(|(_, n)| n.to_string()).unwrap_or_default()
|
||||
};
|
||||
egui::ComboBox::from_id_salt("lang").selected_text(current).show_ui(ui, |ui| {
|
||||
ui.selectable_value(&mut self.cfg.language, "auto".to_string(), t!("Automatique (Windows)"));
|
||||
for (code, name) in crate::i18n::LANGUAGES {
|
||||
ui.selectable_value(&mut self.cfg.language, code.to_string(), name);
|
||||
}
|
||||
});
|
||||
});
|
||||
if self.daemon_running && ui.button(t!("Arrêter le service de fond")).clicked() {
|
||||
sys::stop_daemon();
|
||||
}
|
||||
self.data_section(ui);
|
||||
ui.add_space(8.0);
|
||||
ui.weak(format!("Gotify Lite {} · réglages enregistrés automatiquement", env!("CARGO_PKG_VERSION")));
|
||||
ui.weak(tf!("Gotify Lite {} · réglages enregistrés automatiquement", env!("CARGO_PKG_VERSION")));
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -769,21 +788,21 @@ fn install_system_fonts(ctx: &egui::Context) {
|
||||
|
||||
impl Gui {
|
||||
fn data_section(&mut self, ui: &mut egui::Ui) {
|
||||
section(ui, "Dossier des données");
|
||||
section(ui, t!("Dossier des données"));
|
||||
let custom = sys::custom_data_dir();
|
||||
let current = sys::local_dir();
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.label("Emplacement :");
|
||||
ui.label(t!("Emplacement :"));
|
||||
ui.monospace(current.display().to_string());
|
||||
if custom.is_none() {
|
||||
ui.weak("(par défaut)");
|
||||
ui.weak(t!("(par défaut)"));
|
||||
}
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("📂 Ouvrir").clicked() {
|
||||
if ui.button(t!("📂 Ouvrir")).clicked() {
|
||||
sys::open_url(¤t.display().to_string());
|
||||
}
|
||||
if ui.add_enabled(!self.picking, egui::Button::new("Changer…")).clicked() {
|
||||
if ui.add_enabled(!self.picking, egui::Button::new(t!("Changer…"))).clicked() {
|
||||
self.picking = true;
|
||||
let (tx, ctx, start) = (self.tx.clone(), self.ctx.clone(), current.clone());
|
||||
std::thread::spawn(move || {
|
||||
@@ -791,22 +810,22 @@ impl Gui {
|
||||
ctx.request_repaint();
|
||||
});
|
||||
}
|
||||
if custom.is_some() && ui.button("Revenir à l'emplacement par défaut").clicked() {
|
||||
self.data_msg = Some(sys::migrate_data(None).map(|p| format!("Données déplacées vers {}", p.display())));
|
||||
if custom.is_some() && ui.button(t!("Revenir à l'emplacement par défaut")).clicked() {
|
||||
self.data_msg = Some(sys::migrate_data(None).map(|p| tf!("Données déplacées vers {}", p.display())));
|
||||
}
|
||||
});
|
||||
if let Some(target) = self.pending_dir.clone() {
|
||||
// Un sous-dossier dédié évite de mélanger nos fichiers avec d'autres.
|
||||
let target = if target.file_name().is_some_and(|n| n.eq_ignore_ascii_case("GotifyLite")) { target } else { target.join("GotifyLite") };
|
||||
egui::Frame::group(ui.style()).show(ui, |ui| {
|
||||
ui.label(format!("Déplacer les réglages, l'historique local et les icônes vers :\n{}", target.display()));
|
||||
ui.label(tf!("Déplacer les réglages, l'historique local et les icônes vers :\n{}", target.display()));
|
||||
ui.horizontal(|ui| {
|
||||
if ui.button("Déplacer les données").clicked() {
|
||||
self.data_msg = Some(sys::migrate_data(Some(target.clone())).map(|p| format!("Données déplacées vers {}", p.display())));
|
||||
if ui.button(t!("Déplacer les données")).clicked() {
|
||||
self.data_msg = Some(sys::migrate_data(Some(target.clone())).map(|p| tf!("Données déplacées vers {}", p.display())));
|
||||
self.pending_dir = None;
|
||||
self.cfg_mtime = Config::mtime();
|
||||
}
|
||||
if ui.button("Annuler").clicked() {
|
||||
if ui.button(t!("Annuler")).clicked() {
|
||||
self.pending_dir = None;
|
||||
}
|
||||
});
|
||||
@@ -821,7 +840,7 @@ impl Gui {
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
ui.weak("Le token reste chiffré pour votre session Windows : il n'est utilisable que par votre compte.");
|
||||
ui.weak(t!("Le token reste chiffré pour votre session Windows : il n'est utilisable que par votre compte."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -892,8 +911,8 @@ impl eframe::App for Gui {
|
||||
.inner_margin(egui::Margin::symmetric(10, 6))
|
||||
.show(ui, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(format!("⚠ {} : aucune bannière ne peut s'afficher.", self.state.toasts_blocked));
|
||||
if ui.button("Ouvrir les paramètres Windows").clicked() {
|
||||
ui.label(tf!("⚠ {} : aucune bannière ne peut s'afficher.", crate::i18n::t(&self.state.toasts_blocked)));
|
||||
if ui.button(t!("Ouvrir les paramètres Windows")).clicked() {
|
||||
sys::open_url("ms-settings:notifications");
|
||||
}
|
||||
});
|
||||
@@ -912,8 +931,8 @@ fn send_test_toast(sound: bool) {
|
||||
let icon = sys::local_dir().join("icon.png");
|
||||
sys::register_app(&icon);
|
||||
crate::notify::Notifier::new().show(&crate::notify::Toast {
|
||||
title: "Notification de test",
|
||||
body: "Gotify Lite fonctionne : les messages de votre serveur s'afficheront ainsi.",
|
||||
title: t!("Notification de test"),
|
||||
body: t!("Gotify Lite fonctionne : les messages de votre serveur s'afficheront ainsi."),
|
||||
app_name: sys::APP_NAME,
|
||||
icon: icon.exists().then_some(icon.as_path()),
|
||||
launch: "gotify-lite:open",
|
||||
|
||||
Reference in new issue
Block a user