Skip to content

Commit 0428909

Browse files
committed
fim da tradução, falta apenas revisão
1 parent 6c5251f commit 0428909

File tree

1 file changed

+72
-62
lines changed

1 file changed

+72
-62
lines changed

readme.md

Lines changed: 72 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -619,70 +619,70 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
619619
```javascript
620620

621621
// 4.2.1
622-
// Type coercion and evaluation notes
622+
// Coerção de tipo e notas sobre avaliações
623623

624-
Prefer `===` over `==` (unless the case requires loose type evaluation)
624+
Prefira `===` ao invés de `==` (ao menos em casos que necessitem avaliação de tipos flexíveis)
625625

626-
=== does not coerce type, which means that:
626+
=== não faz coerção de tipo, o que significa que:
627627

628628
"1" === 1;
629629
// false
630630

631-
== does coerce type, which means that:
631+
== faz coerção de tipo, o que significa que:
632632

633633
"1" == 1;
634634
// true
635635

636636

637637
// 4.2.2
638-
// Booleans, Truthies & Falsies
638+
// Booleanos, Verdades e Negações
639639

640-
Booleans: true, false
640+
Booleanos: true, false
641641

642-
Truthy are: "foo", 1
642+
Tipos verdadeiros são: "foo", 1
643643

644-
Falsy are: "", 0, null, undefined, NaN, void 0
644+
Tipos de negações são: "", 0, null, undefined, NaN, void 0
645645

646646
```
647647

648648

649-
5. <a name="practical">Practical Style</a>
649+
5. <a name="practical">Estilo Prático</a>
650650

651651
```javascript
652652

653653
// 5.1.1
654-
// A Practical Module
654+
// Um módulo prático
655655

656656
(function( global ) {
657657
var Module = (function() {
658658

659-
var data = "secret";
659+
var data = "segredo";
660660

661661
return {
662-
// This is some boolean property
662+
// Essa é uma propriedade booleana
663663
bool: true,
664-
// Some string value
665-
string: "a string",
666-
// An array property
664+
// Algum valor de string
665+
string: "uma string",
666+
// Uma propriedade em array
667667
array: [ 1, 2, 3, 4 ],
668-
// An object property
668+
// Uma propriedade em objeto
669669
object: {
670-
lang: "en-Us"
670+
lang: "pt-BR"
671671
},
672672
getData: function() {
673-
// get the current value of `data`
673+
// pega o valor atual de `data`
674674
return data;
675675
},
676676
setData: function( value ) {
677-
// set the value of `data` and return it
677+
// atribui o valor a data que é retornado
678678
return ( data = value );
679679
}
680680
};
681681
})();
682682

683-
// Other things might happen here
683+
// Outras coisas que também podem acontecer aqui
684684

685-
// expose our module to the global object
685+
// Expor seu módulo ao objeto global
686686
global.Module = Module;
687687

688688
})( this );
@@ -692,7 +692,7 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
692692
```javascript
693693

694694
// 5.2.1
695-
// A Practical Constructor
695+
// Um Construtor Prático
696696

697697
(function( global ) {
698698

@@ -712,13 +712,13 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
712712
};
713713

714714

715-
// To call constructor's without `new`, you might do this:
715+
// Para chamar um construtor sem o `new`, você pode fazer assim:
716716
var ctor = function( foo ) {
717717
return new Ctor( foo );
718718
};
719719

720720

721-
// expose our constructor to the global object
721+
// exponha nosso construtor ao objeto global
722722
global.ctor = ctor;
723723

724724
})( this );
@@ -727,17 +727,17 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
727727

728728

729729

730-
6. <a name="naming">Naming</a>
730+
6. <a name="naming">Nomenclatura</a>
731731

732732

733-
You are not a human code compiler/compressor, so don't try to be one.
733+
Se você não é um humano compilador ou compactador de código, não tente ser um.
734734

735-
The following code is an example of egregious naming:
735+
O código a seguir é um exemplo de nomenclatura ruim:
736736

737737
```javascript
738738

739739
// 6.1.1
740-
// Example of code with poor names
740+
// Exemplo de código com nomenclaturas fracas
741741

742742
function q(s) {
743743
return document.querySelectorAll(s);
@@ -746,14 +746,14 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
746746
for(i=0;i<els.length;i++){a.push(els[i]);}
747747
```
748748

749-
Without a doubt, you've written code like this - hopefully that ends today.
749+
Sem dúvida, você já deve ter escrito código assim - provavelmente isso acaba hoje.
750750

751-
Here's the same piece of logic, but with kinder, more thoughtful naming (and a readable structure):
751+
Aqui temos o mesmo trecho lógico, porém com uma nomenclatura simpática e mais inteligente (e uma estrutura legível):
752752

753753
```javascript
754754

755755
// 6.2.1
756-
// Example of code with improved names
756+
// Exemplo de código com nomenclatura melhorada
757757

758758
function query( selector ) {
759759
return document.querySelectorAll( selector );
@@ -770,42 +770,53 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
770770

771771
```
772772

773-
A few additional naming pointers:
773+
Algumas indicações adicionais de nomenclaturas
774774

775775
```javascript
776776

777777
// 6.3.1
778-
// Naming strings
778+
// Nomes de strings
779779

780-
`dog` is a string
780+
`dog` é uma string
781781

782782

783783
// 6.3.2
784-
// Naming arrays
784+
// Nomes de arrays
785785

786-
`dogs` is an array of `dog` strings
786+
`dogs` é uma array de strings `dog`
787787

788788

789789
// 6.3.3
790-
// Naming functions, objects, instances, etc
790+
// Nomes de funções, objetos, instancias, etc
791791

792-
camelCase; function and var declarations
792+
// funções e declarações de variáveis
793+
camelCase;
793794

794795

795796
// 6.3.4
796-
// Naming constructors, prototypes, etc.
797+
// Nomes de construtores, protótipos, etc
797798

798-
PascalCase; constructor function
799+
// função construtora
800+
PascalCase;
799801

800802

801803
// 6.3.5
802-
// Naming regular expressions
804+
// Nomes de expressões regulares
803805

804806
rDesc = //;
805807

806808

807809
// 6.3.6
808-
// From the Google Closure Library Style Guide
810+
// Do Guia de Estilos da Biblioteca do Google Closure
811+
812+
funcoesNomeadasAssim;
813+
variaveisNomeadasAssim;
814+
ConstrutoresNomeadosAssim;
815+
EnumNomeadosAssim;
816+
metodosNomeadosAssim;
817+
CONSTANTES_SIMBOLICAS_ASSIM;
818+
819+
// nota da tradução: não havia tradução no Google Closure, o original é o seguinte:
809820

810821
functionNamesLikeThis;
811822
variableNamesLikeThis;
@@ -815,25 +826,24 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
815826
SYMBOLIC_CONSTANTS_LIKE_THIS;
816827

817828

818-
819829
```
820830

821-
7. <a name="misc">Misc</a>
831+
7. <a name="misc">Miscelânea</a>
822832

823-
This section will serve to illustrate ideas and concepts that should not be considered dogma, but instead exists to encourage questioning practices in an attempt to find better ways to do common JavaScript programming tasks.
833+
Esta seção deve servir para ilustrar idéias e conceitos sobre como não se considerar isso como um dogma, mas ao invés disso deve encorajar o questionamento de práticas na tentativa de encontrar formas melhores para executar tarefas comuns na programação em JavaScript.
824834

825-
A. Using `switch` should be avoided, modern method tracing will blacklist functions with switch statements
835+
A. Utilizar `switch` deve ser evitado, métodos modernos de verificação deverão adicionar funções com `switch` em suas listas negras
826836

827-
There seems to be drastic improvements to the execution of `switch` statements in latest releases of Firefox and Chrome.
837+
Parecem haver melhorias significativamente drásticas à execução de `switch` nas últimas versões do Firefox e do Chrome:
828838
http://jsperf.com/switch-vs-object-literal-vs-module
829839

830-
Notable improvements can be witnesses here as well:
840+
Melhorias notáveis podem ser observadas aqui também:
831841
https://github.com/rwldrn/idiomatic.js/issues/13
832842

833843
```javascript
834844

835845
// 7.A.1.1
836-
// An example switch statement
846+
// Um exemplo de uma instrução switch
837847

838848
switch( foo ) {
839849
case "alpha":
@@ -843,66 +853,66 @@ Projetos _devem_ incluir alguma forma de teste unitário, de referência, de imp
843853
beta();
844854
break;
845855
default:
846-
// something to default to
856+
// algo para executar por padrão
847857
break;
848858
}
849859

850860
// 7.A.1.2
851-
// A better approach would be to use an object literal or even a module:
861+
// Um caso melhor seria utilizar um objeto literal ou até um módulo:
852862

853863
var switchObj = {
854864
alpha: function() {
855865
// instruções
856-
// a return
866+
// um retorno
857867
},
858868
beta: function() {
859869
// instruções
860-
// a return
870+
// um retorno
861871
},
862872
_default: function() {
863873
// instruções
864-
// a return
874+
// um retorno
865875
}
866876
};
867877

868878
var switchModule = (function () {
869879
return {
870880
alpha: function() {
871881
// instruções
872-
// a return
882+
// um retorno
873883
},
874884
beta: function() {
875885
// instruções
876-
// a return
886+
// um retorno
877887
},
878888
_default: function() {
879889
// instruções
880-
// a return
890+
// um retorno
881891
}
882892
};
883893
})();
884894

885895

886896
// 7.A.1.3
887-
// If `foo` is a property of `switchObj` or `switchModule`, execute as a method...
897+
// Se `foo` é uma propriedade de `switchObj` ou `switchModule`, execute-a como um método...
888898

889899
( Object.hasOwnProperty.call( switchObj, foo ) && switchObj[ foo ] || switchObj._default )( args );
890900

891901
( Object.hasOwnProperty.call( switchObj, foo ) && switchModule[ foo ] || switchModule._default )( args );
892902

893-
// If you know and trust the value of `foo`, you could even omit the OR check
894-
// leaving only the execution:
903+
// Se você conhece e confia no valor de `foo`, você pode inclusive omitir a checagem `OR`
904+
// deixando apenas a execução:
895905

896906
switchObj[ foo ]( args );
897907

898908
switchModule[ foo ]( args );
899909

900910

901-
// This pattern also promotes code reusability.
911+
// Esse padrão também promove a reutilização de código
902912

903913
```
904914

905-
B. Early returns promote code readability with negligible performance difference
915+
B. Retornos antecipados promovem legibilidade de código com mínima diferença de performance
906916

907917
```javascript
908918

0 commit comments

Comments
 (0)