{"record":{"id":"26296f0d6e8dd086","repo":"quarkusio/quarkus","slug":"message-template-for-key-s-is-missing-for-defau","errorCode":null,"errorMessage":"Message template for key [%s] is missing for default locale [%s]","messagePattern":"Message template for key \\[(.+?)\\] is missing for default locale \\[(.+?)\\]","errorType":"exception","errorClass":"MessageBundleException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java","lineNumber":1140,"sourceCode":"                                            .append(enumConstantKey)\n                                            .append(\"}\");\n                                    // For each constant we generate a method:\n                                    // myEnum_CONSTANT(MyEnum val)\n                                    // myEnum_$CONSTANT_1(MyEnum val)\n                                    // myEnum_$CONSTANT$NEXT(MyEnum val)\n                                    generateEnumConstantMessageMethod(cc, bundleName, locale, bundleInterface,\n                                            defaultBundleInterface, enumConstantKey, keyMap, enumConstantTemplate,\n                                            messageTemplateMethods);\n                                }\n                                generatedMessageTemplate.append(\"{/when}\");\n                                messageTemplate = generatedMessageTemplate.toString();\n                                generatedTemplate = true;\n                            }\n                        }\n                    }\n\n                    if (messageTemplate == null) {\n                        throw new MessageBundleException(\n                                String.format(\"Message template for key [%s] is missing for default locale [%s]\", key,\n                                        bundle.getDefaultLocale()));\n                    }\n\n                    String templateId = null;\n                    String defaultLocale = locale;\n                    if (messageTemplate.contains(\"}\")) {\n                        // Qute is needed - at least one expression/section found\n                        if (defaultBundleInterface != null) {\n                            if (defaultLocale == null) {\n                                AnnotationInstance localizedAnnotation = bundleInterface.declaredAnnotation(Names.LOCALIZED);\n                                defaultLocale = localizedAnnotation.value().asString();\n                            }\n                            templateId = bundleName + \"_\" + defaultLocale + \"_\" + key;\n                        } else {\n                            templateId = bundleName + \"_\" + key;\n                        }\n                    }","sourceCodeStart":1122,"sourceCodeEnd":1158,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java#L1122-L1158","documentation":"Every message key in a bundle must have a template for the bundle's default locale. When processing bundle methods/properties, if no message template is found for a key in the default locale, MessageBundleException is thrown at build time.","triggerScenarios":"A @MessageBundle interface declares a method (key) whose template is missing from the default-locale message file (or no @Message annotation provides the template), e.g. only non-default-locale .properties files define the key.","commonSituations":"Translating messages: adding keys to messages_de.properties but forgetting messages.properties; mismatch between method name and properties key; renamed method without updating properties file.","solutions":["Add the missing key/template to the default locale bundle file (e.g. src/main/resources/messages/messages.properties)","Or annotate the bundle interface method with @Message(\"template\") to provide the default template inline","Verify the method name matches the key in the properties file exactly"],"exampleFix":"// before: only messages_de.properties has greeting=Hallo\n// messages.properties\n// after\ngreeting=Hello\n","handlingStrategy":"validation","validationCode":"// Ensure default locale file contains all keys\nProperties def = new Properties();\ndef.load(getClass().getResourceAsStream(\"/messages/messages.properties\"));\nfor (String key : requiredKeys) {\n    if (!def.containsKey(key)) throw new IllegalStateException(\"Missing default-locale key: \" + key);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always update messages.properties (default locale) first, then translations","Add an i18n test comparing key sets across locale files","Mirror method renames in properties files in the same commit"],"tags":["qute","message-bundle","i18n","missing-key"],"backgroundTag":"missing-message-bundle-key","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}