I have to use multiple translatePartialLoader with different urlTemnplate. I am using angular-translate-loader-pluggable. It seems like the child module urltemplate overrides the parent modules urltemplate
Parent Module Config
$translateProvider.useLoader('$translatePartialLoader', {
urlTemplate: __env.hostUrl + '/*****/****/localization/resource_bundle?bundle_name={part}&locale={lang}'
});
$translateProvider.useLoader('translatePluggableLoader');
Child Module Config
translatePluggableLoaderProvider.useLoader('$translatePartialLoader', {
urlTemplate: navigationConfig.rsiDomain + navigationConfig.rsiBaseUrl + navigationConfig.localizationUrl + '?bundle_name={part}&locale={lang}'
});
The issue you're encountering is because you're using the same loader, $translatePartialLoader, in both the parent module and the child module. The behavior you're seeing, where the child module's URL template overrides the parent module's, is expected in this case.
One solution to this problem is to use a different loader in each module. You can create a custom loader for each module that specifies the desired URL template. Then you can use the custom loaders in each module's configuration, like this:
Parent Module Config
$translateProvider.useLoader('parentModuleLoader', { urlTemplate: __env.hostUrl + '/*****/****/localization/resource_bundle?bundle_name={part}&locale={lang}' }); $translateProvider.useLoader('translatePluggableLoader');
Child Module Config
translatePluggableLoaderProvider.useLoader('childModuleLoader', { urlTemplate: navigationConfig.rsiDomain + navigationConfig.rsiBaseUrl + navigationConfig.localizationUrl + '?bundle_name={part}&locale={lang}' });
By using different custom loaders in each module, you can ensure that each module uses its own URL template, without affecting the URL template used by the other module.