@duckduckgo/content-scope-scripts
    Preparing search index...

    Interface ApplyParams

    Native sends translations to write back.

    interface ApplyParams {
        requestId?: string;
        sourceLanguage: string;
        targetLanguage: string;
        updates: { id: number; text?: string; tree?: string }[];
    }
    Index
    requestId?: string

    Opaque id native sends with the request; echoed in the reply.

    sourceLanguage: string

    Detected page language (BCP 47). Content marked as another language is not written back.

    targetLanguage: string

    Language translated into (BCP 47). Set as the page lang on the first write.

    updates: { id: number; text?: string; tree?: string }[]

    Type Declaration

    • id: number
    • Optionaltext?: string

      The translation of a plain-text unit (html: false).

    • Optionaltree?: string

      For an HTML unit (html: true): TranslateKit's JSON tree of the translated HTML (translate with htmlAsJSONTree), passed through unchanged. "null" means TranslateKit found the HTML malformed.