Lokalized JavaScript — Version 1.0.0
    Preparing search index...

    Function mergeParsedStringsFiles

    • Merge parsed shards for one normalized locale. For example, en-us and en-US can be merged, while pt and pt-PT remain separate catalogs.

      Identical repeated keys are deduplicated and their origins combined. Conflicting definitions throw with both origins identified. Limits apply to the merged model after deduplication; original byte counts and JSON nesting cannot be checked from parsed values.

      Parameters

      • files: readonly Readonly<
            {
                $lokalized: "parsed-strings-file";
                locale: string;
                originsByKey: Readonly<Record<string, readonly string[]>>;
                sources: readonly string[];
                strings: readonly Readonly<
                    {
                        alternatives?: readonly Readonly<
                            {
                                alternatives?: readonly Readonly<{ expression: string; translation?: string | undefined; commentary?: string | undefined; placeholders?: Readonly<Record<string, PlaceholderDefinitionInput>> | undefined; alternatives?: readonly Readonly<...>[] | undefined; }>[] | undefined;
                                commentary?: (...)
                                | (...);
                                expression: string;
                                placeholders?: (...) | (...);
                                translation?: (...) | (...);
                            },
                        >[];
                        commentary?: string;
                        key: string;
                        placeholders?: Readonly<Record<string, PlaceholderDefinitionInput>>;
                        translation?: string;
                    },
                >[];
                warnings: readonly Readonly<
                    {
                        key: string;
                        locale: string;
                        message: string;
                        missingLanguageForms: readonly string[];
                        placeholder: string;
                        source: string;
                        type: | "INCOMPLETE_CARDINALITY_TRANSLATIONS"
                        | "INCOMPLETE_ORDINALITY_TRANSLATIONS";
                    },
                >[];
            },
        >[]

        the shards, in the order their sources should appear

      • Optionaloptions: Readonly<{ limits?: ParsedCatalogLimits }>

        limits for the merged catalog

      Returns ParsedStringsFile

      on no input, a locale disagreement, a conflicting repeated key, a value that is not a parsed strings file, or a limit the merged catalog exceeds