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['path_resolver']->resolve('%root%/app' . $path))) {
            $paths = $this->buildPath($domain, substr($locale, 0, 2));

            if (is_dir($paths[0])) {
                return $paths;
            }
        }

        return [
            $this->app['path_resolver']->resolve('%root%/app' . $path),
            'app' . $path,
        ];
    }
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['path_resolver']->resolve('%root%/app' . $path))) {
            $paths = $this->buildPath($domain, substr($locale, 0, 2));

            if (is_dir($paths[0])) {
                return $paths;
            }
        }

        return [
            $this->app['path_resolver']->resolve('%root%/app' . $path),
            'app' . $path,
        ];
    }
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 [ 'path_resolver' ] -> resolve ( '%root%/app' . $ path ) ) ) { $ paths = $ this -> buildPath ( $ domain , substr ( $ locale , 0 , 2 ) ) ; if ( is_dir ( $ paths [ 0 ] ) ) { return $ paths ; } } return [ $ this -> app [ 'path_resolver' ] -> resolve ( '%root%/app' . $ path ) , 'app' . $ path , ] ; }
Get the path to a tranlsation resource.

@param string $domain Requested resource
@param string $locale Requested locale

@return array [absolute path, relative path]
Get the path to a tranlsation resource .