From 72ed7ff5dcbe166f59931b8aa6fcc43c342b934a Mon Sep 17 00:00:00 2001 From: GoWale Date: Sun, 11 Feb 2024 23:25:50 +0100 Subject: [PATCH] update tsc --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f8a35dd..b65c8c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -192,10 +192,10 @@ export class cds_launchpad_plugin{ } // define locale to use - const locale = null; + let locale = null; // check for existing files - if(!locale && options.locale && fs.existsSync(i18nPath.replace(/(\.properties)$/, `_${options.locale}$1`))) local = i18nPath.replace(/(\.properties)$/, `_${options.locale}$1`) + 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`) if(!locale && cds.env.i18n.default_language && fs.existsSync(i18nPath.replace(/(\.properties)$/, `_${cds.user?.local}$1`))) locale = i18nPath.replace(/(\.properties)$/, `_${cds.env.i18n.default_language}$1`)