code: function localeFromResourcePath (resourcePath, pathSep, defaultLocale) {
    const parts = path.basename(resourcePath).split(pathSep)
    const locale = parts[1] && parts[1].replace(/\..*$/, '').toLowerCase()
    if (locale === 'pt-pt' || (locale === 'pt' && /^pt/i.test(parts[2]))) {
      // European Portuguese is the only locale for which subtags matter
      return 'pt-PT'
    }
    return /^[a-z]{2,3}$/.test(locale || '') ? locale : defaultLocale
  }
docs: expected to follow the pattern baseName_language[_script]_country_variant.properties source: https://docs.oracle.com/javase/9/docs/api/java/util/ResourceBundle.html#getBundle-java.lang.String-java.util.Locale-java.lang.ClassLoader-