You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ✨ [feat] Runtime localization mode & env parsing
- ✨ ColorScripts-Enhanced.psm1: introduce $script:LocalizationMode and parse COLOR_SCRIPTS_ENHANCED_LOCALIZATION_MODE (supports 'auto', 'full', 'embedded'); honor legacy toggles COLOR_SCRIPTS_ENHANCED_FORCE_LOCALIZATION and COLOR_SCRIPTS_ENHANCED_PREFER_EMBEDDED_MESSAGES.
- ✨ ColorScripts-Enhanced.psm1: pass -UseDefaultCandidates to Initialize-ColorScriptsLocalization to enable the new fallback behavior when importing localization resources.
- ✨ [feat] Embedded-defaults preference & PSD1 probing
- ✨ Private/Initialize-ColorScriptsLocalization.ps1: add -UseDefaultCandidates switch and $useDefaultCandidatesFlag; compute preferredCulture from CurrentUICulture and implement preferEmbeddedDefaults logic for 'Embedded' and 'Auto'+UseDefaultCandidates flows.
- ✨ Private/Initialize-ColorScriptsLocalization.ps1: probe candidatePaths for Messages.psd1 (preferred culture chain + fallback en-US/en) and, when no localized resources exist and embedded defaults are preferred, set $script:Messages to the embedded defaults and populate LocalizationDetails.Source = 'EmbeddedDefaults' (with trace output).
- 🛠️ [fix] Localize and ANSI-color cache summaries
- 🛠️ Public/New-ColorScriptCache.ps1 & Public/Clear-ColorScriptCache.ps1: read format strings from $script:Messages.CacheBuildSummaryFormat and CacheClearSummaryFormat (with sane fallbacks), format summary values, build an ANSI-colored summary segment via New-ColorScriptAnsiText (-Color 'Cyan') and pass that segment to Write-ColorScriptInformation for consistent, localizable output.
- 📝 [docs] Document -ValidateCache and localization modes
- 📝 README.md, docs/Development.md, docs/MODULE_SUMMARY.md: add usage and guidance for forcing cache validation and for the new localization modes; recommend COLOR_SCRIPTS_ENHANCED_LOCALIZATION_MODE over legacy toggles.
- 📝 en-US/Show-ColorScript.md & en-US help XML: add -ValidateCache parameter docs and guidance to force metadata validation before rendering; show examples and environment-variable usage (COLOR_SCRIPTS_ENHANCED_VALIDATE_CACHE).
- 🧹 [chore] Add cache-summary message keys to localized resources
- 🧹 en-US + localized Messages.psd1 (de, es, fr, it, ja, nl, pt, ru, zh-CN): add CacheBuildSummaryFormat and CacheClearSummaryFormat entries so cache summaries can be localized/overridden via PSD1 files.
- 🔧 [build] Bump module manifest and localized help stamps; regenerate release artifacts
- 🔧 ColorScripts-Enhanced.psd1: bump ModuleVersion => '2025.11.06.0250' and update Generated on stamp.
- 🔧 localized HelpInfo.xml files (en-US, de, es, fr, it, ja, nl, pt, ru, zh-CN): synchronize UICultureVersion => '2025.11.06.0250'.
- 🔧 dist/LatestReleaseNotes.md & dist/PowerShellGalleryReleaseNotes.md: regenerate release headers/content to reflect the changes.
- 🔧 [build] Formatting/tooling: add PowerShell Prettier plugin
- 🔧 .prettierrc: enable "prettier-plugin-powershell" in the plugin list.
- 🔧 package.json & package-lock.json: bump prettier-plugin-powershell to ^1.0.5 and update lockfile metadata.
- 🧪 [test] Align tests with signature changes
- 🧪 Tests/ColorScripts-Enhanced.ModuleImportCoverage.Tests.ps1: update Initialize-ColorScriptsLocalization stubs to accept [switch]$UseDefaultCandidates and null-assign it to keep test stubs compatible with the new signature.
- 🧹 [chore] Minor wiring & consistency
- 🧹 Ensure module import uses the new -UseDefaultCandidates flag so the embedded-defaults preference path is exercised during import initialization.
Signed-off-by: Nick2bad4u <[email protected]>
> Tip: Set `COLOR_SCRIPTS_ENHANCED_CACHE_PATH` to redirect cache files to a custom directory for CI or ephemeral test runs.
349
349
350
+
### Validate Cache on Demand
351
+
352
+
```powershell
353
+
# Rebuild cache metadata before rendering
354
+
Show-ColorScript -Name "bars" -ValidateCache
355
+
356
+
# Apply validation for the entire session
357
+
$env:COLOR_SCRIPTS_ENHANCED_VALIDATE_CACHE = '1'
358
+
Import-Module ColorScripts-Enhanced -Force
359
+
```
360
+
361
+
Use the `-ValidateCache` switch (or the `COLOR_SCRIPTS_ENHANCED_VALIDATE_CACHE` environment variable) whenever you suspect stale cache data or when testing new scripts.
362
+
363
+
### Localization Modes
364
+
365
+
Auto mode prefers PSD1 resources whenever they exist so you can override English strings without recompiling the module. Fine-tune the behaviour with `COLOR_SCRIPTS_ENHANCED_LOCALIZATION_MODE`:
366
+
367
+
-`auto`*(default)* – load PSD1 files when present, otherwise fall back to embedded messages.
368
+
-`full` – always load from disk, even if embedded defaults would succeed.
369
+
-`embedded` – skip PSD1 probes and rely on built-in English messages.
370
+
371
+
Legacy toggles `COLOR_SCRIPTS_ENHANCED_FORCE_LOCALIZATION` and `COLOR_SCRIPTS_ENHANCED_PREFER_EMBEDDED_MESSAGES` are still honoured, but the consolidated mode variable is recommended.
0 commit comments