]> _ Git - cubist_locale.git/commitdiff
wip #3262 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Dec 2019 18:00:12 +0000 (19:00 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 11 Dec 2019 18:00:12 +0000 (19:00 +0100)
src/LocalizedList.php

index c6467256789ff4434daff98be7893535e73071b4..9924b1e5fd7922385d6c5299e098142076a0cc70 100644 (file)
@@ -37,4 +37,13 @@ class LocalizedList
         $res = include $f;
         return $res;
     }
+
+    public static function translate($code, $locale)
+    {
+        $list = self::getList($locale);
+        if (isset($list[$code])) {
+            return $list[$code];
+        }
+        return null;
+    }
 }