Bolt\Translation\TranslationFile::buildPath PHP 메소드

buildPath() 개인적인 메소드

Get the path to a tranlsation resource.
private buildPath ( string $domain, string $locale ) : array
$domain string Requested resource
$locale string Requested locale
리턴 array [absolute path, relative 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['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];
    }