guessLocales = (directory) => {
    const entries = fs.readdirSync(directory)
    const localesFound = []

    for (let i = entries.length - 1; i >= 0; i--) {
      if (entries[i].match(/^\./)) continue
      const localeFromFile = guessLocaleFromFile(entries[i])
      if (localeFromFile) localesFound.push(localeFromFile)
    }

    return localesFound.sort()
  }
tries to guess locales by scanning the given directory