Skip to content

Commit e3fdb71

Browse files
authored
Ensure election data is sent to BB in the default locale (decidim#7069)
1 parent dae70e3 commit e3fdb71

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

decidim-elections/app/commands/decidim/elections/admin/setup_election.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def call
3434

3535
attr_reader :form
3636

37-
delegate :election, :bulletin_board, to: :form
37+
delegate :election, :bulletin_board, :current_organization, to: :form
3838

3939
def questions
4040
@questions ||= election.questions
@@ -73,8 +73,8 @@ def election_data
7373
description: {
7474
name: {
7575
text: [{
76-
value: election.title[I18n.locale.to_s],
77-
language: I18n.locale.to_s
76+
value: election.title[current_organization.default_locale.to_s],
77+
language: current_organization.default_locale.to_s
7878
}]
7979
},
8080
start_date: election.start_time,
@@ -85,8 +85,8 @@ def election_data
8585
object_id: answer.id.to_s,
8686
ballot_name: {
8787
text: [{
88-
value: answer.title[I18n.locale.to_s],
89-
language: I18n.locale.to_s
88+
value: answer.title[current_organization.default_locale.to_s],
89+
language: current_organization.default_locale.to_s
9090
}]
9191
}
9292
}
@@ -98,19 +98,19 @@ def election_data
9898
object_id: question.id.to_s,
9999
sequence_order: question.weight,
100100
vote_variation: question.vote_variation,
101-
name: question.title[I18n.locale.to_s],
101+
name: question.title[current_organization.default_locale.to_s],
102102
number_elected: question.answers.count,
103103
votes_allowed: 1,
104104
ballot_title: {
105105
text: [{
106-
value: question.title[I18n.locale.to_s],
107-
language: I18n.locale.to_s
106+
value: question.title[current_organization.default_locale.to_s],
107+
language: current_organization.default_locale.to_s
108108
}]
109109
},
110110
ballot_subtitle: {
111111
text: [{
112-
value: question.description[I18n.locale.to_s],
113-
language: I18n.locale.to_s
112+
value: question.description[current_organization.default_locale.to_s],
113+
language: current_organization.default_locale.to_s
114114
}]
115115
},
116116
ballot_selections:

0 commit comments

Comments
 (0)