Browse Source

added transChoice function

Nicolas Assing 13 năm trước cách đây
mục cha
commit
56a7a5b416
1 tập tin đã thay đổi với 21 bổ sung0 xóa
  1. 21 0
      Admin/Admin.php

+ 21 - 0
Admin/Admin.php

@@ -1888,6 +1888,27 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         return $this->translator->trans($id, $parameters, $domain, $locale);
         return $this->translator->trans($id, $parameters, $domain, $locale);
     }
     }
 
 
+    /**
+     * translate a message id
+     *
+     * @param string $id
+     * @param array $parameters
+     * @param null $domain
+     * @param null $locale
+     * @return string the translated string
+     */
+    public function transChoice($id, $count, array $parameters = array(), $domain = null, $locale = null)
+    {
+        $domain = $domain ?: $this->translationDomain;
+
+        if (!$this->translator) {
+            return $id;
+        }
+
+        return $this->translator->transChoice($id, $count, $parameters, $domain, $locale);
+    }
+
+
     /**
     /**
      * set the translation domain
      * set the translation domain
      *
      *