From 4f749d8bda4b16b6f535d2de97e99b473c8d2250 Mon Sep 17 00:00:00 2001
From: Yoshiki Iida <lhclrt176@gmail.com>
Date: Thu, 13 May 2021 17:39:20 +0900
Subject: [PATCH] fix replacement for plural message (#15988)

---
 bin/i18n/src/i18n/create_artifacts/frontend.clj       | 2 +-
 bin/i18n/test/i18n/create_artifacts/frontend_test.clj | 2 +-
 bin/i18n/test/i18n/create_artifacts/test_common.clj   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/i18n/src/i18n/create_artifacts/frontend.clj b/bin/i18n/src/i18n/create_artifacts/frontend.clj
index b3271a41675..dd94a35e7a8 100644
--- a/bin/i18n/src/i18n/create_artifacts/frontend.clj
+++ b/bin/i18n/src/i18n/create_artifacts/frontend.clj
@@ -28,7 +28,7 @@
                     [(->ttag-reference (:id message))
                      (if (:plural? message)
                        {:msgid_plural (:id-plural message)
-                        :msgstr       (:str-plural message)}
+                        :msgstr       (map ->ttag-reference (:str-plural message))}
                        {:msgstr [(->ttag-reference (:str message))]})])))
             messages)})
 
diff --git a/bin/i18n/test/i18n/create_artifacts/frontend_test.clj b/bin/i18n/test/i18n/create_artifacts/frontend_test.clj
index 93d623a6f38..a074159cfd6 100644
--- a/bin/i18n/test/i18n/create_artifacts/frontend_test.clj
+++ b/bin/i18n/test/i18n/create_artifacts/frontend_test.clj
@@ -25,5 +25,5 @@
 
                           "${ 0 } Queryable Table"
                           {:msgid_plural "{0} Queryable Tables"
-                           :msgstr       ["{0] Tabla Consultable" "{0] Tablas consultables"]}}}}
+                           :msgstr       ["${ 0 } Tabla Consultable" "${ 0 } Tablas consultables"]}}}}
          (#'frontend/->i18n-map test-common/po-contents))))
diff --git a/bin/i18n/test/i18n/create_artifacts/test_common.clj b/bin/i18n/test/i18n/create_artifacts/test_common.clj
index 611442df4e5..01ade63706f 100644
--- a/bin/i18n/test/i18n/create_artifacts/test_common.clj
+++ b/bin/i18n/test/i18n/create_artifacts/test_common.clj
@@ -44,7 +44,7 @@
   {:id                "{0} Queryable Table"
    :id-plural         "{0} Queryable Tables"
    :str               nil
-   :str-plural        ["{0] Tabla Consultable" "{0] Tablas consultables"]
+   :str-plural        ["{0} Tabla Consultable" "{0} Tablas consultables"]
    :fuzzy?            false
    :plural?           true
    :source-references ["frontend/src/metabase/admin/datamodel/components/database/MetadataTableList.jsx:77"]
-- 
GitLab