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 1
1
import Ajv from 'ajv/dist/jtd.js'
2
2
import { parse , validate } from 'license-expressions'
3
3
import license_information from '../../lib/license/license_information.js'
4
+ import bcp47 from 'bcp47'
4
5
5
6
const ajv = new Ajv ( )
6
7
@@ -44,23 +45,6 @@ const inputSchema = /** @type {const} */ ({
44
45
45
46
const validateSchema = ajv . compile ( inputSchema )
46
47
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
-
64
48
const ABOUT_CODE_LICENSE_REF_PREFIX = 'LicenseRef-scancode-'
65
49
66
50
const ABOUT_CODE_LICENSE_KEYS = new Set (
@@ -141,7 +125,7 @@ export function existsNotListedLicenses(licenseToCheck) {
141
125
* @returns {boolean } True if the language is valid, false otherwise
142
126
*/
143
127
export function isLangEnglishOrUnspecified ( language ) {
144
- return ! language || ENGLISH_LANGUAGES . includes ( language )
128
+ return ! language || bcp47 . parse ( language ) ?. langtag . language . language === 'en'
145
129
}
146
130
147
131
/**
You can’t perform that action at this time.
0 commit comments