From 5542fd2bce182e2ac42782d88d0c99fb15a31e3f Mon Sep 17 00:00:00 2001 From: rubynho Date: Tue, 12 Nov 2019 15:03:06 -0200 Subject: [PATCH] Pluralize notifier message when other than 1 Correctly pluralize the word point in the notification message based on the given possible points. --- app/views/notifier/gpx_success.html.erb | 5 ++++- config/locales/en.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/notifier/gpx_success.html.erb b/app/views/notifier/gpx_success.html.erb index 7601a621d..d9d184a6d 100644 --- a/app/views/notifier/gpx_success.html.erb +++ b/app/views/notifier/gpx_success.html.erb @@ -2,5 +2,8 @@

<%= render :partial => "gpx_description" %> - <%= t "notifier.gpx_notification.success.loaded_successfully", :trace_points => @trace_points, :possible_points => @possible_points %> + <%= t("notifier.gpx_notification.success.loaded_successfully", + :trace_points => @trace_points, + :possible_points => @possible_points, + :count => @possible_points) %>

diff --git a/config/locales/en.yml b/config/locales/en.yml index 917c06a95..92197f614 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1200,7 +1200,9 @@ en: import_failures_url: "https://wiki.openstreetmap.org/wiki/GPX_Import_Failures" success: subject: "[OpenStreetMap] GPX Import success" - loaded_successfully: loaded successfully with %{trace_points} out of a possible %{possible_points} points. + loaded_successfully: + one: loaded successfully with %{trace_points} out of a possible 1 point. + other: loaded successfully with %{trace_points} out of a possible %{possible_points} points. signup_confirm: subject: "[OpenStreetMap] Welcome to OpenStreetMap" greeting: "Hi there!" -- 2.39.5