Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improved locale support #39

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

GoWale
Copy link
Contributor

@GoWale GoWale commented Feb 11, 2024

maybe this suggestion for issue: #25 is OK?

src/index.ts Outdated
// check for existing files
if(!locale && options.locale && fs.existsSync(i18nPath.replace(/(\.properties)$/, `_${options.locale}$1`))) locale = i18nPath.replace(/(\.properties)$/, `_${options.locale}$1`)
// https://cap.cloud.sap/docs/node.js/events#locale => req.locale or old (cds.user.locale)
if(!locale && req_locale.default(request) && fs.existsSync(i18nPath.replace(/(\.properties)$/, `_${cds.user?.local}$1`))) locale = i18nPath.replace(/(\.properties)$/, `_${req_locale.default(request)}$1`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(!locale && req_locale.default(request) && fs.existsSync(i18nPath.replace(/(.properties)$/, _${req_locale.default(request)}$1))) locale = i18nPath.replace(/(.properties)$/, _${req_locale.default(request)}$1)

@geert-janklaps geert-janklaps changed the title Local feature: improved locale support Feb 12, 2024
@geert-janklaps geert-janklaps changed the title feature: improved locale support feat: improved locale support Feb 12, 2024
@GoWale
Copy link
Contributor Author

GoWale commented Feb 13, 2024

I hope this is a little bit more clear.

Im sorry but after the last changes to pnpm I'm not able to get the local test to work...
so I'm kind of editing in the dark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant