PhoenixKit 1.7.116: Sign-in works again on multilingual sites
PhoenixKit 1.7.116 fixes sign-in on multilingual sites that keep the default setting, where the primary language has a prefix in its addresses.
A form sent to an address like /en/users/log-in was redirected to the same address without /en, and the redirect dropped the form data, so signing in failed. That redirect now happens only when the site is set to leave the prefix off its primary language. An unknown language in an address is now replaced by the primary language’s prefix, or removed when the site uses no prefix.
The static pages and posts in the sitemap follow the same setting; before, they always listed /en/.... Language menus show English instead of English (United States) when only one kind of English is enabled, and keep the country when two are. Etcher moves to 0.4.0.
Full release notes: PhoenixKit 1.7.116
1.7.116 · 20 May 2026
Added
Languages.prefixless_primary_safe?/0— boot- and mix-task-safe wrapper arounddefault_language_no_prefix?/0. Returnsfalseduring mix-task context (via the same:phoenix_kit_config_statussentinelRoutes.path/1uses) and rescues any other lookup exception tofalse. Use from boot/middleware contexts where the Settings table may not be reachable;default_language_no_prefix?/0remains the runtime entry point.Routes.path/1andPhoenixKitWeb.Users.Authnow both delegate to this canonical implementation (PR #554).PhoenixKit.Modules.Sitemap.LocalePath— sharedemit_prefix?/2decision rule for the three sitemap sources (publishing,static,posts). Each source still owns its segment formatting (display code with hreflang awareness for publishing, base code for static + posts); the module owns only the decision so the policy stays consistent across sources (PR #554).DialectMapper.group_dialects_by_base/1— counts sibling dialects per base language code. Used by the language switcher and admin/user nav dropdowns to decide whether to show a country qualifier (PR #555).LanguageSwitcher.dedupe_names/1+extract_base_language_name/1— public helpers called fromAdminNavandUserDashboardNavso all language menus share one country-qualifier dedup rule (PR #555).
Changed
- Frontend language switcher (
PhoenixKitWeb.Components.Core.LanguageSwitcher’s dropdown + continent-grouped views) now drops the country qualifier from rendered labels when only one dialect of a given base language is enabled.English (United States),Estonian (Estonia),French (France)render asEnglish,Estonian,Frenchwhenever no sibling dialect is configured; enabling a second dialect of the same base (e.g.en-US+en-GB) causes those entries to reacquire the country qualifier so they remain distinguishable. Same rule applies in the admin top-bar dropdown and user dashboard nav. Continent-grouped views compute sibling counts globally across all enabled languages, so a base split across continents keeps its qualifier in both groups. Restores the bare-label rendering that was lost when commitd1c2d577rewrote the switcher to one-row-per-dialect (PR #555). - Sitemap sources
publishing,static, andpostsshare oneLocalePath.emit_prefix?/2decision rule instead of three byte-identical copies; three near-identical privatesingle_language_mode?/0helpers collapse into one defensive lookup onLocalePath(PR #554). redirect_invalid_locale/2honors the site-widedefault_language_no_prefixsetting. With the setting OFF (default), an invalid locale segment is swapped for the primary base code so the redirect lands on the canonical prefixed shape; with the setting ON, the segment is stripped entirely. Previously the plug always emitted the prefixless shape, which was inconsistent with how the rest of the app emits primary-language URLs when the setting is OFF (PR #554).- Dependency bumps:
etcher0.3.0 → 0.4.0,fresco0.5.2 → 0.5.3.
Fixed
- Login (and any other primary-language POST) no longer fails with the
default
default_language_no_prefixsetting.process_valid_locale/2was unconditionally 301-redirecting/<default>/...→/...for non-admin requests, discarding the POST body. The redirect is now gated onLanguages.prefixless_primary_safe?/0so the canonical primary shape matches whichever setting state the site is in (PR #554). - Sitemap sources
static.exandposts.exhonor the site-widedefault_language_no_prefixsetting for the primary language. Both had the same_is_defaultignored bug that PR #552 fixed in the publishing source — they previously emitted/en/aboutand/en/blog/postin multilang mode regardless of the setting (PR #554).
PhoenixKit 1.7.116. Install or update: {:phoenix_kit, "~> 1.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.