diff --git a/content/languages.yml b/content/languages.yml index ee7aa00c0..ff0be2c1d 100644 --- a/content/languages.yml +++ b/content/languages.yml @@ -42,7 +42,7 @@ - name: French translated_name: Français code: fr - status: 1 + status: 2 - name: Gujarati translated_name: ગુજરાતી code: gu @@ -123,6 +123,9 @@ translated_name: සිංහල code: si status: 0 +- name: Swedish + translated_name: Svenska + code: sv - name: Tamil translated_name: தமிழ் code: ta @@ -158,4 +161,4 @@ - name: Traditional Chinese translated_name: 繁體中文 code: zh-hant - status: 0 \ No newline at end of file + status: 0 diff --git a/src/components/CodeEditor/CodeEditor.js b/src/components/CodeEditor/CodeEditor.js index 39ebe8f1e..de8235438 100644 --- a/src/components/CodeEditor/CodeEditor.js +++ b/src/components/CodeEditor/CodeEditor.js @@ -11,6 +11,12 @@ import {LiveEditor, LiveProvider} from 'react-live'; import {colors, media} from 'theme'; import MetaTitle from 'templates/components/MetaTitle'; +// Replace unicode to text for other languages +const unicodeToText = text => + text.replace(/\\u([\dA-F]{4})/gi, (_, p1) => + String.fromCharCode(parseInt(p1, 16)), + ); + const compileES5 = ( code, // eslint-disable-next-line no-undef ) => Babel.transform(code, {presets: ['es2015', 'react']}).code; @@ -271,7 +277,7 @@ class CodeEditor extends Component { if (showJSX) { newState.code = code; - newState.compiledES6 = compileES6(code); + newState.compiledES6 = unicodeToText(compileES6(code)); } else { newState.compiledES6 = code; } diff --git a/src/site-constants.js b/src/site-constants.js index 2dc51fadc..f26103279 100644 --- a/src/site-constants.js +++ b/src/site-constants.js @@ -8,7 +8,7 @@ // NOTE: We can't just use `location.toString()` because when we are rendering // the SSR part in node.js we won't have a proper location. const urlRoot = 'https://reactjs.org'; -const version = '16.8.3'; +const version = '16.8.4'; const babelURL = 'https://unpkg.com/babel-standalone@6.26.0/babel.min.js'; export {babelURL, urlRoot, version};