Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate CodeEditor #20

Merged
merged 4 commits into from
Feb 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/components/CodeEditor/CodeEditor.js
Original file line number Diff line number Diff line change
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adblock FTW

</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