Skip to content

Commit

Permalink
Merge pull request #244 from stadtluzern/translations-based-on-tenant…
Browse files Browse the repository at this point in the history
…-type

Use tenant_type for determining which tenant we are in
  • Loading branch information
carlobeltrame authored Dec 6, 2022
2 parents 93ee29b + 0729b6c commit 682ea1f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<h4><%= t("decidim.system.models.organization.fields.tenant_type") %></h4>
<div class="field">
<%= f.select :tenant_type,
[:deinklima],
[:dialogluzern, :deinklima, :gemeinsamerspace, :winterthur],
{ include_blank: t("decidim.system.organizations.tenant_type.none") },
{ multiple: false } %>
</div>
Expand Down
8 changes: 1 addition & 7 deletions config/initializers/decidim_ocl_customization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@
Decidim.config[:devise_custom_scope] = lambda { |org, base = nil|
base ||= %i[decidim_ocl devise]

org_scope =
case org.id
when 2 then :dialogluzern
when 7 then :deinklima
when 8 then :gemeinsamerspace
else :other
end
org_scope = (org.tenant_type || 'other').to_sym

# Ensure that the current tenant is using custom translations for the devise mails
base + [org_scope] if I18n.t(org_scope, scope: base, default: nil)
Expand Down

0 comments on commit 682ea1f

Please sign in to comment.