Skip to content

Commit

Permalink
Translate babel error message and source code comments (reactjs#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
abnersajr authored and cezaraugusto committed Feb 9, 2019
1 parent d653bf4 commit 6bb8910
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/components/CodeEditor/CodeEditor.js
Expand Up @@ -56,12 +56,10 @@ class CodeEditor extends Component {
if (showBabelErrorMessage) {
errorMessage = (
<span>
Babel could not be loaded.
O Babel não pôde ser carregado.
<br />
<br />
This can be caused by an ad blocker. If you're using one, consider
adding reactjs.org to the whitelist so the live code examples will
work.
Isto pode ser causado por algum bloqueador de anúncio. Se você está usando algum, considere adicionar o endereço reactjs.org na <i>whitelist</i>, ou lista de permitidos, e feito isso os exemplos com <i>live code</i> irão funcionar.
</span>
);
} else if (error != null) {
Expand Down Expand Up @@ -244,8 +242,8 @@ class CodeEditor extends Component {
const {compiled} = this.state;

try {
// Example code requires React, ReactDOM, and Remarkable to be within scope.
// It also requires a "mountNode" variable for ReactDOM.render()
// O código de exemplo requer que o React, o ReactDOM e o Remarkable estejam dentro do escopo.
// Também requer uma variável "mountNode" para ReactDOM.render()
// eslint-disable-next-line no-new-func
new Function('React', 'ReactDOM', 'Remarkable', compiled)(
React,
Expand Down Expand Up @@ -280,8 +278,8 @@ class CodeEditor extends Component {
} catch (error) {
console.error(error);

// Certain ad blockers (eg Fair AdBlocker) prevent Babel from loading.
// If we suspect this is the case, we can show a more helpful error.
// Certos bloqueadores de anúncios (ex: Fair AdBlocker) evitam que o Babel carregue.
// Se suspeitarmos que este é o caso, nós podemos exibir uma mensagem de ajuda melhor.
const showBabelErrorMessage = !window.Babel;

return {
Expand Down

0 comments on commit 6bb8910

Please sign in to comment.