Wire core sidebar tabs to PhoenixKitWeb.Gettext for ru/et#529
Conversation
Phase 3 of the per-module i18n migration (Q7 deferred from PR BeamLabEU#522). All core admin sidebar tabs now carry gettext_backend: PhoenixKitWeb.Gettext so Tab.localized_label/1 can translate them at render time. Wired tabs: - admin_dashboard, admin_users (admin_tabs.ex explicit Tab literals) - admin_activity, admin_media (admin_tabs.ex explicit Tab literals) - admin_settings, admin_settings_media (admin_tabs.ex explicit Tab literals) - admin_subtab/8 helper already done by orchestrator (covers 13 subtabs) - admin_modules_page already done by orchestrator - dashboard_home, dashboard_settings (registry.ex user-dashboard defaults) - admin_jobs (jobs.ex Module.admin_tabs/0) Translation work (ru + et default.po): - Filled empty msgstr entries for: Permissions, Settings, Health, Integrations, Organization (both locales); Dashboard, Users, Roles, Sessions (et only — ru already had translations) - Appended 13 new entries each locale: Manage Users, Live Sessions, Referral Codes, Activity, Media, General, Authorization, Dimensions, Jobs, Languages, SEO, Sitemap, Home - Modules entry already added by orchestrator (ru only); added for et No @Version bump. No CHANGELOG entry (maintainer-owned).
- Drop phx-change from <form> — was duplicating the binding on the inner <input>, causing the same "search" event to fire twice in quick succession on each keystroke (input first, then form on the same change). Server did double work; payloads matched so no incorrect state, but redundant. - Add phx-target to <form> so phx-submit retargets correctly when the toolbar is rendered inside a LiveComponent. Latent bug — no in-tree consumer used target with on_submit, but the contract was broken for future ones. - Add 2 regression tests asserting phx-change appears exactly once and phx-target appears on both <form> and <input> in the form variant. Test count now 15 (was 13). Both issues surfaced in the self-review for PR BeamLabEU#529.
Self-review of PR BeamLabEU#529 archived to dev_docs/pull_requests per project convention. Verdict: APPROVE with NITPICKs. Two IMPROVEMENT-MEDIUM items (search_toolbar form variant double-binds phx-change; phx-target not propagated to <form>) were fixed in preceding commit dfc9123.
Resolved conflicts in priv/gettext/{et,ru}/LC_MESSAGES/default.po by taking
upstream/dev side. Rationale:
et:
- Sessions: Sessioonid (consistent with "Aktiivsed sessioonid")
- Settings: Seaded (consistent with rest of file)
- Health: Seisund (more semantic)
- Big block: upstream's gettext.extract already covered all admin_tabs.ex
msgids from PRs BeamLabEU#530/BeamLabEU#531 with matching translations; the orphan "Home"
entry added in this branch had no source reference (admin_dashboard
label is "Dashboard", not "Home") and was dropped.
ru:
- Permissions: Права (consistent with "Права для", "Права обновлены")
- Big block: same reasoning as et.
PR's gettext_backend wiring in admin_tabs.ex (8 tabs), registry.ex (2
tabs), and jobs.ex (1 tab) preserved by the merge.
All user-facing strings in the media browser (buttons, titles, tooltips, placeholders, empty states, flash notifications, and confirm dialogs) are now routed through gettext/ngettext. Russian and Estonian translations filled in (3-form and 2-form plurals respectively).
|
Additional commit Scope (out of the original PR description):
|
Post-merge review of the MediaBrowser i18n cherry-pick (
|
Fix MediaBrowser i18n review findings (follow-up to #529)
…iaBrowser i18n followup)
Brings main up to date with dev (102 commits) including: - PR BeamLabEU#529 sidebar i18n (merged via upstream) - PR BeamLabEU#532 MediaBrowser i18n followup (merged via upstream) - fix/orphan-query-publishing-versions
…sions These 4 admin_tabs.ex labels are translated via dynamic Gettext.dgettext/3 (not extracted by mix gettext.extract), so they must be added manually. They were originally in PR BeamLabEU#529 but got dropped during merge-conflict resolution when --theirs picked the upstream side (which didn't yet have these bare entries). Restoring with the translations from the original PR commit (43e528a).
Summary
Phase 3 of per-module i18n migration (Q7, deferred from PR #522). Core admin sidebar tabs now carry
gettext_backend: PhoenixKitWeb.GettextsoTab.localized_label/1translates them at render time — matching the behaviour already working for external module tabs (Newsletters, Billing, Emails, etc.).Changes
lib/phoenix_kit/dashboard/admin_tabs.exgettext_backend: PhoenixKitWeb.Gettextto 6 explicit%Tab{}literals::admin_dashboard,:admin_users,:admin_activity,:admin_media,:admin_settings,:admin_settings_mediaadmin_subtab/8helper (covers 13 subtabs) +:admin_modules_pagelib/phoenix_kit/dashboard/registry.exgettext_backend: PhoenixKitWeb.Gettextto user-dashboard defaults::dashboard_home,:dashboard_settingslib/phoenix_kit/jobs.exgettext_backend: PhoenixKitWeb.Gettextto:admin_jobsTabpriv/gettext/ru/LC_MESSAGES/default.popriv/gettext/et/LC_MESSAGES/default.poVerification
Verified live on decor_3d_print (port 4001) after
mix deps.compile phoenix_kit --force. Sample output underrulocale:Out of scope (separate follow-up sweeps)