vidply 1.0.25 → 1.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vidply",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "Universal, accessible video & audio player with ES6 modules",
5
5
  "type": "module",
6
6
  "main": "dist/prod/vidply.esm.min.js",
@@ -414,7 +414,7 @@ export class Player extends EventEmitter {
414
414
 
415
415
  /**
416
416
  * Detect language from HTML lang attribute
417
- * @returns {string|null} Language code if available in translations, null otherwise
417
+ * @returns {string|null} Language code if available in translations or as built-in, null otherwise
418
418
  */
419
419
  detectHtmlLanguage() {
420
420
  // Try to get lang from html element
@@ -427,11 +427,16 @@ export class Player extends EventEmitter {
427
427
  // Normalize the language code (e.g., "en-US" -> "en", "de-DE" -> "de")
428
428
  const normalizedLang = htmlLang.toLowerCase().split('-')[0];
429
429
 
430
- // Check if this language is available in our translations (including dynamically loaded ones)
430
+ // Check if this language is available in our translations (already loaded)
431
431
  if (i18n.translations[normalizedLang]) {
432
432
  return normalizedLang;
433
433
  }
434
434
 
435
+ // Check if this language is available as a built-in that can be loaded on demand
436
+ if (i18n.builtInLanguageLoaders && i18n.builtInLanguageLoaders[normalizedLang]) {
437
+ return normalizedLang;
438
+ }
439
+
435
440
  // Language not available, will fallback to English
436
441
  this.log(`Language "${htmlLang}" not available, using English as fallback`);
437
442
  return null; // Return null instead of 'en' to let the default language handling work