Skip to content

BadIDMan/Kodi-Skin-Localization-Validator-PowerShell-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Kodi Skin Localization Validator (PowerShell)

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.

What this script checks

The script scans all XML files in the skin’s xml directory and validates four localization rules:

  1. $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[].

  2. $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.

  3. $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+.

  4. $ADDON[skin.name x] with x outside range 31000–31999 Expected result: -> ZERO files.
    Referencing non-skin IDs via $ADDON[] is invalid.

Why this script is useful

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

Requirements

Windows with PowerShell 5.1 or newer
Kodi skin source files
No external modules required.

How to use

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)

Output

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.

Example output

===== SKIN STRING USAGE CHECK =====
$LOCALIZE[x] with x inside 31000–31999 (EXPECTED ZERO): 0 files (OK)
$LOCALIZE[x] with x outside 31000–31999 (ALLOWED): 83 file(s)
C:...Roaming\Kodi\addons\skin.xonfluence\xml\Includes.xml
C:...Roaming\Kodi\addons\skin.xonfluence\xml\Settings.xml
C:...Roaming\Kodi\addons\skin.xonfluence\xml\SkinSettings.xml
[...]
$ADDON[skin.xonfluence x] with x inside 31000–31999 (ALLOWED): 78 file(s)
C:...Roaming\Kodi\addons\skin.xonfluence\xml\DialogAddonInfo.xml
C:...Roaming\Kodi\addons\skin.xonfluence\xml\IncludesHomeWidget.xml
C:...Roaming\Kodi\addons\skin.xonfluence\xml\Settings.xml
C:...Roaming\Kodi\addons\skin.xonfluence\xml\SkinSettings.xml
[...]
$ADDON[skin.xonfluence x] with x outside 31000–31999 (EXPECTED ZERO): 0 files (OK)

Notes

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)

Credits

Developed during real-world cleanup and modernization of the Xonfluence skin for Kodi 22 compatibility.

About

A PowerShell troubleshooting and validation script for Kodi skins, designed to verify correct usage of $LOCALIZE[] and $ADDON[] string references needed for Kodi 22+

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors