Skip to content

Commit 62b0c6d

Browse files
Re-enable localization on the start page. (#15297)
(for #15232) Localization was accidentally disabled in #14447 (October) when we split out the Jupyter extension.
1 parent 778ca97 commit 62b0c6d

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

news/2 Fixes/15232.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Re-enable localization on the start page. It was accidentally
2+
disabled in October when the Jupyter extension was split out.

src/startPage-ui/startPage/startPage.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import * as React from 'react';
66
import '../../client/common/extensions';
7+
import { SharedMessages } from '../../client/common/startPage/messages';
78
import { ISettingPackage, IStartPageMapping, StartPageMessages } from '../../client/common/startPage/types';
89
import { Image, ImageName } from '../react-common/image';
9-
import { getLocString } from '../react-common/locReactSide';
10+
import { getLocString, storeLocStrings } from '../react-common/locReactSide';
1011
import { IMessageHandler, PostOffice } from '../react-common/postOffice';
1112
import './startPage.css';
1213

@@ -146,9 +147,20 @@ export class StartPage extends React.Component<IStartPageProps> implements IMess
146147
}
147148

148149
public handleMessage = (msg: string, payload?: any) => {
149-
if (msg === StartPageMessages.SendSetting) {
150-
this.releaseNotes.showAgainSetting = payload.showAgainSetting;
151-
this.setState({});
150+
switch (msg) {
151+
case StartPageMessages.SendSetting:
152+
this.releaseNotes.showAgainSetting = payload.showAgainSetting;
153+
this.setState({});
154+
break;
155+
156+
case SharedMessages.LocInit:
157+
// Initialize localization.
158+
const locJSON = JSON.parse(payload);
159+
storeLocStrings(locJSON);
160+
break;
161+
162+
default:
163+
break;
152164
}
153165

154166
return false;

0 commit comments

Comments
 (0)