Skip to content

Commit

Permalink
Added missing localizations (#10278)
Browse files Browse the repository at this point in the history
* added-missing-localizations

* test-fixes

* additional-localizations-added

* comment-edit/date-format

Co-authored-by: JoonasAapro <110532525+JoonasAapro@users.noreply.github.com>
  • Loading branch information
alecslupu and JoonasAapro committed Jan 30, 2023
1 parent 6849bad commit c5d4612
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
Expand Up @@ -20,7 +20,7 @@
<tbody>
<% timeline_entries.each do |timeline_entry| %>
<tr data-id="<%= timeline_entry.id %>">
<td><%= timeline_entry.entry_date %><br></td>
<td><%= l timeline_entry.entry_date, format: :decidim_short %><br></td>
<td><%= translated_attribute(timeline_entry.title) %></td>
<td class="table-list__actions">
<% if allowed_to? :update, :timeline_entry, timeline_entry: timeline_entry %>
Expand Down
Expand Up @@ -9,12 +9,12 @@
<div class="text-small card--meta">
<% if result.start_date %>
<strong><%= t("models.result.fields.start_date", scope: "decidim.accountability") %></strong>
<span><%= result.start_date %></span>
<span><%= l result.start_date, format: :short %></span>
<% end %>
<% if result.end_date %>
<strong><%= t("models.result.fields.end_date", scope: "decidim.accountability") %></strong>
<span><%= result.end_date %></span>
<span><%= l result.end_date, format: :short %></span>
<% end %>
<% if result.status %>
Expand Down
Expand Up @@ -29,7 +29,7 @@
<% end %>

<div class="publish-date">
<%= l initiative.published_at || initiative.created_at, format: "%d/%m/%Y" %>
<%= l initiative.published_at || initiative.created_at, format: :decidim_short %>
</div>
</div>
</div>
Expand Up @@ -12,14 +12,14 @@ module ParticipatoryProcessHelper
include Decidim::ResourceReferenceHelper

# Public: Returns the dates for a step in a readable format like
# "2016-01-01 - 2016-02-05".
# "01/01/2016 - 05/02/2016".
#
# participatory_process_step - The step to format to
#
# Returns a String with the formatted dates.
def step_dates(participatory_process_step)
dates = [participatory_process_step.start_date, participatory_process_step.end_date]
dates.map { |date| date ? localize(date.to_date, format: :default) : "?" }.join(" - ")
dates.map { |date| date ? l(date.to_date, format: :decidim_short) : "?" }.join(" - ")
end

# Public: Returns the path for the participatory process cta button
Expand Down
Expand Up @@ -20,7 +20,7 @@ module ParticipatoryProcesses
describe "when both dates are present" do
it "returns the formatted dates" do
result = helper.step_dates(participatory_process)
expect(result).to eq("2016-01-01 - 2016-02-05")
expect(result).to eq("01/01/2016 - 05/02/2016")
end
end

Expand All @@ -29,7 +29,7 @@ module ParticipatoryProcesses

it "fills it in with an interrogation mark" do
result = helper.step_dates(participatory_process)
expect(result).to eq("? - 2016-02-05")
expect(result).to eq("? - 05/02/2016")
end
end

Expand All @@ -38,7 +38,7 @@ module ParticipatoryProcesses

it "fills it in with an interrogation mark" do
result = helper.step_dates(participatory_process)
expect(result).to eq("2016-01-01 - ?")
expect(result).to eq("01/01/2016 - ?")
end
end
end
Expand Down

0 comments on commit c5d4612

Please sign in to comment.