A PowerShell troubleshooting and validation script for Kodi skins, designed to verify correct usage of $LOCALIZE[] and $ADDON[] string references.
The script helps skin developers clean up legacy or incorrect localization usage and ensure full compatibility with Kodi 22 and newer.
This script was used to successfully clean and modernize the Xonfluence skin.
The script scans all XML files in the skin’s xml directory and validates four localization rules:
-
$LOCALIZE[x] with x in range 31000–31999 Expected result: -> ZERO files.
These IDs belong to the skin namespace and must not be accessed via $LOCALIZE[]. -
$LOCALIZE[x] with x outside range 31000–31999 Expected result: can be lines with such references -> Allowed.
These usually refer to Kodi core strings and are valid. -
$ADDON[skin.name x] with x in range 31000–31999 Expected result: can be lines with such references -> Allowed.
This is the correct and required way to reference skin strings in Kodi 22+. -
$ADDON[skin.name x] with x outside range 31000–31999 Expected result: -> ZERO files.
Referencing non-skin IDs via $ADDON[] is invalid.
Detects Kodi 22 incompatibilities
Finds mixed or legacy localization usage
Prevents silent UI failures caused by invalid string resolution
Ensures strict compliance with Kodi skin string rules
Lists each affected XML file only once per rule
Windows with PowerShell 5.1 or newer
Kodi skin source files
No external modules required.
1. Place the script
Copy Check-skin.ps1 into the root directory of your skin, at the same level where addon.xml is present
2. Run the script
Open PowerShell in the skin root folder and run:
.\Check-skin.ps1
3. Enter the skin name when prompted
Type the skin name together with "skin" word, (example: skin.xonfluence)
The script prints four clearly separated sections:
Green → rule satisfied
Yellow → allowed usage (informational)
Red → violations that must be fixed
Each reported file is printed with its full path, making fixes fast and reliable.
[...]
[...]
The script assumes it is run from the skin’s root directory
Each XML file is listed once per rule, even if multiple matches exist
Safe against empty or unreadable XML files
No special characters or Unicode symbols are used (console-safe)
Developed during real-world cleanup and modernization of the Xonfluence skin for Kodi 22 compatibility.