Unsupported expression Elixir.AshPostgres.SqlImplementation query: {:_context, :locale}

You can get the context from context.source_context[:locale], templates don’t work inside of calculations because you can interpolate the actual values you need.

Also, no need to specify def load, the expression figures it out for you.