From 3e206382a3e5dfd6168162f8cd3538b4160dedc6 Mon Sep 17 00:00:00 2001 From: Buse Halis Date: Fri, 24 Jul 2026 13:56:09 +0200 Subject: [PATCH 1/2] fix: fall back to Locale.ROOT when no i18n_en.properties exists for English locale --- .../com/sap/cds/notifications/helpers/I18nHelper.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cds-feature-notifications/src/main/java/com/sap/cds/notifications/helpers/I18nHelper.java b/cds-feature-notifications/src/main/java/com/sap/cds/notifications/helpers/I18nHelper.java index 45e3626..4d6ecdc 100644 --- a/cds-feature-notifications/src/main/java/com/sap/cds/notifications/helpers/I18nHelper.java +++ b/cds-feature-notifications/src/main/java/com/sap/cds/notifications/helpers/I18nHelper.java @@ -110,7 +110,15 @@ public Set getAvailableLocalesForEvent(CdsEvent event) { public Map getI18nTexts(Locale locale) { EdmxI18nProvider provider = getProvider(); if (provider != null) { - return provider.getTexts(locale); + Map texts = new HashMap<>(provider.getTexts(locale)); + // Also include Locale.ROOT (default i18n.properties) as fallback so that apps without an + // explicit i18n_en.properties file work correctly. putIfAbsent ensures that locale-specific + // entries from i18n_en.properties take precedence over root entries when both exist. + if (Locale.ENGLISH.equals(locale)) { + Map rootTexts = provider.getTexts(Locale.ROOT); + rootTexts.forEach(texts::putIfAbsent); + } + return texts; } logger.warn("EdmxI18nProvider not available, i18n resolution will not work"); return Collections.emptyMap(); From 0979ffe04bd935aa21ab488e00ac66750864d216 Mon Sep 17 00:00:00 2001 From: Buse Halis Date: Fri, 24 Jul 2026 14:42:49 +0200 Subject: [PATCH 2/2] docs: add CHANGELOG entry for i18n English root fallback fix --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e42f879..536367e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Fixed ## Version 0.0.2-alpha - 2026-07-20 +### Fixed +- Fall back to `Locale.ROOT` (`i18n.properties`) when no explicit `i18n_en.properties` exists, so applications following the CAP default i18n convention no longer fail at startup with unresolved English placeholders + ### Changed - Updated cds.services.version to 5.0.0