'Jhipster with web context resolve i18n resource with wrong url

I have developed a site using Jhipster, for customer need - in production - it must be deployed using a web context different from / , e.g. /CustomerPortal. Setting for Spring servlet context and for Angular webpack.prod.js BaseHrefWebpackPlugin({ baseHref: '/CustomerPortal' }), all work well.

Only the URLs for i18n files are wrong.

In the Jhipster github I found an old issue related to this problem, where someone suggest to modify webpack scripts webpack.common.js, in this way:

 new MergeJsonWebpackPlugin({
        output: {
            groupBy: [
                { pattern: './src/main/webapp/i18n/en/*.json', fileName: './i18n/en.json' },
                { pattern: './src/main/webapp/i18n/en/*.json', fileName: './CustomerPortal/i18n/en.json' },
                { pattern: './src/main/webapp/i18n/it/*.json', fileName: './i18n/it.json' },
                { pattern: './src/main/webapp/i18n/it/*.json', fileName: './CustomerPortal/i18n/it.json' }
                // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array
            ]
        }
    })

I follow this suggestion, but it dosen't work for me, when I inspect chrome I always see error 404 (not found) for i18n files because the base context in the requests is omitted. The request url is always http://my.base.portal/i18n/en.json instead of the expected http://my.base.portal/CustomerPortal/i18n/en.json.

Any suggestion to solve this issue? Thanks in advance.

EDIT NOTE:

With this settings if I call directly in the browser the resource url http://my.base.portal/CustomerPortal/i18n/it.json I can see the downloaded (and correctly) json. So the problem is only about the URL composition from the angular client (the resource is present in the back-end).



Solution 1:[1]

SOLUTION Following this tips worked for me I modify the suggestion, with (in core.module.ts):

declare let process: any;
const env = process.env.NODE_ENV;
const i18nRoute = env === 'production' || env === 'prod' ? '/CustomerPortal/i18n/' : '/i18n/';

export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader 
   {
    return new TranslateHttpLoader(http, i18nRoute);
}

Solution 2:[2]

You can use the below REST API to Update settings on a specified Elastic Pool.

PATCH https://dev.azure.com/{organization}/_apis/distributedtask/elasticpools/{poolId}?api-version=6.1-preview.1

You can do all the updates as mentioned in this Document like maxCapacity,timeToLiveMinutes and others.

You can do a REST call to update setting desiredIdle to keep the Number of machines to have ready waiting for jobs.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 giovanni
Solution 2 RajkumarMamidiChettu-MT