bettercap/bettercap · error · Error

i18n postprocess: unmatched ICU - ${match} with key: ${key}

Error message

i18n postprocess: unmatched ICU - ${match} with key: ${key}

What it means

During i18n postprocessing Angular replaces ICU variable placeholders (like VAR_PLURAL) with values from the replacements map. If a key is absent from that map, the placeholder is left raw in the rendered message, indicating the translation ICU expression and the provided replacement values disagree.

Source

Thrown at modules/ui/ui/vendor.js:52331

    // return current result if no replacements specified
    if (!Object.keys(replacements).length) {
        return result;
    }
    //
    // Step 2: replace all ICU vars (like "VAR_PLURAL")
    //
    result = result.replace(PP_ICU_VARS, function (match, start, key, _type, _idx, end) {
        return replacements.hasOwnProperty(key) ? "" + start + replacements[key] + end : match;
    });
    //
    // Step 3: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)
    // in case multiple ICUs have the same placeholder name
    //
    result = result.replace(PP_ICUS, function (match, key) {
        if (replacements.hasOwnProperty(key)) {
            var list = replacements[key];
            if (!list.length) {
                throw new Error("i18n postprocess: unmatched ICU - " + match + " with key: " + key);
            }
            return list.shift();
        }
        return match;
    });
    return result;
}
/**
 * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes
 * into the render tree, moves the placeholder nodes and removes the deleted nodes.
 */
function i18nEnd() {
    var tView = getTView();
    ngDevMode && assertDefined(tView, "tView should be defined");
    ngDevMode &&
        assertEqual(tView.firstTemplatePass, true, "You should only call i18nEnd on first template pass");
    if (tView.firstTemplatePass) {
        i18nEndFirstPass(tView);

View on GitHub (pinned to 8eca2820f3)

Solutions

  1. Ensure all ICU variables referenced by the translated template are supplied in the replacements object
  2. Re-extract translations after template changes so ICU placeholder names stay in sync
  3. Inspect the translation unit (XLIFF/XTB) for a renamed or missing ICU variable
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/ui/ui/vendor.js:52331 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bettercap/bettercap@8eca2820f3 (2026-09-02). Data as JSON: /api/errors/c714d096c7820b63. Report an issue: GitHub.