Skip to content

Commit 01ab50f

Browse files
authored
Merge pull request #164 from reactjs/sync-b50fe64c
Sync with reactjs.org @ b50fe64
2 parents bc0a2a0 + 293fcbc commit 01ab50f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

content/languages.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
- name: French
4343
translated_name: Français
4444
code: fr
45-
status: 1
45+
status: 2
4646
- name: Gujarati
4747
translated_name: ગુજરાતી
4848
code: gu
@@ -123,6 +123,9 @@
123123
translated_name: සිංහල
124124
code: si
125125
status: 0
126+
- name: Swedish
127+
translated_name: Svenska
128+
code: sv
126129
- name: Tamil
127130
translated_name: தமிழ்
128131
code: ta
@@ -158,4 +161,4 @@
158161
- name: Traditional Chinese
159162
translated_name: 繁體中文
160163
code: zh-hant
161-
status: 0
164+
status: 0

src/components/CodeEditor/CodeEditor.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ import {LiveEditor, LiveProvider} from 'react-live';
1111
import {colors, media} from 'theme';
1212
import MetaTitle from 'templates/components/MetaTitle';
1313

14+
// Replace unicode to text for other languages
15+
const unicodeToText = text =>
16+
text.replace(/\\u([\dA-F]{4})/gi, (_, p1) =>
17+
String.fromCharCode(parseInt(p1, 16)),
18+
);
19+
1420
const compileES5 = (
1521
code, // eslint-disable-next-line no-undef
1622
) => Babel.transform(code, {presets: ['es2015', 'react']}).code;
@@ -271,7 +277,7 @@ class CodeEditor extends Component {
271277

272278
if (showJSX) {
273279
newState.code = code;
274-
newState.compiledES6 = compileES6(code);
280+
newState.compiledES6 = unicodeToText(compileES6(code));
275281
} else {
276282
newState.compiledES6 = code;
277283
}

src/site-constants.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// NOTE: We can't just use `location.toString()` because when we are rendering
99
// the SSR part in node.js we won't have a proper location.
1010
const urlRoot = 'https://ja.reactjs.org';
11-
const version = '16.8.3';
11+
const version = '16.8.4';
1212
const babelURL = 'https://unpkg.com/[email protected]/babel.min.js';
1313

1414
export {babelURL, urlRoot, version};

0 commit comments

Comments
 (0)