logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityLocalizationKeyValidator

    Validates the translation keys designers type into Serenity assets (any field with its IsTranslating<Field> toggle on) against the project's Unity Localization string tables. The GUI-free engine behind SerenityLocalizationKeyValidatorWindow, also driven headlessly by the project validation runner.

    Inheritance
    object
    SerenityLocalizationKeyValidator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Localization.Installation.Settings.Editor
    Assembly: Serenity.UnityLocalization.Installation.Editor.dll
    Syntax
    public static class SerenityLocalizationKeyValidator

    Fields

    ValidatorName

    Validator tag used on issues and in the report's validators-run list.

    Declaration
    public const string ValidatorName = "localizationKeys"
    Field Value
    Type Description
    string

    Methods

    GatherDefinedKeys()

    Collects every shared key defined across all Unity Localization string table collections.

    Declaration
    public static HashSet<string> GatherDefinedKeys()
    Returns
    Type Description
    HashSet<string>

    HasAnyStringTableCollection()

    True when the project has at least one Unity Localization string table collection.

    Declaration
    public static bool HasAnyStringTableCollection()
    Returns
    Type Description
    bool

    Run(SerenityValidationReport, bool)

    Runs the localization-key scan and appends findings to the report.

    Declaration
    public static void Run(SerenityValidationReport report, bool checkTranslationsPerLocale = true)
    Parameters
    Type Name Description
    SerenityValidationReport report

    The report to append to.

    bool checkTranslationsPerLocale

    When true (default), also reports a Serenity.Global.Infrastructure.Editor.Validation.SerenityValidationSeverity.Warning for every key actually used by a Serenity asset that resolves to an empty translation in a given locale's string table. Scoped to used keys only — checking every shared-table key would flood the report on any partially-translated project.

    In this article
    © 2026 Serenity. All Rights Reserved