open-ux-tools icon indicating copy to clipboard operation
open-ux-tools copied to clipboard

BUG - Unable to load i18n bundle when started with CDS

Open longieirl opened this issue 3 months ago • 4 comments

Description

UI frontend is unable to load the i18n bundles when loaded via a CAP project.

i18n property function is loaded with a path of . instead of ./app/<project-name>.

}
info fiori-tools-proxy Using UI5 version 1.140.0 based on manifest.json
info fiori-tools-proxy Starting fiori-tools-proxy using following configuration:
info fiori-tools-proxy proxy: 'undefined'
info fiori-tools-proxy ignoreCertErrors: 'false'
info fiori-tools-proxy backend: undefined
info fiori-tools-proxy ui5: [{"path":"/resources","url":"https://sapui5.hana.ondemand.com","version":"1.140.0"},{"path":"/test-resources","url":"https://sapui5.hana.ondemand.com","version":"1.140.0"}]
info fiori-tools-proxy debug: 'false'
info fiori-tools-appreload Livereload middleware started for port 35729 and path /Users/Downloads/cap-app/app/translation-ui/webapp
warn fiori-tools-preview Failed to load i18n properties bundle
warn fiori-tools-preview Failed to load i18n properties bundle

This is not an issue when deployed, only impacts SAPUI5 apps when rendered locally.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Generate a CAP project;
cds init managedAppCAPProject && cd  managedAppCAPProject && npm install && cds add tiny-sample && cds add hana && cds add mta && cds add xsuaa && cds add connectivity && cds add destination && cds add html5-repo && cds build --for hana && cp gen/db/package.json db && npm i
  1. Append a SAPUI5 UI app using SAP Fiori tools generator
  2. Start the server using npm run start

Expected results

i18n bundle is loaded

Actual results

i18n fails to load since the project path is . and the UI app is not found in that path.

Screenshots

If applicable, add screenshots to help explain the problem.

Version/Components/Environment

Add any other context about the problem here OS:

  • [ ] Mac OS
  • [ ] Windows
  • [ ] Other

Root Cause Analysis

Problem

{describe the problem}

Fix

{describe the fix}

Why was it missed

{Some explanation why this issue might have been missed during normal development/testing cycle}

How can we avoid this

{if we don’t want to see this type of issues anymore what we should do to prevent}

longieirl avatar Oct 10 '25 09:10 longieirl

FYI @heimwege

longieirl avatar Oct 10 '25 09:10 longieirl

Note that AFAIK it is not just i18n that is effected, as the app list from the manifest is coming back as an empty list so project access functions are all affected.

donal-tobin-sap avatar Oct 10 '25 09:10 donal-tobin-sap

This may be related to the manifest version which is 1.76.0 for the customer.

donal-tobin-sap avatar Oct 10 '25 10:10 donal-tobin-sap

If there is no ui5-local.yaml in the UI5 project, then the app project is not picked up and will result in a projectRoot being returned as null. However, a ui5-local.yaml file is not part of this flow and its not expected to exist.

Removing this code and the i18n bundles are loaded; https://github.com/SAP/open-ux-tools/pull/2115/files#diff-2dea28f698e833e8eff5fc72a5ae3a43ffbf5f0cecf8f957f637efcd910490d3R222

Wondering if @PetrStribrny can confirm this flow?

longieirl avatar Oct 10 '25 13:10 longieirl