@brightspace-ui/intl 3.35.0 → 3.36.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/ca.js ADDED
@@ -0,0 +1,44 @@
1
+ export default {
2
+ "intl-common:actions:add": "Add", // add action (in Title Case)
3
+ "intl-common:actions:apply": "Apply", // apply action (in Title Case)
4
+ "intl-common:actions:browse": "Browse", // browse action (in Title Case)
5
+ "intl-common:actions:cancel": "Cancel", // cancel action (in Title Case)
6
+ "intl-common:actions:clear": "Clear", // clear action (in Title Case)
7
+ "intl-common:actions:close": "Close", // close action (in Title Case)
8
+ "intl-common:actions:confirm": "Confirm", // confirm action (in Title Case)
9
+ "intl-common:actions:copy": "Copy", // copy action (in Title Case)
10
+ "intl-common:actions:create": "Create", // create action (in Title Case)
11
+ "intl-common:actions:delete": "Delete", // delete action (in Title Case)
12
+ "intl-common:actions:done": "Done", // done action (in Title Case)
13
+ "intl-common:actions:edit": "Edit", // edit action (in Title Case)
14
+ "intl-common:actions:finish": "Finish", // finish action (in Title Case)
15
+ "intl-common:actions:more": "More", // more action (in Title Case)
16
+ "intl-common:actions:print": "Print", // print action (in Title Case)
17
+ "intl-common:actions:remove": "Remove", // remove action (in Title Case)
18
+ "intl-common:actions:save": "Save", // save action (in Title Case)
19
+ "intl-common:actions:saveAndClose": "Save and Close", // save and close action (in Title Case)
20
+ "intl-common:actions:saveAndNew": "Save and New", // save and new action (in Title Case)
21
+ "intl-common:actions:search": "Search", // search action (in Title Case)
22
+ "intl-common:actions:submit": "Submit", // submit action (in Title Case)
23
+ "intl-common:actions:update": "Update", // update action (in Title Case)
24
+ "intl-common:characters:ampersand": "et", // short name or description of the "&" character
25
+ "intl-common:characters:apostrophe": "apòstrof tipogràfic", // short name or description of the "'" character
26
+ "intl-common:characters:asterisk": "asterisc", // short name or description of the "*" character
27
+ "intl-common:characters:backslash": "barra inversa", // short name or description of the "\" character
28
+ "intl-common:characters:colon": "dos punts", // short name or description of the ":" character
29
+ "intl-common:characters:comma": "coma", // short name or description of the "," character
30
+ "intl-common:characters:greaterThan": "major que", // short name or description of the ">" character
31
+ "intl-common:characters:lessThan": "menor que", // short name or description of the "<" character
32
+ "intl-common:characters:numberSign": "coixinet", // short name or description of the "#" character
33
+ "intl-common:characters:percentSign": "tant per cent", // short name or description of the "%" character
34
+ "intl-common:characters:pipe": "barra vertical", // short name or description of the "|" character
35
+ "intl-common:characters:questionMark": "signe d’interrogació", // short name or description of the "?" character
36
+ "intl-common:characters:quotationMark": "cometa doble", // short name or description of the '"' character
37
+ "intl-common:confirm:no": "No", // no response to a question (in Title Case)
38
+ "intl-common:confirm:ok": "OK", // okay response to a question
39
+ "intl-common:confirm:yes": "Yes", // yes response to a question (in Title Case)
40
+ "intl-common:navigation:back:title": "Back", // term for navigating back to the previous page (in Title Case)
41
+ "intl-common:navigation:continue:title": "Continue", // continue action (in Title Case)
42
+ "intl-common:navigation:next:title": "Next", // term for navigating to the next page or item (in Title Case)
43
+ "intl-common:navigation:previous:title": "Previous", // term for navigating to the previous page or item (in Title Case)
44
+ };
package/lib/common.js CHANGED
@@ -1,11 +1,12 @@
1
1
  import { DocumentLocaleSettings } from './document-locale-settings.js';
2
2
 
3
3
  export const defaultLocale = 'en';
4
- export const supportedBaseLocales = ['ar', 'cy', 'da', 'de', 'en', 'es', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh'];
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'];
4
+ export const supportedBaseLocales = ['ar', 'ca', 'cy', 'da', 'de', 'en', 'es', 'fr', 'haw', 'hi', 'ja', 'ko', 'mi', 'nl', 'pt', 'sv', 'th', 'tr', 'vi', 'zh'];
5
+ export const supportedLangpacks = ['ar', 'ca', '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
8
  { id: 16, code: 'ar-sa', pack: 'ar', dir: 'rtl', name: 'العربية (المملكة العربية السعودية)' },
9
+ { id: 38, code: 'ca-es', pack: 'ca', dir: 'ltr', name: 'Català (Espanya)' },
9
10
  { id: 31, code: 'cy-gb', pack: 'cy', dir: 'ltr', name: 'Cymraeg (Y Deyrnas Unedig)' },
10
11
  { id: 28, code: 'da-dk', pack: 'da', dir: 'ltr', name: 'Dansk (danmark)' },
11
12
  { id: 26, code: 'de-de', pack: 'de', dir: 'ltr', name: 'Deutsch (Deutschland)' },
package/lib/dateTime.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { getDocumentLocaleSettings, getLanguage, merge } from './common.js';
2
2
 
3
3
  // to-do: These should be based on region, not language
4
- const hour24locales = ['cy', 'da', 'de', 'es', 'fr', 'nl', 'pt', 'sv', 'tr', 'zh'];
5
- const mondayFirstDayLocales = ['cy', 'da', 'de', 'fr', 'hi', 'mi', 'nl', 'sv', 'tr'];
4
+ const hour24locales = ['ca', 'cy', 'da', 'de', 'es', 'fr', 'nl', 'pt', 'sv', 'tr', 'zh'];
5
+ const mondayFirstDayLocales = ['ca', 'cy', 'da', 'de', 'fr', 'hi', 'mi', 'nl', 'sv', 'tr'];
6
6
 
7
7
  // timezone abbreviations and offsets from https://www.timeanddate.com/time/zones/
8
8
  const timezoneOffsetMap = {
@@ -401,7 +401,7 @@ function getTimeFormat(hour24, language, baseLanguage) {
401
401
  let timeFormat = hour24 ? 'HH:mm' : 'h:mm';
402
402
 
403
403
  // non-zero padded 24-hour clocks and zero-padded 12-hour clocks
404
- if (hour24 && (baseLanguage === 'ja' || language === 'pt-br' || (baseLanguage === 'zh' && language !== 'zh-tw'))) {
404
+ if (hour24 && (baseLanguage === 'ca' || baseLanguage === 'ja' || language === 'pt-br' || (baseLanguage === 'zh' && language !== 'zh-tw'))) {
405
405
  timeFormat = 'H:mm';
406
406
  } else if (!hour24 && language === 'zh-tw') {
407
407
  timeFormat = 'hh:mm';
@@ -740,6 +740,19 @@ export function getDateTimeDescriptor() {
740
740
  weekendStartDay = 4;
741
741
  weekendEndDay = 5;
742
742
  break;
743
+ case 'ca':
744
+ dateFormats = ['dddd, d MMMM\' del \'yyyy', 'd MMMM\' del \'yyyy', 'd/M/yy', 'MMMM\' del \'yyyy', 'd MMMM', 'd MMM'];
745
+ dayPeriods = ['a. m.', 'p. m.'];
746
+ months = [
747
+ ['de gener', 'de febrer', 'de març', 'd’abril', 'de maig', 'de juny', 'de juliol', 'd’agost', 'de setembre', 'd’octubre', 'de novembre', 'de desembre'],
748
+ ['de gen.', 'de febr.', 'de març', 'd’abr.', 'de maig', 'de juny', 'de jul.', 'd’ag.', 'de set.', 'd’oct.', 'de nov.', 'de des.']
749
+ ];
750
+ days = [
751
+ ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'],
752
+ ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'],
753
+ ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'],
754
+ ];
755
+ break;
743
756
  case 'cy':
744
757
  dateFormats = ['dddd, d MMMM yyyy', 'dd MMMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM'];
745
758
  months = [
package/lib/localize.js CHANGED
@@ -241,13 +241,13 @@ export const getLocalizeClass = (superclass = class {}) => class LocalizeClass e
241
241
  if (oslo.collection) {
242
242
  languageId = supportedLocalesDetails.find(l => l.code === osloLang || l.pack === osloLang)?.id;
243
243
  if (languageId) {
244
- const batch = oslo.batch && new URL(oslo.batch, document.location.origin);
244
+ const batch = oslo.batch && new URL(oslo.batch, self.origin);
245
245
  if (batch && languageId !== batch.searchParams.get('languageId')) {
246
246
  batch.searchParams.set('languageId', languageId);
247
247
  oslo.batch = batch.toString();
248
248
  }
249
249
 
250
- const collection = new URL(oslo.collection, document.location.origin);
250
+ const collection = new URL(oslo.collection, self.origin);
251
251
  if (languageId !== collection.searchParams.get('languageId')) {
252
252
  collection.searchParams.set('languageId', languageId);
253
253
  oslo.collection = collection.toString();
package/lib/number.js CHANGED
@@ -109,6 +109,7 @@ export function getNumberDescriptor() {
109
109
  let percentPattern = '{number} %';
110
110
  let percentNegativePattern = '-{number} %';
111
111
  switch (baseLanguage) {
112
+ case 'ca':
112
113
  case 'es':
113
114
  case 'hi':
114
115
  case 'ja':
@@ -127,6 +128,7 @@ export function getNumberDescriptor() {
127
128
  let decimalSymbol = '.';
128
129
  let groupSymbol = ',';
129
130
  switch (baseLanguage) {
131
+ case 'ca':
130
132
  case 'da':
131
133
  case 'de':
132
134
  case 'es':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.35.0",
3
+ "version": "3.36.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",