Commit 515da8cb authored by Decima's avatar Decima
Browse files

fix type error

No related merge requests found
Showing with 11 additions and 4 deletions
+11 -4
......@@ -23,13 +23,20 @@ class ZoneRepository extends \Doctrine\ORM\EntityRepository {
return $res[0];
}
$exp = explode("_", $locale);
}
}
private function searchLocale($locale) {
return $this->createQueryBuilder("z")->where("LOWER(z.locale) LIKE :locale")->setParameter("locale", strtolower($locale))->getQuery()->getResult();
return $this->createQueryBuilder("z")
->where("LOWER(z.locale) LIKE :locale")
->setParameter("locale", strtolower($locale))
->getQuery()
->useQueryCache(TRUE)
->useResultCache(TRUE)
->setResultCacheLifetime(100)
->getResult();
}
}
......@@ -53,8 +53,8 @@ class Translation {
if ($translated = $this->repository_translation->findOneBy(["translationKey" => $key, "locale" => $locale, "domain" => $domain])) {
return $translated->getTranslationValue();
} else {
if (count(explode("_", $locale)) > 1) {
$locale = $this->findLocale(implode("_", array_splice(explode("_", $locale), 0, -1)));
if (count(explode("_", $locale->getLocale())) > 1) {
$locale = $this->findLocale(implode("_", array_splice(explode("_", $locale->getLocale()), 0, -1)));
if ($locale) return $this->findTranslation($key, $locale, $domain);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment