private function buildPath($domain, $locale)
{
$path = '/resources/translations/' . $locale . '/' . $domain . '.' . $locale . '.yml';
// If long locale dir doesn't exists try short locale and return it if that exists
if (strlen($locale) == 5 && !is_dir($this->app['resources']->getPath('apppath' . $path))) {
$paths = $this->buildPath($domain, substr($locale, 0, 2));
if (is_dir($paths[0])) {
return $paths;
}
}
return [$this->app['resources']->getPath('apppath' . $path), 'app' . $path];
}