File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change 11import Ajv from 'ajv/dist/jtd.js'
22import { parse , validate } from 'license-expressions'
33import license_information from '../../lib/license/license_information.js'
4+ import bcp47 from 'bcp47'
45
56const ajv = new Ajv ( )
67
@@ -44,23 +45,6 @@ const inputSchema = /** @type {const} */ ({
4445
4546const validateSchema = ajv . compile ( inputSchema )
4647
47- const ENGLISH_LANGUAGES = [
48- 'en' ,
49- 'en-AU' ,
50- 'en-BZ' ,
51- 'en-CA' ,
52- 'en-CB' ,
53- 'en-IE' ,
54- 'en-JM' ,
55- 'en-NZ' ,
56- 'en-PH' ,
57- 'en-PH' ,
58- 'en-TT' ,
59- 'en-US' ,
60- 'en-ZA' ,
61- 'en-ZW' ,
62- ]
63-
6448const ABOUT_CODE_LICENSE_REF_PREFIX = 'LicenseRef-scancode-'
6549
6650const ABOUT_CODE_LICENSE_KEYS = new Set (
@@ -141,7 +125,7 @@ export function existsNotListedLicenses(licenseToCheck) {
141125 * @returns {boolean } True if the language is valid, false otherwise
142126 */
143127export function isLangEnglishOrUnspecified ( language ) {
144- return ! language || ENGLISH_LANGUAGES . includes ( language )
128+ return ! language || bcp47 . parse ( language ) ?. langtag . language . language === 'en'
145129}
146130
147131/**
You can’t perform that action at this time.
0 commit comments