Publishing 0.1.7: Editor no longer opens empty for regional languages
Publishing 0.1.7 fixes the post editor on sites that use a regional variant of a language, such as British English (en-GB) instead of en-US.
Opening a post with a plain language code in the address, such as ?lang=en, turned en into en-US, even when only en-GB was enabled. The editor then decided the post had no English version yet and opened an empty form for a new translation, although the English text existed.
Now a plain language code is matched to an enabled regional variant first. When several variants of the same language are enabled, the site’s primary language wins, otherwise the first one enabled. The editor checks the post’s existing translations the same way before it offers a new one, so the English post opens with its content.
Full release notes: Publishing 0.1.7
0.1.7 · 5 May 2026
PR #13 — fix issue #11 (editor opens blank for ?lang=<base> when only a non-default dialect is enabled) + PR-12 close-out + precommit nits.
Fixed
- Editor opened blank when
?lang=<base>mapped to a non-default dialect (Issue #11). Two-layer bug:Posts.resolve_language_to_dialect/1mapped"en"to the hard-codedDialectMapperdefault ("en-US") instead of an enabled dialect like"en-GB", andEditor.handle_uuid_post_params/3then ran a rawlanguage not in post.available_languagescheck which routed"en"against["en-GB", "ru"]intohandle_new_translation_params/6(empties the form). Fix at both layers — neither alone is sufficient. post_rendering_helpers_test.exs:74— stalebuild_breadcrumbs/3call site missed by the7f547b5(PR #12 cleanup) arity bump to/4. Now passes thegroup_namearg explicitly and asserts on the resulting label.
Changed
Posts.resolve_language_to_dialect/1— prefers an enabled dialect for the given base before falling back toDialectMapper.base_to_dialect/1. When several dialects share the base, prefersLanguageHelpers.get_primary_language/0, otherwise the first enabled dialect in declaration order. New private helperenabled_dialect_for_base/2.Editor.handle_uuid_post_params/3andEditor.handle_path_post_params/3— route through newnew_translation_request?/2helper that resolves the requested language againstpost.available_languagesviaWeb.Controller.Language.resolve_language_for_post/2before deciding new-vs-existing translation.test_helper.exs— swappedEcto.Migrator.run(TestRepo, [{0, PhoenixKit.Migration}], :up, ...)forPhoenixKit.Migration.ensure_current(TestRepo, log: false)(core 1.7.105+ / phoenix_kit#515). The version-0pattern silently stopped re-applying once0was recorded inschema_migrations;ensure_current/2re-applies via fresh wall-clock versions on every boot.StaleFixerTestswitched fromasync: true→async: false. Every test in the file mutates the sharedcontent_languagesetting (ETS-cached singleton); two parallel runs in the same VM clobbered each other and produced a 1-in-15 flake on:96 url slug lookup repairs legacy base-language slugs.- Bumped to
phoenix_kit ~> 1.7.105(required byMigration.ensure_current/2) andphoenix_kit_ai ~> 0.2.0. The latter tightened return types ofAI.list_endpoints/1andAI.list_prompts/1;Editor.Translation.list_ai_endpoints/0andlist_ai_prompts/0dropped now-dead_ -> []fallbacks.
Docs
- AGENTS.md gains a “Base→enabled-dialect resolution” Critical Conventions bullet documenting the resolver behavior, the editor-side contract, and the issue #11 reference.
dev_docs/pull_requests/2026/12-smart-fallback-fix/FOLLOW_UP.mdrecords resolution of the fourCLAUDE_REVIEW.mdfindings from PR #12 (3 fixed in7f547b5, 1 here) and closes the folder.dev_docs/pull_requests/2026/13-issue-11-resolver/CLAUDE_REVIEW.md— post-merge review.
Publishing 0.1.7. Install or update: {:phoenix_kit_publishing, "~> 0.1"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.