@brightspace-ui/intl 3.10.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +10 -0
  2. package/lib/common.js +23 -22
  3. package/package.json +4 -5
package/README.md CHANGED
@@ -258,6 +258,16 @@ const separator = getSeparator({ nonBreaking: true }); // -> ',\xa0' in en-US
258
258
  Options:
259
259
  - **nonBreaking**: a Boolean flag, whether to use non-breaking spaces instead of standard spaces; default is `false`
260
260
 
261
+ ## Running the test harness
262
+
263
+ Start a [@web/dev-server](https://modern-web.dev/docs/dev-server/overview/) that hosts the test harness:
264
+
265
+ ```shell
266
+ npm start
267
+ ```
268
+
269
+ This will let you test the intl library in a browser, and will update live with any changes.
270
+
261
271
  ## Contributing
262
272
 
263
273
  Contributions are welcome, please submit a pull request!
package/lib/common.js CHANGED
@@ -1,28 +1,29 @@
1
1
  export const defaultLocale = 'en';
2
2
  export const supportedBaseLocales = ['ar', 'cy', 'da', 'de', 'en', 'es', 'fr', 'hi', 'ja', 'ko', 'nl', 'pt', 'sv', 'tr', 'zh'];
3
- export const supportedLocales = [
4
- 'ar-sa',
5
- 'cy-gb',
6
- 'da-dk',
7
- 'de-de',
8
- 'en-us',
9
- 'en-ca',
10
- 'en-gb',
11
- 'es-es',
12
- 'es-mx',
13
- 'fr-ca',
14
- 'fr-fr',
15
- 'fr-on',
16
- 'hi-in',
17
- 'ja-jp',
18
- 'ko-kr',
19
- 'nl-nl',
20
- 'pt-br',
21
- 'sv-se',
22
- 'tr-tr',
23
- 'zh-cn',
24
- 'zh-tw'
3
+ export const supportedLocalesDetails = [
4
+ { code: 'ar-sa', name: 'العربية' },
5
+ { code: 'cy-gb', name: 'Cymraeg (Y Deyrnas Unedig)' },
6
+ { code: 'da-dk', name: 'Dansk (danmark)' },
7
+ { code: 'de-de', name: 'Deutsch (Deutschland)' },
8
+ { code: 'en-ca', name: 'English (Canada)' },
9
+ { code: 'en-gb', name: 'English (United Kingdom)' },
10
+ { code: 'en-us', name: 'English (United States)' },
11
+ { code: 'es-es', name: 'Español (España)' },
12
+ { code: 'es-mx', name: 'Español (Latinoamérica)' },
13
+ { code: 'fr-ca', name: 'Français (Canada)' },
14
+ { code: 'fr-fr', name: 'Français (France)' },
15
+ { code: 'fr-on', name: 'Français (Ontario)' },
16
+ { code: 'hi-in', name: 'हिन्दी Hindi (India)' },
17
+ { code: 'ja-jp', name: '日本語 (日本)' },
18
+ { code: 'ko-kr', name: '한국어 (대한민국)' },
19
+ { code: 'nl-nl', name: 'Nederlands (Nederland)' },
20
+ { code: 'pt-br', name: 'Português (Brasil)' },
21
+ { code: 'sv-se', name: 'Svenska (Sverige)' },
22
+ { code: 'tr-tr', name: 'Türkçe (Türkiye)' },
23
+ { code: 'zh-cn', name: '中文(中华人民共和国)' },
24
+ { code: 'zh-tw', name: '中文(台灣)' }
25
25
  ];
26
+ export const supportedLocales = supportedLocalesDetails.map((l) => l.code);
26
27
 
27
28
  function tryResolve(langTag) {
28
29
 
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.10.0",
3
+ "version": "3.12.0",
4
4
  "description": "Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.",
5
5
  "main": "lib/number.js",
6
6
  "scripts": {
7
7
  "lint": "eslint . --ext .js",
8
+ "start": "web-dev-server --node-resolve --watch --open /demo/",
8
9
  "test:unit": "concurrently -p name -n serve,test -s first -k \"http-server -p 8080 . -s\" \"mocha-headless-chrome -f http://localhost:8080/test/index.html -a no-sandbox -a disable-setuid-sandbox\"",
9
10
  "test": "npm run lint -s && npm run test:unit -s"
10
11
  },
@@ -37,13 +38,11 @@
37
38
  "devDependencies": {
38
39
  "@babel/core": "^7",
39
40
  "@babel/eslint-parser": "^7",
41
+ "@web/dev-server": "^0.1.33",
40
42
  "chai": "^4",
41
43
  "concurrently": "^7",
42
44
  "eslint": "^8",
43
- "eslint-config-brightspace": "^0.18",
44
- "eslint-plugin-html": "^6",
45
- "eslint-plugin-import": "^2",
46
- "eslint-plugin-sort-class-members": "^1",
45
+ "eslint-config-brightspace": "^0.19",
47
46
  "http-server": "^14.0",
48
47
  "mocha": "^10",
49
48
  "mocha-headless-chrome": "^4"