Skip to content

Main content

Random Document Localization Key Fixture Generator

Construct supplied message-key usages with explicit removed-catalog and orphan controls, retaining repeated, missing and unused-key answers.

Loading tool…

Description

Construct supplied message-key usages with explicit removed-catalog and orphan controls, retaining repeated, missing and unused-key answers.

A parser corpus pairs literal input spellings or structured documents with observable parser results or explicitly constructed expectations. Successful parsing, semantic validity, and exact round-trip preservation are separate properties, so test records retain the relevant evidence.

Construct supplied message-key usages with explicit removed-catalog and orphan controls, retaining repeated, missing and unused-key answers.

When to use this tool

Use this generator to create reproducible document localization key fixture cases from the supplied model or bank. Inspect the returned evidence before using cases in a test or exercise.

How to use the tool and how it works

  1. Supply catalog, usageCount, removeUsedKey, orphanControl in the field shapes below. Set seed when you need an explicit replay.
  2. Run the tool and correct any input error. For generated controls, distinguish a successful fixture containing an invalid case from failure to generate the fixture.
  3. Read catalog, usages, missingKeys, repeatedKeys, unusedKeys, pretty. Use the conventions below. Keep answer-bearing fields separate when presenting an exercise.

Draw localization-key usages from the supplied catalog, optionally remove a used catalog key or append a guaranteed unknown key, then return missing, repeated, and unused keys with the retained catalog's serialized mapping.1

Input fieldMeaning and unitsAccepted input
catalogCatalogRequired. Array of Object; no unknown keys.; minimum items 1; maximum items 16.
catalog[].keyKeyRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
catalog[].messageMessageRequired. Text; maximum UTF-16 length 65536.
usageCountUsage CountRequired. Safe integer; minimum 1; maximum 31.
removeUsedKeyRemove Used KeyRequired. Boolean.
orphanControlOrphan ControlRequired. Boolean.
seedOptional numeric seed; takes precedence over context randomness. Without either, use the fixed tool.io default seed.Optional. Safe integer.
Output fieldInterpretationReturned shape
catalogCatalogRequired. Array of Object; no unknown keys.; minimum items 0; maximum items 16.
catalog[].keyKeyRequired. Text; minimum UTF-16 length 1; maximum UTF-16 length 128.
catalog[].messageMessageRequired. Text; maximum UTF-16 length 65536.
usagesUsagesRequired. Array of Text; maximum UTF-16 length 65536.; minimum items 1; maximum items 32.
missingKeysMissing KeysRequired. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 32.
repeatedKeysRepeated KeysRequired. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16.
unusedKeysUnused KeysRequired. Array of Text; maximum UTF-16 length 65536.; minimum items 0; maximum items 16.
prettyPrettyRequired. Text; maximum UTF-16 length 65536.
randomnessReplay source and normalized 32-bit seed, or null seed for an advancing context source.Required. Object; no unknown keys.
randomness.seedOptional safe-integer replay seed; normalization and precedence are explained below.Required. Safe integer. or Null.
randomness.sourceSourceRequired. Text; one of "context", "seed".

An explicit safe-integer seed takes precedence over injected context randomness and is normalized to an unsigned 32-bit integer. With no seed and no context source, replay uses the fixed tool.io default seed. A context source must return finite values from zero inclusive to one exclusive; its advancing state must be retained separately. randomness records the source and normalized seed, or null for context. These generators are not cryptographic random sources.

json
{
  "input": {
    "catalog": [
      {
        "key": "title",
        "message": "Hello"
      },
      {
        "key": "body",
        "message": "Text"
      }
    ],
    "usageCount": 3,
    "removeUsedKey": false,
    "orphanControl": true,
    "seed": 42
  },
  "output": {
    "catalog": [
      {
        "key": "title",
        "message": "Hello"
      },
      {
        "key": "body",
        "message": "Text"
      }
    ],
    "usages": [
      "body",
      "title",
      "body",
      "__orphan__"
    ],
    "missingKeys": [
      "__orphan__"
    ],
    "repeatedKeys": [
      "body"
    ],
    "unusedKeys": [],
    "pretty": "{\n  \"title\": \"Hello\",\n  \"body\": \"Text\"\n}\n",
    "randomness": {
      "seed": 42,
      "source": "seed"
    }
  }
}

Limitations and assumptions

  • Repeated usage is not automatically an error. These checks concern exact keys, not translation quality, locale fallback, interpolation variables, or pluralization; no locale data is downloaded.
  • A replay requires the same complete input and implementation. The stated sampling convention applies within its eligible space. A finite draw does not exhaust all possible outputs; repeats remain possible unless a distinct-selection rule is explicit.
  • The field tables state structural bounds; cross-field constraints and bounded search or output budgets also apply. Unknown keys are rejected where the object contract disallows them. Input errors are distinct from null fields and deliberate invalid controls in a successful output.

Alternative or Complementary methods

For a supplied example, inspect the returned construction or delegated check directly. To evaluate a consumer, also test cases chosen for its own boundaries; a generated finite corpus does not establish exhaustive coverage.

References

  1. Tool behavior and example: Random Document Localization Key Fixture Generator — tool.io

Similar or alternative tools

  • Random CSV Foreign Key Integrity Dataset Generator

    Construct synthetic parent and child tables with an exact sampled orphan count, retaining reference truth, core match rate and orphan data-row indices.

  • Sequential Pattern Mining Tool

    Mine bounded frequent ordered subsequences of single-event string sequences using prefix projection, allowing arbitrary gaps and repeated events and counting each source sequence at most once per pattern.