Open heimwege opened 3 months ago
That would be nice, but the cds-compiler API doesn't seem to support the i18n, even if we pass them directly... We could replace and parse in the target EDMX but that becomes a bigger work :/
Oh no. This might be a real blocker for using the plugin because e.g. OPA5 tests might fail if the text is not as expected. I'll open a CAP issue and ask the guys? They must do it somewhere along the cds build
as well π€·π»
Let me check for a dirty solution :)
Ok, then I'll wait for your feedback π±
1.2.1
looks much better π₯³ i18n is shown but there are some superfluous ,
(just for some not all π€·π»)
That might be due to what i copied ;o
The ,
is gone in 1.2.2
. And I adjusted the i18n keys to ese the identification (samples
and Samples
looks quite the same π). So now we're at
The cds common stuff works ππ» but the annotations from db/data-model.cds
({i18n>nameI18n}
) and app/samples/ui-annotations.cds
({i18n>samplesI18n}
) are using the i18n key instead of the value as fallback because loadI18nMap is being called with dirName
pointing to the app folder <someLocalPath>\cap-fe-ts-sample\app\samples
. Hence all the i18n paths from loadI18nMap do not point to a file π’
Maybe project-access or i18n could help to find the i18n file(s)?
Or the location
from the csn could be used as starting point
Or add hard coded /webapp/i18n
and /../../srv/i18n
. That worked for me as well π±
Dependencies are not really possible or wanted as they tend to create dedicated fs
requirement :)
Looking at the cds documentation /webapp/i18n would not be considered, maybe /../../srv/i18n because this file is being loaded ....
Do you have a sample repo that i can check directly ? would avoid more back and forth :)
Here's the respective branch: https://github.com/heimwege/cap-node-fe-ts-sample/tree/Fe-mockserver-plugin-cds
just npm run install:all
and npm run ui:mockserver
then you see
The green marked texts are wrong (from srv/i18n/i18n.properties
):
samples
should be Samples_i18n
name
should be Name_i18n
Description
i18n annotations in the data model, e.g.
/srv/i18n/i18n.properties
/db/data-model.cds
are not being resolved in the metadata
whereas the
cds build
resolves it toThe i18n used in the UI annotations (referring to
./webapp/i18n/i18n.properties
) work fineExpected results
UI displaying
Name
as table column header (e.g. when property is used as LineItem)Actual results
UI displays
{i18n>name}
as table column header (e.g. when property is used as LineItem)Screenshots
table title i18n coming from
./webapp/i18n/i18n.properties
ππ» table column headers coming from/srv/i18n/i18n.properties
or even directly from CAP (using@sap/cds/common
) likeChangedBy
ππ»Not sure where the path
../i18n/i18n.properties
is coming from π€·π»Version/Components/Environment
Add any other context about the problem here OS:
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}