diff --git a/server/helpers/page.js b/server/helpers/page.js index 8bea0aa3..3337c4a8 100644 --- a/server/helpers/page.js +++ b/server/helpers/page.js @@ -3,7 +3,8 @@ const _ = require('lodash') const crypto = require('crypto') 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 // eslint-disable-next-line no-control-regex const unsafeCharsRegex = /[\x00-\x1f\x80-\x9f\\"|<>:*?]/ diff --git a/server/locales/locales.js b/server/locales/locales.js deleted file mode 100644 index 91fd86cb..00000000 --- a/server/locales/locales.js +++ /dev/null @@ -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 { -}