From 94c9dea6962e973c8cdcb6da56ce4ab710ef7702 Mon Sep 17 00:00:00 2001 From: "Marcel Ribeiro Dantas, Ph.D" Date: Thu, 7 Jul 2022 14:52:40 +0200 Subject: [PATCH 1/2] Update groovy-pt.html.markdown Update Portuguese version to the original version in English --- pt-br/groovy-pt.html.markdown | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown index 3acfce21..3bd1ddfc 100644 --- a/pt-br/groovy-pt.html.markdown +++ b/pt-br/groovy-pt.html.markdown @@ -201,8 +201,16 @@ if(x==1) { //Groovy também suporta o operador ternário def y = 10 -def x = (y > 1) ? "functionou" : "falhou" -assert x == "functionou" +def x = (y > 1) ? "funcionou" : "falhou" +assert x == "funcionou" + +//E suporta o 'The Elvis Operator' também! +//Em vez de usar o operador ternário: + +displayName = nome.name ? nome.name : 'Anonimo' + +//Podemos escrever: +displayName = nome.name ?: 'Anonimo' //Loop 'for' //Itera sobre um intervalo (range) From 28ea2a46224aec4b2ed5366b5d4139dbdb101487 Mon Sep 17 00:00:00 2001 From: Marcel Ribeiro-Dantas Date: Thu, 7 Jul 2022 14:56:49 +0200 Subject: [PATCH 2/2] Add Marcel as translator --- pt-br/groovy-pt.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pt-br/groovy-pt.html.markdown b/pt-br/groovy-pt.html.markdown index 3bd1ddfc..dff3f2e1 100644 --- a/pt-br/groovy-pt.html.markdown +++ b/pt-br/groovy-pt.html.markdown @@ -5,7 +5,8 @@ filename: learngroovy-pt.groovy contributors: - ["Roberto Pérez Alcolea", "http://github.com/rpalcolea"] translators: - - ["João Farias", "https://github.com/JoaoGFarias"] + - ["João Farias", "https://github.com/joaogfarias"] + - ["Marcel Ribeiro-Dantas", "https://github.com/mribeirodantas"] lang: pt-br ---