{"record":{"id":"744745f0dbc53231","repo":"nodejs/node","slug":"u-unsupported-error","errorCode":"U_UNSUPPORTED_ERROR","errorMessage":"Multiple @translate tags cannot be supported.","messagePattern":"Multiple @translate tags cannot be supported\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/prscmnts.cpp","lineNumber":178,"sourceCode":"    if (U_FAILURE(*status)) {\n        return 0;\n    }\n    int32_t retLen = pattern->split(src, stringArray, MAX_SPLIT_STRINGS, *status);\n    \n    UnicodeString patternString(patternStrings[option]);\n    RegexMatcher matcher(patternString, UREGEX_DOTALL, *status);\n    if (U_FAILURE(*status)) {\n        return 0;\n    } \n    int32_t count = 0;\n    for(int32_t i=0; i<retLen; i++){\n        matcher.reset(stringArray[i]);\n        if(matcher.lookingAt(*status)){\n            count++;\n        }\n    }\n    if(option == UPC_TRANSLATE && count > 1){\n        fprintf(stderr, \"Multiple @translate tags cannot be supported.\\n\");\n        exit(U_UNSUPPORTED_ERROR);\n    }\n    return count;\n}\n\nU_CFUNC int32_t \ngetAt(const char16_t* source, int32_t srcLen,\n        char16_t** dest, int32_t destCapacity,\n        int32_t index,\n        UParseCommentsOption option,\n        UErrorCode* status){\n\n    if(status == nullptr || U_FAILURE(*status)){\n        return 0;\n    }\n\n    UnicodeString     stringArray[MAX_SPLIT_STRINGS];\n    RegexPattern      *pattern = RegexPattern::compile(UnicodeString(\"@\"), UREGEX_MULTILINE, *status);","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/prscmnts.cpp#L160-L196","documentation":"While counting @translate comment annotations in resource bundle strings, genrb found more than one @translate tag in the same set of translation comments. ICU resource bundles support @translate as a special comment directive for marking translation status, but only one instance per string is supported. The tool exits the process with U_UNSUPPORTED_ERROR — this is a fatal, non-recoverable error.","triggerScenarios":"A resource bundle .txt file containing a string with multiple @translate directives in its comment block. The regex matcher counts @translate occurrences across the comment string array; if count > 1 with the UPC_TRANSLATE option, the tool exits immediately via exit(U_UNSUPPORTED_ERROR).","commonSituations":"Merging translation files that each add their own @translate tag; automated tooling that appends @translate without checking for an existing one; copy-pasting a translated string with its comment block that already contains @translate.","solutions":["Search the resource bundle .txt file for duplicate @translate tags: `grep -n '@translate' <file.txt>`","Remove all but one @translate tag from each string's comment block","If using translation management tooling, configure it to overwrite rather than append @translate directives","Run genrb with validation-only mode first (if available) to detect comment issues before full compilation"],"exampleFix":"// before: duplicate @translate tags\n    greeting {\n        // @translate\n        // @translate\n        \"Hello\"\n    }\n// after: single @translate tag\n    greeting {\n        // @translate\n        \"Hello\"\n    }","handlingStrategy":"validation","validationCode":"# Check for duplicate @translate tags before running genrb\nfor f in data/*.txt; do\n    count=$(grep -c '@translate' \"$f\" 2>/dev/null || echo 0)\n    # Check per-string: look for multiple @translate within the same comment block\n    awk '/@translate/{c++} /^\\\\s*\"/{if(c>1)print FILENAME\":\"NR\": \"c\" @translate tags\"; c=0}' \"$f\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for duplicate @translate tags before running genrb","Configure translation management tools to overwrite rather than append @translate directives","Establish a convention for @translate placement in resource bundle comments","Run a pre-build validation script that scans for duplicate comment directives"],"tags":["icu","genrb","translate","comments","validation"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}