]> git.agnieray.net Git - galette.git/commitdiff
Locale was not updated on translator
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 8 Jun 2020 06:49:02 +0000 (08:49 +0200)
committerJohan Cwiklinski <johan@x-tnd.be>
Tue, 16 Jun 2020 15:27:43 +0000 (17:27 +0200)
Translator is not set on tests

galette/lib/Galette/Core/I18n.php
galette/lib/Galette/Entity/Texts.php

index 8264aa55c7a4ec41cd5c4490e63f48869522ddae..cc0626eb368e80ef128f334c8dea1371b0b431ae 100644 (file)
@@ -125,6 +125,8 @@ class I18n
      */
     public function updateEnv()
     {
+        global $translator;
+
         setlocale(LC_ALL, $this->getLongID());
 
         if (
@@ -140,6 +142,9 @@ class I18n
             textdomain($domain);
             bind_textdomain_codeset($domain, 'UTF-8');
         }
+        if ($translator) {
+            $translator->setLocale($this->getLongID());
+        }
     }
 
     /**
index be07f0ebe3646b7e772e78c5d0f3f6873499cc7d..97e3e9289eb935c70c8f6b94a78c697225563859 100644 (file)
@@ -315,24 +315,6 @@ class Texts
         }
     }
 
-    /**
-     * Retrieve fields from database
-     *
-     * @deprecated Do not seem to be used as of 2013-07-16
-     *
-     * @return array
-     */
-    public static function getDbFields()
-    {
-        global $zdb;
-        $columns = $zdb->getColumns(self::TABLE);
-        $fields = array();
-        foreach ($columns as $col) {
-            $fields[] = $col->getName();
-        }
-        return $fields;
-    }
-
     /**
      * Initialize texts at install time
      *