Skip to content

Validation System Pro

The validation system helps you catch localization issues before they reach players.

Validation Rules

RuleSeverityDescription
Missing TranslationsErrorKeys with empty values for some locales
Empty ValuesErrorCompletely empty translation entries
Placeholder MismatchErrorDifferent placeholder counts between locales
Invalid Smart StringsErrorSyntax errors in Smart String templates
Character LimitWarningTranslations exceeding defined limits
Duplicate KeysWarningSame key in multiple tables
Unused KeysInfoKeys not referenced in code

Running Validation

From String Table Browser

  1. Open Tools → KitStack → Lexis → String Table Browser
  2. Click the Validation tab
  3. Click Run Validation
  4. Review and fix reported issues

From Menu

  • Tools → KitStack → Lexis → Validate All Tables

Validation Results

Results are grouped by severity:

  • Errors (Red): Must be fixed before release
  • Warnings (Yellow): Should be reviewed
  • Info (Blue): Suggestions for improvement

Example Results

[Error] Missing translation for key 'ui.button.start' in locale 'ja'
[Error] Placeholder mismatch in 'score.format': en has {0}, de has {0} {1}
[Warning] Character limit exceeded for 'menu.title' (50 chars, limit 40)
[Info] Unused key 'ui.old_button' in table 'UI'

Configuring Validation

Character Limits

Set maximum character lengths in your StringTable entries:

  1. Open String Table Browser
  2. Select an entry
  3. Set Max Length in the entry details
  4. Validation will warn when translations exceed this limit

Exclusion Patterns

Exclude certain keys from validation:

csharp
var settings = new ValidationSettings
{
    ExcludedKeyPatterns = new[]
    {
        "^debug_.*",      // Exclude debug keys
        "^test_.*",       // Exclude test keys
        ".*_placeholder$" // Exclude placeholder keys
    }
};

Source Quality Checker

Before translation, Lexis can analyze source text for common issues.

Detected Issues

Issue TypeSeverityExample
Unbalanced placeholdersErrorHello {name (missing })
Empty placeholdersErrorHello {}!
Encoding issuesErrorReplacement character \uFFFD
Multiple spacesWarningHello world
Leading/trailing whitespaceWarning Hello
Hardcoded large numbersWarningYou scored 10000 points
URLs in textInfoVisit https://example.com

Quality Levels

LevelMeaning
GoodNo issues detected
FairWarnings only
PoorContains errors

API Usage

csharp
using Lexis.Editor.Translation;

var checker = new SourceQualityChecker(() => openAiApiKey);
var result = checker.CheckBasicQuality("Hello {name}!");

if (result.HasIssues)
{
    foreach (var issue in result.Issues)
    {
        Debug.LogWarning($"{issue.Type}: {issue.Description}");
    }
}

CI/CD Integration

Run validation from the command line for automated pipelines:

bash
Unity -batchmode -projectPath /path/to/project \
  -executeMethod Lexis.Editor.Validation.ValidationRunner.RunFromCommandLine \
  -quit

Exit Codes

  • 0: No errors
  • 1: Validation errors found
  • 2: Error running validation

Best Practices

  1. Run validation regularly - Include in your build pipeline
  2. Fix errors first - Warnings can wait, errors cannot
  3. Set character limits - Prevent UI overflow issues
  4. Review placeholders - Mismatched placeholders cause runtime errors
  5. Clean unused keys - Reduces translation costs

Professional Unity Development Tools