{"record":{"id":"2d19e206bfbb2286","repo":"quarkusio/quarkus","slug":"locale-of-s-conflicts-with-the-locale-s-of-t","errorCode":null,"errorMessage":"Locale of [%s] conflicts with the locale [%s] of the default message bundle [%s]","messagePattern":"Locale of \\[(.+?)\\] conflicts with the locale \\[(.+?)\\] of the default message bundle \\[(.+?)\\]","errorType":"exception","errorClass":"MessageBundleException","httpStatus":null,"severity":"error","filePath":"extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java","lineNumber":203,"sourceCode":"\n                    if (found.containsKey(name)) {\n                        throw new MessageBundleException(\n                                String.format(\"Message bundle interface name conflict - [%s] is used for both [%s] and [%s]\",\n                                        name, bundleClass, found.get(name)));\n                    }\n                    found.put(name, bundleClass);\n\n                    // Find localizations for each interface\n                    String defaultLocale = getDefaultLocale(bundleAnnotation, locales);\n                    List<ClassInfo> localized = new ArrayList<>();\n                    for (ClassInfo implementor : index.getKnownDirectSubinterfaces(bundleClass.name())) {\n                        localized.add(implementor);\n                    }\n                    Map<String, ClassInfo> localeToInterface = new HashMap<>();\n                    for (ClassInfo localizedInterface : localized) {\n                        String locale = localizedInterface.declaredAnnotation(Names.LOCALIZED).value().asString();\n                        if (defaultLocale.equals(locale)) {\n                            throw new MessageBundleException(\n                                    String.format(\n                                            \"Locale of [%s] conflicts with the locale [%s] of the default message bundle [%s]\",\n                                            localizedInterface, locale, bundleClass));\n                        }\n                        ClassInfo previous = localeToInterface.put(locale, localizedInterface);\n                        if (previous != null) {\n                            throw new MessageBundleException(String.format(\n                                    \"Cannot register [%s] - a localized message bundle interface exists for locale [%s]: %s\",\n                                    localizedInterface, locale, previous));\n                        }\n                        localizedInterfaces.add(localizedInterface.name());\n                    }\n\n                    // Find localized files\n                    Map<String, List<MessageFile>> localeToFiles = new HashMap<>();\n                    // Message templates not specified by a localized interface are looked up in a localized file (merge candidate)\n                    Map<String, List<MessageFile>> localeToMergeCandidates = new HashMap<>();\n                    for (MessageFile messageFile : messageFiles) {","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/qute/deployment/src/main/java/io/quarkus/qute/deployment/MessageBundleProcessor.java#L185-L221","documentation":"MessageBundleException thrown at build time when a subinterface annotated @Localized(\"xx\") uses the same locale as the default bundle's locale (from @MessageBundle(defaultLocale=...) or the application's quarkus.default-locale). The default bundle interface itself already serves that locale, so a separate @Localized interface for it is redundant and ambiguous. The build fails, naming the conflicting interface and locale.","triggerScenarios":"Default bundle locale is e.g. 'en' and someone creates interface AppMessages_en annotated @Localized(\"en\"); or @MessageBundle(locale=\"en\") while quarkus.default-locale is also en and a @Localized(\"en\") subinterface exists.","commonSituations":"Adding localizations and mechanically including the base language; setting quarkus.default-locale to a new value (e.g. changing app default from en to de) which makes an existing @Localized(\"en\") bundle suddenly collide (or the reverse); copying an existing localized interface and forgetting to change the @Localized value.","solutions":["Remove the @Localized subinterface whose locale equals the default bundle locale — the base bundle already covers it.","Change the @Localized value to a different locale, e.g. @Localized(\"de\").","Or change the bundle's default locale (@MessageBundle(locale=\"...\")) so it no longer equals the localized interface's locale."],"exampleFix":"// before (defaultLocale = \"en\")\n@MessageBundle public interface AppMessages { @Message String hello(); }\n@Localized(\"en\") public interface AppMessages_en extends AppMessages { @Message String hello(); }\n\n// after\n@MessageBundle public interface AppMessages { @Message String hello(); }\n@Localized(\"de\") public interface AppMessages_de extends AppMessages { @Message String hello(); }","handlingStrategy":"validation","validationCode":"// ensure @Localized locales never equal the bundle default locale:\nString defaultLocale = \"en\"; // @MessageBundle(locale=...) or quarkus.default-locale\nfor (Class<?> c : localizedInterfaces) {\n    String loc = c.getAnnotation(Localized.class).value();\n    if (loc.equals(defaultLocale)) throw new IllegalStateException(c + \" duplicates default locale \" + defaultLocale);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never create @Localized subinterfaces for the bundle's default locale — extend/override in the base interface instead.","When changing quarkus.default-locale or @MessageBundle(locale=...), audit all @Localized values for collisions.","Follow the naming convention XxxMessages_<locale> so mismatches are visible in code review.","Centralize supported locales in a constant/list and reference it in reviews."],"tags":["quarkus","qute","i18n","locale","message-bundle"],"backgroundTag":"locale-conflict","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}