@panomc/theme-core 1.0.0-dev.42 → 1.0.0-dev.43

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/bin/sync.js +18 -0
  2. package/package.json +1 -1
package/bin/sync.js CHANGED
@@ -266,6 +266,24 @@ function syncLang() {
266
266
  );
267
267
  merged++;
268
268
  }
269
+
270
+ // Extra locales: an override file with no matching core base (e.g. de.json)
271
+ // becomes a NEW language. Its base is core en-US, so untranslated keys fall
272
+ // back to English instead of rendering as raw keys. The locale only shows up
273
+ // on the site if an admin has defined a locale with the same code in the
274
+ // panel — the theme file alone doesn't add it to the language picker.
275
+ if (existsSync(overrideDir)) {
276
+ const enBase = JSON.parse(readFileSync(join(coreLangDir, "en-US.json"), "utf-8"));
277
+ for (const file of readdirSync(overrideDir)) {
278
+ if (!file.endsWith(".json") || existsSync(join(coreLangDir, file))) continue;
279
+ const overlay = JSON.parse(readFileSync(join(overrideDir, file), "utf-8"));
280
+ writeFileSync(
281
+ join(outDir, file),
282
+ JSON.stringify(deepMerge(enBase, overlay), null, 2) + "\n",
283
+ );
284
+ merged++;
285
+ }
286
+ }
269
287
  return merged;
270
288
  }
271
289
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panomc/theme-core",
3
- "version": "1.0.0-dev.42",
3
+ "version": "1.0.0-dev.43",
4
4
  "description": "The Pano theme engine: hooks factories, plugin engine, headless page controllers, default views and the theme CLI. Themes depend on this package instead of forking vanilla-theme.",
5
5
  "author": "PanoMC",
6
6
  "license": "MIT",