[ComponentServer] load locale from sharedResourcesBase

The locale is considered a shared resource, so when we load it we should
use the sharedResourcesBase argument that can be supplied when
instantiating the server.

Bug: none
Change-Id: Ic89b27bcd12b514e3efbef20a550062fcd871680
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3109847
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
This commit is contained in:
Jack Franklin
2021-08-20 13:21:17 +00:00
committed by Devtools-frontend LUCI CQ
parent 49556e02b5
commit 2ef4d05706
+2 -1
View File
@@ -294,7 +294,8 @@ async function requestHandler(request, response) {
let fullPath = path.join(componentDocsBaseFolder, filePath);
if (fullPath.endsWith(path.join('locales', 'en-US.json'))) {
// Rewrite this path so we can load up the locale in the component-docs
fullPath = path.join(componentDocsBaseFolder, 'front_end', 'core', 'i18n', 'locales', 'en-US.json');
fullPath =
path.join(componentDocsBaseFolder, sharedResourcesBase, 'front_end', 'core', 'i18n', 'locales', 'en-US.json');
}
if (!fullPath.startsWith(devtoolsRootFolder) && !fileIsInTestFolder) {