Using all language profiles from the given directory.
332790
private LanguageDetector makeDetector() throws IOException {
        double alpha = getParamDouble("alpha", DEFAULT_ALPHA);
        String profileDirectory = requireParamString("directory") + "/";
        Optional<Long> seed = Optional.fromNullable(getParamLongOrNull("seed"));

        List<LanguageProfile> languageProfiles = new LanguageProfileReader().readAll(new File(profileDirectory));

        return LanguageDetectorBuilder.create(NgramExtractors.standard())
                .alpha(alpha)
                .seed(seed)
                .shortTextAlgorithm(50)
                .withProfiles(languageProfiles)
                .build();
    }
715732
public static function getDefinedLanguages($dirs = null)
    {
        $dirs = $dirs ?: self::$config['dir'];
        $languages = array();
        foreach (array_filter(Atomik::path((array) $dirs)) as $dir) {
            if (is_dir($dir)) {
                foreach (new DirectoryIterator($dir) as $file) {
                    $filename = $file->getFilename();
                    if ($filename{0} == '.' || $file->isDir()) {
                        continue;
                    }
                    $languages[] = substr($filename, 0, strrpos($filename, '.'));
                }
            }
        }
        return $languages;
    }
1260314
def get_aliases(self, lang='en'):
        
        if self.fast_run:
            return list(self.fast_run_container.get_language_data(self.wd_item_id, lang, 'aliases'))

        alias_list = []
        if 'aliases' in self.wd_json_representation and lang in self.wd_json_representation['aliases']:
            for alias in self.wd_json_representation['aliases'][lang]:
                alias_list.append(alias['value'])

        return alias_list
1354591
def get_language_details(self, language):
        """"""
        for lang in self.user_data.languages:
            if language == lang['language_string']:
                return lang

        return {}
305823
private static Set<File> findAllFiles(File dir) {
        Set<File> foundFiles = new HashSet<>();
        if (dir == null) {
            return foundFiles;
        }
        recurse(dir, foundFiles);
        return foundFiles;
    }
707362
function prepareProfileDir(profilesDir, nick) {
  var nick = nick || '.tmp';
  // Just in case `nick` has any funny business...
  nick = nick.replace(/[^\w\d.]/g, '-').replace('..', '-');
  var profileDir = path.join(profilesDir, util.format('vox-%s', nick));
  debug('Ensuring directory at %s', profileDir);
  mkdirp.sync(profileDir, 0700);
  return profileDir;
}
24176
protected function InitLanguageFile()
    {
        if ($this->language == null)
            $this->language = new Language();

        $this->InitRecLanguageFile(get_class($this));
    }
251181
def assign_defaults(options)
      # Normalizes languages keys from symbols to strings
      normalize_language_keys(options)

      # Build a complete list of the required languages
      enabled_languages = detect_languages(options)

      # Get all languages used in existing settings
      (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
        current = options[key]
        next unless current && current.kind_of?(Hash)
        current.each do |language, value|
          enabled_languages << language unless enabled_languages.include?(language)
        end
      end

      # Check folder list (an empty folder signifies a language is required)
      ignore_validation = options[:ignore_language_directory_validation]
      Loader.language_folders(options[:metadata_path], ignore_validation).each do |lang_folder|
        next unless File.directory?(lang_folder) # We don't want to read txt as they are non localised
        language = File.basename(lang_folder)
        enabled_languages << language unless enabled_languages.include?(language)
      end

      return unless enabled_languages.include?("default")
      UI.message("Detected languages: " + enabled_languages.to_s)

      (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|
        current = options[key]
        next unless current && current.kind_of?(Hash)

        default = current["default"]
        next if default.nil?

        enabled_languages.each do |language|
          value = current[language]
          next unless value.nil?

          current[language] = default
        end
        current.delete("default")
      end
    end
1028515
def get_path(language):
  '''  '''
  filename = language.lower() + '.json'
  lang_file_path = os.path.join(_DEFAULT_DIR, filename)
  if not os.path.exists(lang_file_path):
    raise IOError('Could not find {} language file'.format(language))
  return lang_file_path
733435
def included_profiles(self):
        """"""
        profiles = []
        for directory in self.tcex_json.get('profile_include_dirs') or []:
            profiles.extend(self._load_config_include(directory))
        return profiles
34070
def all_languages():
    """"""

    rv = []

    for lang in os.listdir(localedir):
        base = lang.split('_')[0].split('.')[0].split('@')[0]
        if 2 <= len(base) <= 3 and all(c.islower() for c in base):
            if base != 'all':
                rv.append(lang)
    rv.sort()
    rv.append('en')
    l10n_log('Registered languages:', rv, lvl=verbose)

    return rv
556521
def get_profile_dir ():
    """"""
    basedir = unicode(os.environ["HOME"])
    return os.path.join(basedir, u"Library", u"Safari")
1361712
function getLanguageFilter(languageId) {
        return function languageFilter(file) {
            var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
            if (typeof languageId === "string") {
                return (id === languageId);
            } else {
                return (languageId.indexOf(id) !== -1);
            }
        };
    }
293443
public List<LanguageProfile> readAll(File path) throws IOException {
        if (!path.exists()) {
            throw new IOException("No such folder: "+path);
        }
        if (!path.canRead()) {
            throw new IOException("Folder not readable: "+path);
        }
        File[] listFiles = path.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                return looksLikeLanguageProfileFile(pathname);
            }
        });
        if (listFiles == null) {
            throw new IOException("Failed reading from folder: " + path);
        }

        List<LanguageProfile> profiles = new ArrayList<>(listFiles.length);
        for (File file: listFiles) {
            if (!looksLikeLanguageProfileFile(file)) {
                continue;
            }
            profiles.add(read(file));
        }
        return profiles;
    }
702057
def get_avaliable_languages(self, bundleId):
        """"""
        bundleData = self.__get_bundle_data(bundleId)

        if not bundleData:
            return []

        sourceLanguage = bundleData.get(self.__RESPONSE_SRC_LANGUAGE_KEY)
        languages = bundleData.get(self.__RESPONSE_TARGET_LANGUAGES_KEY)
        languages.append(sourceLanguage)

        return languages if languages else []
431498
protected static function loadAvailableLanguages()
    {
        $matches = array();
        foreach (glob(PHPCI_DIR . 'PHPCI/Languages/lang.*.php') as $file) {
            if (preg_match('/lang\.([a-z]{2}\-?[a-z]*)\.php/', $file, $matches)) {
                self::$languages[] = $matches[1];
            }
        }
    }
796866
public function copyLanguage($dir, $target)
	{
		// Equals administrator/language or language
		$path  = $this->getSourceFolder() . "/" . $dir;
		$files = array();

		$hdl = opendir($path);

		while ($entry = readdir($hdl))
		{
			$p = $path . "/" . $entry;

			// Which languages do we have
			// Ignore hidden files
			if (substr($entry, 0, 1) != '.')
			{
				// Language folders
				if (!is_file($p))
				{
					// Make folder at destination
					$this->_mkdir($target . "/" . $dir . "/" . $entry);

					$fileHdl = opendir($p);

					while ($file = readdir($fileHdl))
					{
						// Only copy language files for this extension (and sys files..)
						if (substr($file, 0, 1) != '.' && strpos($file, $this->ext . "."))
						{
							$files[] = array($entry => $file);

							// Copy file
							$this->_copy($p . "/" . $file, $target . "/" . $dir . "/" . $entry . "/" . $file);
						}
					}

					closedir($fileHdl);
				}
			}
		}

		closedir($hdl);

		return $files;
	}