Updated localeSegmentRegex expression to not filter segments that don't match individual living languages as acknowledged by ISO 639-1. Removed locales.js file as no longer needed

pull/7440/head
Brian Powell Jr 1 year ago
parent 19275e346d
commit 25c2e06667
No known key found for this signature in database
GPG Key ID: 452080FC5442B172

@ -3,7 +3,8 @@ const _ = require('lodash')
const crypto = require('crypto') const crypto = require('crypto')
const path = require('path') const path = require('path')
const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/i // exclude Regex matches based on ISO 639-1 individual living languages
const localeSegmentRegex = /^(?!a[^abfmnsv])(?!b[^ameniosrg])(?!c[^ashevoy])(?!d[^aevz])(?!e[^lnue])(?!f[^ojiry])(?!g[^dalvu])(?!h[^taezioruy])(?!i[^gsidt])(?!j[^av])(?!k[^lnsakmiyoj])(?!l[^ointbug])(?!m[^khlirty])(?!n[^avrdglnby])(?!o[^cs])(?!p[^alt])(?!r[^monu])(?!s[^giklemndotrsuv])(?!t[^yateglhionskrw])(?!u[^gkr])(?!v[^ei])(?!w[^ao])(?!x[^h])(?!y[^o])(?!z[^u])[A-Z]{2}(-[A-Z]{2})?$/i
const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?\/)?(.*)/i const localeFolderRegex = /^([a-z]{2}(?:-[a-z]{2})?\/)?(.*)/i
// eslint-disable-next-line no-control-regex // eslint-disable-next-line no-control-regex
const unsafeCharsRegex = /[\x00-\x1f\x80-\x9f\\"|<>:*?]/ const unsafeCharsRegex = /[\x00-\x1f\x80-\x9f\\"|<>:*?]/

@ -1,73 +0,0 @@
export const localeArray = [
'af',
'am',
'ar',
'as',
'az',
'bg',
'bn',
'bs-ba',
'ca',
'cs',
'da',
'de',
'el',
'en',
'eo',
'es',
'et',
'eu-es',
'fa',
'fi',
'fr',
'ga-ie',
'fu-in',
'he',
'hi-in',
'hr',
'ht-ht',
'hu',
'hy',
'id',
'is-is',
'it',
'ja',
'kk',
'km-kh',
'kn',
'ko',
'lt',
'lv',
'mk-mk',
'ml',
'mn',
'mr',
'nb',
'nl',
'nn',
'or',
'pa',
'pl',
'pt',
'pt-br',
'ro',
'ru',
'si',
'sk',
'sl',
'sr',
'sr-latn',
'sv',
'ta',
'te',
'th',
'tr',
'ug',
'uk',
'ur',
'vi',
'zh',
'zh-tw'
]
export default class localeArrary {
}
Loading…
Cancel
Save