@brightspace-ui/intl 3.33.1 → 3.34.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.
package/lang/haw.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "Pau", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "Hoʻoponopono", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "Hoʻopau", // finish action (in Title Case)
15
- "intl-common:actions:more": "ʻOi aku", // more action (in Title Case)
15
+ "intl-common:actions:more": "ʻOi aku", // more action (in Title Case)
16
16
  "intl-common:actions:print": "Paʻi", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "Wehe", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "Mālama", // save action (in Title Case)
package/lang/ja.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "終了", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "編集", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "完了", // finish action (in Title Case)
15
- "intl-common:actions:more": "増やす", // more action (in Title Case)
15
+ "intl-common:actions:more": "詳細を表示", // more action (in Title Case)
16
16
  "intl-common:actions:print": "印刷", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "削除", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "保存", // save action (in Title Case)
package/lang/mi.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "Kua oti", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "Whakatika", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "Mutu", // finish action (in Title Case)
15
- "intl-common:actions:more": "Ētahi atu", // more action (in Title Case)
15
+ "intl-common:actions:more": "Ä’tahi atu", // more action (in Title Case)
16
16
  "intl-common:actions:print": "Tā", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "Tango", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "Tiaki", // save action (in Title Case)
package/lang/vi.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "Hoàn tất", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "Chỉnh sửa", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "Xong", // finish action (in Title Case)
15
- "intl-common:actions:more": "Xem thêm", // more action (in Title Case)
15
+ "intl-common:actions:more": "Thêm", // more action (in Title Case)
16
16
  "intl-common:actions:print": "In", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "Loại bỏ", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "Lưu", // save action (in Title Case)
package/lang/zh-cn.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "完成", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "编辑", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "完成", // finish action (in Title Case)
15
- "intl-common:actions:more": "更多内容", // more action (in Title Case)
15
+ "intl-common:actions:more": "更多", // more action (in Title Case)
16
16
  "intl-common:actions:print": "打印", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "移除", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "保存", // save action (in Title Case)
package/lang/zh-tw.js CHANGED
@@ -12,7 +12,7 @@ export default {
12
12
  "intl-common:actions:done": "完成", // done action (in Title Case)
13
13
  "intl-common:actions:edit": "編輯", // edit action (in Title Case)
14
14
  "intl-common:actions:finish": "完成", // finish action (in Title Case)
15
- "intl-common:actions:more": "其他", // more action (in Title Case)
15
+ "intl-common:actions:more": "更多", // more action (in Title Case)
16
16
  "intl-common:actions:print": "列印", // print action (in Title Case)
17
17
  "intl-common:actions:remove": "移除", // remove action (in Title Case)
18
18
  "intl-common:actions:save": "儲存", // save action (in Title Case)
package/lib/common.js CHANGED
@@ -5,31 +5,31 @@ export const supportedBaseLocales = ['ar', 'cy', 'da', 'de', 'en', 'es', 'fr', '
5
5
  export const supportedLangpacks = ['ar', 'cy', 'da', 'de', 'en', 'en-gb', 'es', 'es-es', 'fr', 'fr-fr', 'fr-on', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh-cn', 'zh-tw'];
6
6
 
7
7
  export const supportedLocalesDetails = [
8
- { code: 'ar-sa', dir: 'rtl', name: 'العربية (المملكة العربية السعودية)' },
9
- { code: 'cy-gb', dir: 'ltr', name: 'Cymraeg (Y Deyrnas Unedig)' },
10
- { code: 'da-dk', dir: 'ltr', name: 'Dansk (danmark)' },
11
- { code: 'de-de', dir: 'ltr', name: 'Deutsch (Deutschland)' },
12
- { code: 'en-ca', dir: 'ltr', name: 'English (Canada)' },
13
- { code: 'en-gb', dir: 'ltr', name: 'English (United Kingdom)' },
14
- { code: 'en-us', dir: 'ltr', name: 'English (United States)' },
15
- { code: 'es-es', dir: 'ltr', name: 'Español (España)' },
16
- { code: 'es-mx', overrideCode: 'es-419', dir: 'ltr', name: 'Español (Latinoamérica)' },
17
- { code: 'fr-ca', dir: 'ltr', name: 'Français (Canada)' },
18
- { code: 'fr-fr', dir: 'ltr', name: 'Français (France)' },
19
- { code: 'fr-on', overrideCode: 'fr-CA-Ontario', dir: 'ltr', name: 'Français (Ontario)' },
20
- { code: 'haw-us', dir: 'ltr', name: 'ʻŌlelo Hawaiʻi (ʻAmelika Hui Pū ʻIa)' },
21
- { code: 'hi-in', dir: 'ltr', name: 'हिंदी (भारत)' },
22
- { code: 'ja-jp', dir: 'ltr', name: '日本語 (日本)' },
23
- { code: 'ko-kr', dir: 'ltr', name: '한국어 (대한민국)' },
24
- { code: 'mi-nz', dir: 'ltr', name: 'Māori (Aotearoa)' },
25
- { code: 'nl-nl', dir: 'ltr', name: 'Nederlands (Nederland)' },
26
- { code: 'pt-br', dir: 'ltr', name: 'Português (Brasil)' },
27
- { code: 'sv-se', dir: 'ltr', name: 'Svenska (Sverige)' },
28
- { code: 'th-th', dir: 'ltr', name: 'ไทย (ไทย)' },
29
- { code: 'tr-tr', dir: 'ltr', name: 'Türkçe (Türkiye)' },
30
- { code: 'vi-vn', dir: 'ltr', name: 'Tiếng Việt (Việt Nam)' },
31
- { code: 'zh-cn', overrideCode: 'zh-Hans', dir: 'ltr', name: '中文(简体)' },
32
- { code: 'zh-tw', overrideCode: 'zh-Hant', dir: 'ltr', name: '中文(繁体)' }
8
+ { id: 16, code: 'ar-sa', pack: 'ar', dir: 'rtl', name: 'العربية (المملكة العربية السعودية)' },
9
+ { id: 31, code: 'cy-gb', pack: 'cy', dir: 'ltr', name: 'Cymraeg (Y Deyrnas Unedig)' },
10
+ { id: 28, code: 'da-dk', pack: 'da', dir: 'ltr', name: 'Dansk (danmark)' },
11
+ { id: 26, code: 'de-de', pack: 'de', dir: 'ltr', name: 'Deutsch (Deutschland)' },
12
+ { id: 13, code: 'en-ca', dir: 'ltr', name: 'English (Canada)' },
13
+ { id: 11, code: 'en-gb', pack: 'en-gb', dir: 'ltr', name: 'English (United Kingdom)' },
14
+ { id: 1, code: 'en-us', pack: 'en', dir: 'ltr', name: 'English (United States)' },
15
+ { id: 30, code: 'es-es', pack: 'es-es', dir: 'ltr', name: 'Español (España)' },
16
+ { id: 18, code: 'es-mx', pack: 'es', overrideCode: 'es-419', dir: 'ltr', name: 'Español (Latinoamérica)' },
17
+ { id: 2, code: 'fr-ca', pack: 'fr', dir: 'ltr', name: 'Français (Canada)' },
18
+ { id: 29, code: 'fr-fr', pack: 'fr-fr', dir: 'ltr', name: 'Français (France)' },
19
+ { id: 32, code: 'fr-on', pack: 'fr-on', overrideCode: 'fr-CA-Ontario', dir: 'ltr', name: 'Français (Ontario)' },
20
+ { id: 35, code: 'haw-us', pack: 'haw', dir: 'ltr', name: 'ʻŌlelo Hawaiʻi (ʻAmelika Hui Pū ʻIa)' },
21
+ { id: 33, code: 'hi-in', pack: 'hi', dir: 'ltr', name: 'हिंदी (भारत)' },
22
+ { id: 21, code: 'ja-jp', pack: 'ja', dir: 'ltr', name: '日本語 (日本)' },
23
+ { id: 22, code: 'ko-kr', pack: 'ko', dir: 'ltr', name: '한국어 (대한민국)' },
24
+ { id: 34, code: 'mi-nz', pack: 'mi', dir: 'ltr', name: 'Māori (Aotearoa)' },
25
+ { id: 25, code: 'nl-nl', pack: 'nl', dir: 'ltr', name: 'Nederlands (Nederland)' },
26
+ { id: 19, code: 'pt-br', pack: 'pt', dir: 'ltr', name: 'Português (Brasil)' },
27
+ { id: 24, code: 'sv-se', pack: 'sv', dir: 'ltr', name: 'Svenska (Sverige)' },
28
+ { id: 37, code: 'th-th', pack: 'th', dir: 'ltr', name: 'ไทย (ไทย)' },
29
+ { id: 23, code: 'tr-tr', pack: 'tr', dir: 'ltr', name: 'Türkçe (Türkiye)' },
30
+ { id: 36, code: 'vi-vn', pack: 'vi', dir: 'ltr', name: 'Tiếng Việt (Việt Nam)' },
31
+ { id: 17, code: 'zh-cn', pack: 'zh-cn', overrideCode: 'zh-Hans', dir: 'ltr', name: '中文(简体)' },
32
+ { id: 20, code: 'zh-tw', pack: 'zh-tw', overrideCode: 'zh-Hant', dir: 'ltr', name: '中文(繁体)' }
33
33
  ];
34
34
  export const supportedLocales = supportedLocalesDetails.map((l) => l.code);
35
35
 
package/lib/localize.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './PluralRules.js';
2
- import { defaultLocale as fallbackLang, getDocumentLocaleSettings, supportedLangpacks } from './common.js';
2
+ import { defaultLocale as fallbackLang, getDocumentLocaleSettings, supportedLangpacks, supportedLocalesDetails } from './common.js';
3
3
  import { getLocalizeOverrideResources } from '../helpers/getLocalizeResources.js';
4
4
  import IntlMessageFormat from 'intl-messageformat';
5
5
 
@@ -220,18 +220,32 @@ export const getLocalizeClass = (superclass = class {}) => class LocalizeClass e
220
220
 
221
221
  if (importFunc === undefined) return;
222
222
 
223
+ // en-ca does not have an actual langpack, but supports overrides, so mark its usage
224
+ const enCA = langs.includes('en-ca') && langs.indexOf('en-ca') <= Math.max(langs.indexOf('en-us'), 0);
225
+
223
226
  // in dev, don't request unsupported langpacks
224
227
  if (!importFunc.toString().includes('switch') && !useBrowserLangs) {
225
228
  langs = langs.filter(lang => supportedLangpacks.includes(lang));
226
229
  }
227
230
 
228
231
  for (const lang of [...langs, fallbackLang]) {
229
-
230
232
  const resources = await Promise.resolve(importFunc(lang)).catch(() => {});
231
233
 
234
+ const osloLang = lang === 'en' && enCA ? 'en-ca' : lang;
235
+
232
236
  if (resources) {
233
237
 
234
238
  if (osloCollection) {
239
+ const oslo = this.documentLocaleSettings.oslo;
240
+ let languageId = 0;
241
+ if (oslo.batch) {
242
+ const batch = new URL(oslo.batch, document.location.origin);
243
+ languageId = supportedLocalesDetails.find(l => l.code === osloLang || l.pack === osloLang)?.id;
244
+ if (languageId && languageId !== batch.searchParams.get('languageId')) {
245
+ batch.searchParams.set('languageId', languageId);
246
+ oslo.batch = batch.toString();
247
+ }
248
+ }
235
249
  return await getLocalizeOverrideResources(
236
250
  lang,
237
251
  resources,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.33.1",
3
+ "version": "3.34.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",