Skip to content

Remove the obsolete :apps option from the PutSession example - #23

Merged
kipcole9 merged 1 commit into
elixir-localize:mainfrom
rubas:fix/putsession-doc-apps
Sep 27, 2026
Merged

kipcole9 merged 1 commit into
elixir-localize:mainfrom
rubas:fix/putsession-doc-apps

Conversation

@rubas

@rubas rubas commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Before

The Localize.Plug.PutSession moduledoc example passes apps: to PutLocale:

plug Localize.Plug.PutLocale,
  apps: [:localize, :gettext],
  from: [:path, :query],
  gettext: MyApp.Gettext

Problem

  • PutLocale has no :apps option since "Modernize the plug config" (806f632). init/1 keeps unknown keys without a warning, so a copied example compiles and the option does nothing.

After

plug Localize.Plug.PutLocale,
  from: [:path, :query],
  gettext: MyApp.Gettext
Details

Docs only: lib/localize/plug/put_session.ex, moduledoc. I did not add a warning for unknown PutLocale options, because {Module, function} and {Module, function, args} sources receive the full options list and can read their own keys.

Checks: mix format --check-formatted clean, mix test 267 passed.


AI disclosure: AI models helped us find this issue, write the change, and review it.

@kipcole9
kipcole9 merged commit 6667819 into elixir-localize:main Sep 27, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants