@uniweb/core 0.5.9 → 0.5.10

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/package.json +1 -1
  2. package/src/website.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.5.9",
3
+ "version": "0.5.10",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
package/src/website.js CHANGED
@@ -74,7 +74,7 @@ export default class Website {
74
74
 
75
75
  // Legacy language support (for editor multilingual)
76
76
  this.activeLang = this.activeLocale
77
- this.langs = config.languages || this.locales.map(l => ({
77
+ this.langs = this.locales.map(l => ({
78
78
  label: l.label || l.code,
79
79
  value: l.code
80
80
  }))
@@ -107,7 +107,7 @@ export default class Website {
107
107
  */
108
108
  buildLocalesList(config) {
109
109
  const defaultLocale = config.defaultLanguage || 'en'
110
- const i18nLocales = config.i18n?.locales || []
110
+ const languages = config.languages || []
111
111
 
112
112
  // Normalize input: convert strings to objects, keep objects as-is
113
113
  const normalizeLocale = (locale) => {
@@ -118,14 +118,14 @@ export default class Website {
118
118
  return { code: locale.code, ...(locale.label && { label: locale.label }) }
119
119
  }
120
120
 
121
- // Start with default locale (may not be in i18nLocales)
121
+ // Start with default locale (may not be in languages list)
122
122
  const localeMap = new Map()
123
123
  localeMap.set(defaultLocale, { code: defaultLocale })
124
124
 
125
- // Add i18n locales (may include objects with labels)
126
- for (const locale of i18nLocales) {
125
+ // Add configured languages (may include objects with labels)
126
+ for (const locale of languages) {
127
127
  const normalized = normalizeLocale(locale)
128
- // Merge with existing (to preserve labels if default locale also in i18n with label)
128
+ // Merge with existing (to preserve labels if default locale also in languages with label)
129
129
  if (localeMap.has(normalized.code)) {
130
130
  const existing = localeMap.get(normalized.code)
131
131
  localeMap.set(normalized.code, { ...existing, ...normalized })