@@ -174,15 +174,40 @@ index 5b06636edb..60b508079a 100644
174174 <!-- Require our AMD loader -->
175175 <script src="./out/vs/loader.js"></script>
176176diff --git a/src/vs/code/browser/workbench/workbench.js b/src/vs/code/browser/workbench/workbench.js
177- index 65fae7c82d..9a9b8bbe3b 100644
177+ index 65fae7c82d..a1974cd941 100644
178178--- a/src/vs/code/browser/workbench/workbench.js
179179+++ b/src/vs/code/browser/workbench/workbench.js
180- @@ -7,21 +7,26 @@
180+ @@ -7,21 +7,52 @@
181181
182182 (function () {
183183
184184+ const basePath = window.location.pathname.replace(/\/+$/, '');
185185+ const base = window.location.origin + basePath;
186+ +
187+ + let nlsConfig;
188+ + try {
189+ + nlsConfig = JSON.parse(document.getElementById('vscode-remote-nls-configuration').getAttribute('data-settings'));
190+ + if (nlsConfig._resolvedLanguagePackCoreLocation) {
191+ + const bundles = Object.create(null);
192+ + nlsConfig.loadBundle = (bundle, language, cb) => {
193+ + let result = bundles[bundle];
194+ + if (result) {
195+ + return cb(undefined, result);
196+ + }
197+ + // FIXME: Only works if path separators are /.
198+ + const path = nlsConfig._resolvedLanguagePackCoreLocation
199+ + + '/' + bundle.replace(/\//g, '!') + '.nls.json';
200+ + fetch(`${base}/resources/fetch?u=${JSON.stringify({ path })}`)
201+ + .then((response) => response.json())
202+ + .then((json) => {
203+ + bundles[bundle] = json;
204+ + cb(undefined, json);
205+ + })
206+ + .catch(cb);
207+ + };
208+ + }
209+ + } catch (error) { /* Probably fine. */ }
210+ +
186211 require.config({
187212- baseUrl: `${window.location.origin}/out`,
188213+ baseUrl: `${base}/out`,
@@ -196,13 +221,15 @@ index 65fae7c82d..9a9b8bbe3b 100644
196221- 'xterm-addon-search': `${window.location.origin}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
197222- 'xterm-addon-web-links': `${window.location.origin}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
198223- 'semver-umd': `${window.location.origin}/node_modules/semver-umd/lib/semver-umd.js`,
224+ - }
199225+ 'vscode-textmate': `${base}/node_modules/vscode-textmate/release/main`,
200226+ 'onigasm-umd': `${base}/node_modules/onigasm-umd/release/main`,
201227+ 'xterm': `${base}/node_modules/xterm/lib/xterm.js`,
202228+ 'xterm-addon-search': `${base}/node_modules/xterm-addon-search/lib/xterm-addon-search.js`,
203229+ 'xterm-addon-web-links': `${base}/node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js`,
204230+ 'semver-umd': `${base}/node_modules/semver-umd/lib/semver-umd.js`,
205- }
231+ + },
232+ + 'vs/nls': nlsConfig
206233 });
207234
208235 require(['vs/workbench/workbench.web.api'], function (api) {
0 commit comments