Prechádzať zdrojové kódy

Merge pull request #553 from zouriteman/add-transchoice

added transChoice function
Thomas 13 rokov pred
rodič
commit
b9976c8482
1 zmenil súbory, kde vykonal 21 pridanie a 0 odobranie
  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);
     }
 
+    /**
+     * 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
      *