Gets the relative file path using the template.

        @type domain: str
        @param domain: The domain

        @type locale: str
        @param locale: The locale

        @rtype: string
        @return: The relative file path
553803
def get_relative_path(self, domain, locale):
        
        return self.relative_path_template.format(
            domain=domain,
            locale=locale,
            extension=self.get_extension()
        )
664784
function getDomainsByPath(path) {
  var domain = fis.media().get('project.domain', {}),
    value = [];
  if (typeof domain === 'string') {
    value = domain.split(/\s*,\s*/);
  } else if (fis.util.is(domain, 'Array')) {
    value = domain;
  } else {
    fis.util.map(domain, function(pattern, domain) {
      if ((pattern === 'image' && fis.util.isImageFile(path)) || fis.util.glob(pattern, path)) {
        if (typeof domain === 'string') {
          value = domain.split(/\s*,\s*/);
        } else if (fis.util.is(domain, 'Array')) {
          value = domain;
        } else {
          fis.log.warning('invalid domain [' + domain + '] of [project.domain.' + pattern + ']');
        }
        return true;
      }
    });
  }
  return value;
}
649095
public function getTranslationsByLocalesAndDomains($locales, $domains)
    {
        $em = $this->getEntityManager();
        $qb = $em->createQueryBuilder();
        $qb
            ->select('t')
            ->from('KunstmaanTranslatorBundle:Translation', 't')
            ->andWhere('t.status != :statusstring')
            ->setParameter('statusstring', Translation::STATUS_DISABLED)
            ->orderBy('t.domain', 'ASC')
            ->addOrderBy('t.keyword', 'ASC');

        if (count($locales) > 0) {
            $qb->andWhere($qb->expr()->in('t.locale', $locales));
        }

        if (count($domains) > 0) {
            $qb->andWhere($qb->expr()->in('t.domain', $domains));
        }

        $result = $qb
            ->getQuery()
            ->getResult();

        return $result;
    }
866845
public com.google.protobuf.ByteString
      getDomainSocketPathBytes() {
    java.lang.Object ref = domainSocketPath_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      domainSocketPath_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
921399
def update(domain):
    
    translations_dir = _get_translations_dir()
    domain = _get_translations_domain(domain)
    pot = os.path.join(translations_dir, f'{domain}.pot')
    return _run(f'update -i {pot} -d {translations_dir} --domain={domain}')
1229745
public function pathToFile($file, $locale): string
    {
        return resource_path('lang'.DIRECTORY_SEPARATOR.(is_a($locale, Locale::class) ? $locale->iso6391() : $locale).DIRECTORY_SEPARATOR.$file.'.php');
    }
4402
public function translator(string $locale, string $domain, string $directory): ?TranslatorInterface
    {
        $class = GETTEXT_EXTENSION ? GettextTranslator::class : Translator::class;

        $previous = self::$translator;
        self::$translator = new $class($locale, $domain, $directory);

        if ($previous === null) {
            require __DIR__ . DIRECTORY_SEPARATOR . 'helpers.php';
        }

        $this->locale = $locale;

        return $previous;
    }
1235323
protected function getCatalogContent($locale, $domain) {
		$path = $this->getCatalogPath($locale, $domain);
		
		if (! is_file($path)) {
			return false;
		}
		
		if (! is_readable($path)) {
			throw new ReadError('Catalog file: "' . $path . '" exists but can\'t be read');
		}
		
		$result = file_get_contents($path);
		
		if ($result === false) {
			throw new ReadError('Error has occurred while reading the file: "' . $path . '"');
		}
		
		$this->lastFilePath = $path;
		
		return $result;
	}
603472
private String setCurrentFilename(String relativePathOrPackage, String filename, String domain) throws Exception {
        currentFullFilename = convertToFullFilename(relativePathOrPackage, filename, domain);
        return "";
    }
287865
public static function findDomainPath($string, $filePath)
    {
        $domains = Template::getDomains(TRUE);
        $filenamePath = null;
        if (!file_exists($filePath) && 0 < count($domains)) {
            foreach ($domains as $domain => $paths) {
                $domainFilename = str_replace($domain, $paths["public"], $string);
                if (file_exists($domainFilename)) {
                    $filenamePath = $domainFilename;
                    continue;
                }
            }
        }

        return $filenamePath;
    }
492592
def _root_domain():
    

    if not hasattr(env,'root_domain'):
        cwd = os.getcwd().split(os.sep)
        domain = ''
        #if the first env.host has a domain name then we'll use that
        #since there are no top level domains that have numbers in them we can test env.host

        username, host, port = normalize(env.hosts[0])
        if host[-1] in string.ascii_letters:
            domain_parts = env.host.split('.')
            length = len(domain_parts)
            if length==2:
                #assumes .com .net etc so we want the full hostname for the domain
                domain = host
            elif length==3 and len(domain_parts[-1])==2:
                #assume country tld so we want the full hostname for domain
                domain = host
            elif length >=3:
                #assume the first part is the hostname of the machine
                domain = '.'.join(domain[1:])
        #we'll just pick the first directory in the path which has a period.
        else:
            for d in cwd:
                if '.' in d: 
                    domain = d
        if not domain and env.INTERACTIVE:
            domain = prompt('Enter the root domain for this project ',default='example.com')
        else:
            domain = 'example.com'
        env.root_domain = domain
    return env.root_domain
1317337
public function instance($domain = 'app', $locale = null)
    {
        $locale = $locale ?: $this->locale;

        // The ID code is something like: 'en/system', 'en/app' or 'en/file_manager'
        $id = $locale .'/' .$domain;

        // Returns the Language domain instance, if it already exists.
        if (isset($this->instances[$id])) return $this->instances[$id];

        return $this->instances[$id] = new Language($this, $domain, $locale);
    }
617409
public function getResourcePaths($domain = null) {
        return isset($this->_paths[$domain]) ? $this->_paths[$domain] : $this->_paths;
    }
1228401
protected String convertToFullFilename(String relpath_or_package, String filename, String domain) throws Exception {

        if (relpath_or_package != null && ".".equals(relpath_or_package.trim())) {
            log.warn("******** BUG IN FilenameUtils ==============> " + normalize(relpath_or_package.replace('.', separatorChar) + separatorChar + filename));

            throw new Exception("not a good practice, please clean up your template relative path, you may set it to empty string... :" + relpath_or_package
                    + ", " + filename);
        }

        String ret;

        if (hasLength(relpath_or_package)) {
            ret = normalize(relpath_or_package.replace('.', separatorChar) + separatorChar + filename);
        } else {
            ret = filename;
        }

        if (hasLength(domain)) {
            return normalize(domain + File.separator + ret);
        } else {
            return ret;
        }
    }
135937
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,
        ];
    }
1174918
private String messageInvalidAliasPath(Locale locale) {

        return Messages.get().getBundle(locale).key(Messages.ERR_ALIAS_INVALID_ALIAS_PATH_0);
    }
169605
def get_url_path(self, language=None):
        
        if self.is_first_root():
            # this is used to allow users to change URL of the root
            # page. The language prefix is not usable here.
            try:
                return reverse('pages-root')
            except Exception:
                pass
        url = self.get_complete_slug(language)
        if not language:
            language = settings.PAGE_DEFAULT_LANGUAGE
        if settings.PAGE_USE_LANGUAGE_PREFIX:
            return reverse('pages-details-by-path',
                args=[language, url])
        else:
            return reverse('pages-details-by-path', args=[url])