@brightspace-ui/intl 3.39.0 → 3.40.1

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.
@@ -1,6 +1,6 @@
1
1
  export const defaultLocale = 'en';
2
- export const supportedBaseLocales = ['ar', 'ca', 'cy', 'da', 'de', 'en', 'es', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh', 'ru', 'pl'];
3
- export const supportedLangpacks = ['ar', 'ca', 'cy', 'da', 'de', 'en-gb', 'en', 'es-es', 'es', 'fr-fr', 'fr-on', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh-cn', 'zh-tw', 'ru', 'pl'];
2
+ export const supportedBaseLocales = ['ar', 'ca', 'cy', 'da', 'de', 'en', 'es', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh', 'ru', 'pl', 'ur'];
3
+ export const supportedLangpacks = ['ar', 'ca', 'cy', 'da', 'de', 'en-gb', 'en', 'es-es', 'es', 'fr-fr', 'fr-on', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh-cn', 'zh-tw', 'ru', 'pl', 'ur'];
4
4
  export const supportedLocalesDetails = [
5
5
  { id: 16, code: 'ar-sa', source: 'ar', pack: 'ar', dir: 'rtl', name: 'العربية' },
6
6
  { id: 38, code: 'ca-es', source: 'ca', pack: 'ca', dir: 'ltr', name: 'Català (Espanya)' },
@@ -30,6 +30,7 @@ export const supportedLocalesDetails = [
30
30
  { id: 20, code: 'zh-tw', source: 'zh-Hant', pack: 'zh-tw', overrideCode: 'zh-Hant', dir: 'ltr', name: '中文(繁体)' },
31
31
  { id: 39, code: 'ru', source: 'ru', pack: 'ru', dir: 'ltr', name: 'русский' },
32
32
  { id: 40, code: 'pl', source: 'pl', pack: 'pl', dir: 'ltr', name: 'polski' },
33
+ { id: 41, code: 'ur', source: 'ur', pack: 'ur', dir: 'rtl', name: 'اردو' },
33
34
  ];
34
35
  // end generated locale data
35
36
 
package/lib/localize.js CHANGED
@@ -238,8 +238,9 @@ export const getLocalizeClass = (superclass = class {}) => class LocalizeClass e
238
238
  if (osloCollection) {
239
239
  const oslo = this.documentLocaleSettings.oslo;
240
240
  let languageId = 0;
241
- if (oslo.collection) {
242
- languageId = supportedLocalesDetails.find(l => l.code === osloLang || l.pack === osloLang)?.id;
241
+ const doc = document.documentElement;
242
+ if (doc.hasAttribute('data-custom-lang') && oslo.collection) {
243
+ languageId = Number(doc.dataset.languageId) || supportedLocalesDetails.find(l => l.code === osloLang || l.pack === osloLang)?.id;
243
244
  if (languageId) {
244
245
  const batch = oslo.batch && new URL(oslo.batch, self.origin);
245
246
  if (batch && languageId !== batch.searchParams.get('languageId')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.39.0",
3
+ "version": "3.40.1",
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
  "type": "module",
@@ -18,7 +18,8 @@
18
18
  "/helpers"
19
19
  ],
20
20
  "publishConfig": {
21
- "access": "public"
21
+ "access": "public",
22
+ "registry": "https://registry.npmjs.org/"
22
23
  },
23
24
  "repository": {
24
25
  "type": "git",
@@ -43,7 +44,7 @@
43
44
  "devDependencies": {
44
45
  "@brightspace-ui/testing": "^1",
45
46
  "eslint": "^9",
46
- "eslint-config-brightspace": "^3",
47
+ "eslint-config-brightspace": "^4",
47
48
  "sinon": "^22.0.0"
48
49
  },
49
50
  "dependencies": {