@brightspace-ui/intl 3.34.1 → 3.34.2

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 (2) hide show
  1. package/lib/localize.js +11 -4
  2. package/package.json +1 -1
package/lib/localize.js CHANGED
@@ -238,12 +238,19 @@ 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.batch) {
241
+ if (oslo) {
242
242
  const batch = new URL(oslo.batch, document.location.origin);
243
+ const collection = new URL(oslo.collection, document.location.origin);
243
244
  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();
245
+ if (languageId) {
246
+ if (languageId !== batch.searchParams.get('languageId')) {
247
+ batch.searchParams.set('languageId', languageId);
248
+ oslo.batch = batch.toString();
249
+ }
250
+ if (languageId !== collection.searchParams.get('languageId')) {
251
+ collection.searchParams.set('languageId', languageId);
252
+ oslo.collection = collection.toString();
253
+ }
247
254
  }
248
255
  }
249
256
  return await getLocalizeOverrideResources(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/intl",
3
- "version": "3.34.1",
3
+ "version": "3.34.2",
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",