Update logo, add translations and fix comments : Traduction FR/EN, toggle de langue, refonte des commentaires et corrections - #49
Merged
Conversation
…with a DJ‑style logo. The old SVG is removed and replaced by a JetBrains Mono “DJ” glyph on a #7C3AED background, giving the site a clean high‑contrast square icon
…ed: BlockNote runs in `fr`, backend errors use `gettext()`, and all frontend strings go through `_()`. Dates are fully locale‑aware via `format_datetime_locale`, replacing old English DTO formats. French `.po/.mo` files are stored under `translations/fr LC_MESSAGES/`, with tests for `_()`, the file adapter, and localized datetime formatting, plus final template/styletouch‑ups
… role labels now use `_(user.account_role)` with new `admin/author/user` entries, templates use `format_datetime_locale("d MMMM yyyy")` for locale‑aware dates, the missing self‑delete translation is fixed, the old `date_format_filter` is removed and the article list test expects "29 April 2026"
…with full coverage of remaining English toasts and code‑block UI strings. Code‑block labels now use `_()`, comment‑reply reads all texts from Jinja datasets, copy and editor scripts use `_t()`, ArticleForm wraps its upload error, seven missing keys are added to template JSON blocks and compiled, profile CSS gains `display:contents`, and profile‑avatar keeps its French hardcoded errors
…r SunEditor toolbar and emoji picker. The French lang pack `fr.js` is included and loaded before the editor init. `suneditor-init.js` adapts flat keys to nested ones, sets the `lang` option and wraps the emoji tooltip with `_t('Insert Emoji')`. The emoji picker now shows French categories, search text, and skin labels. `article_detail.html` includes the `Insert Emoji` key in its JSON block and the translation is added and compiled in `messages.po/.mo`
…or-init.js` with helper encapsulation, double‑tap fix and removal of debug logs. `_t` and `resolveLang` are moved into an IIFE to avoid globals, the double‑tap logic is split between desktop and mobile to prevent the line‑jump caused by corrupted selection, both tap timers reset on blur, indentation in the mapping loop is corrected and all `console.log` calls are removed
…r “Comment removed” and “Anonymous”. Display logic moves from the DTO to templates using `_()`. Checks for anonymous authors now rely on `*_id is none` instead of comparing the English string and templates render `{{ _('Anonymous') }}`. Tests are updated accordingly and translation files (`.po/.mo/.pot`) rebuilt
…BlockNote paste are fixed. Copy now uses a custom `copy` event with `execCommand('copy')`, letting BlockNote read `text/html`. The clipboard HTML includes a `<blocknote-block>` wrapper, trailing `<br>` is replaced with a zero‑width space, empty blocks still trigger the toast, a `!pre` guard protects `cloneNode`, copy failures show a translated “Failed to copy” and all debug code is removed
…atar updated. The hardcoded `A` initial is replaced with `?`, avoiding confusion with real user initials and matching the soft‑deleted comment avatar style. Change applied in `article_detail.html` at line 105
…d for remaining English strings. The 403/404/500 error messages are now wrapped in `_()` and translated. Role labels (`admin`/`author`/`user`) are restored from obsolete entries so `{{ _(role) }}` resolves correctly. “Please sign in to join the conversation” receives its missing French msgstr. Obsolete blocks are removed, six new msgids added to the `.pot`, and `.mo` recompiled
…g added to the user‑list jump input. `#jump-page-input.input-error` now gets the same red border and focus box‑shadow as the stepper controls, so an empty or invalid “Go” action shows a consistent error state in the user‑manager modal. Rules added directly in `user-list.css`
…he single main comment form with a simple toggle. All inline per‑comment forms are removed; clicking Reply or Edit activates the shared form and clicking again cancels it. Button text switches to “Cancel” / “Annuler”. Old CSS/JS tied to inline edit blocks is deleted, and `overflow-x: hidden` prevents the SunEditor toolbar from causing horizontal scroll at 360 px
…d, locale now stored in session and updated via POST `/lang/<locale>`, navbar gets a FR/EN switch styled like the theme toggle, session adapter gains `set_lang`, tests cover fr/en/invalid; translation templates updated
…done, the meta description in `article_list.html` and the lang‑toggle title in `base.html` are now wrapped in `_()` for proper i18n, the navbar language switch uses the translated “Switch language”, `user-list.css` gets `overflow-wrap: break-word` on `.user-card h1` with reduced padding at 30em to fix mobile overflow, new msgids extracted, updated, compiled
…fixed, parent removal now cascades to children instead of orphaning them. Migration V16 switches FK from ON DELETE SET NULL to ON DELETE CASCADE, the SQLAlchemy model sets `ondelete="CASCADE"` with an updated docstring, the service docstring reflects true hard‑delete semantics and integration tests validate the cascade on a full tree (P → A,B → C plus an unrelated branch)
…ved, Flask now auto‑reloads when `.mo` files are compiled thanks to `extra_files` watching the glob, vitest’s `execCommand` mock is fixed to dispatch a real `ClipboardEvent` with a `DataTransfer` object matching actual `code-copy.js` behavior, three tests updated accordingly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Traduction complète du blog (FR/EN), ajout d'un sélecteur de langue, refonte du système de commentaires (edit, soft-delete, cascade hard-delete) et correctifs divers.
🌍 Internationalisation (i18n)
gettext()côté serveur,_t()côté clienttranslations/fr/LC_MESSAGES/messages.po/.mo+messages.pot_(): flash messages, rôles, dates, erreurs 403/404/500fr.js)format_datetime_locale("d MMMM yyyy")test_template_helpers.py,test_lang_integration.py,frontend i18n.test.js🔤 Sélecteur de langue
/lang/<locale>avec CSRFlocale_selectorBabel💬 Refonte des commentaires
is_deleted=True, contenu préservé, arbre conservéedited_atON DELETE CASCADE— supprimer un parent supprime tous les descendants[deleted]+ "Comment removed" traduit🎨 CSS & UI
.input-errordansuser-list.cssoverflow-wrap: break-wordsur.user-card h1display: contentspour l'avatar (profile.css)overflow-x: hiddenà 360px pour le formulaire SunEditor🐛 Corrections
execCommand('copy')+ fallback toast "Failed to copy"*_id is Noneplutôt que chaîne anglaiseconsole.logretirés desuneditor-init.jsdocument.execCommandmocké avecClipboardEvent+DataTransfer(Happy DOM natif), 3 tests alignés sur le comportement réel — 123 tests verts⚙️ Dev ergonomics
pybabel compile:extra_filessurveille les.mo— plus besoin de kill manuel