Skip to content

Commit

Permalink
fixed untranslated sections/files
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardolara committed Nov 27, 2024
1 parent f730002 commit b8f5cce
Show file tree
Hide file tree
Showing 52 changed files with 252 additions and 253 deletions.
4 changes: 2 additions & 2 deletions appendices/comparisons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<tgroup cols="6">
<thead>
<row>
<entry>Expression</entry>
<entry>Expressão</entry>
<entry><function>gettype</function></entry>
<entry><function>empty</function></entry>
<entry><function>is_null</function></entry>
Expand Down Expand Up @@ -85,7 +85,7 @@
<entry>&false;</entry>
</row>
<row>
<entry><varname>$x</varname> is undefined</entry>
<entry><varname>$x</varname> está indefinido</entry>
<entry><type>NULL</type></entry>
<entry>&true;</entry>
<entry>&true;</entry>
Expand Down
22 changes: 11 additions & 11 deletions appendices/filters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ $fp = fopen('php://output', 'w');
stream_filter_append($fp, 'convert.iconv.utf-16le.utf-8');
fwrite($fp, "T\0h\0i\0s\0 \0i\0s\0 \0a\0 \0t\0e\0s\0t\0.\0\n\0");
fclose($fp);
/* Outputs: This is a test. */
/* Exibe: This is a test. */
?>
]]>
</programlisting>
Expand Down Expand Up @@ -528,7 +528,7 @@ O arquivo comprimido tem 1488 bytes.
</para>

<example>
<title>Criptografar/Descriptografar com Blowfish</title>
<title>Criptografando/Descriptografando com Blowfish</title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -542,20 +542,20 @@ stream_filter_append($fp, 'mcrypt.blowfish', STREAM_FILTER_WRITE, $opts);
fwrite($fp, 'mensagem para criptografar');
fclose($fp);
// descriptografar...
// descriptografando...
$fp = fopen('encrypted-file.enc', 'rb');
$iv = fread($fp, $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC));
$opts = array('mode'=>'cbc','iv'=>$iv, 'key'=>$key);
stream_filter_append($fp, 'mdecrypt.blowfish', STREAM_FILTER_READ, $opts);
$data = rtrim(stream_get_contents($fp)); // retira o null padding
$data = rtrim(stream_get_contents($fp)); // retira o preenchimento com null
fclose($fp);
echo $data;
?>
]]>
</programlisting>
</example>
<example>
<title>Criptografar arquivo usando CBC AES-128 com HMAC SHA256</title>
<title>Criptografando arquivo usando CBC AES-128 com HMAC SHA256</title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -571,7 +571,7 @@ class AES_CBC
$fin = fopen($input_stream, "rb");
$fc = fopen($aes_filename, "wb+");
if (!empty($fin) && !empty($fc)) {
fwrite($fc, str_repeat("_", 32) ); // placeholder, HMAC SHA256 será usado aqui mais tarde
fwrite($fc, str_repeat("_", 32) ); // marcador, HMAC SHA256 será usado aqui mais tarde
fwrite($fc, $hmac_salt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
fwrite($fc, $esalt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
fwrite($fc, $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
Expand All @@ -585,13 +585,13 @@ class AES_CBC
fwrite($fc, $block);
}
$block_size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
$padding = $block_size - ($infilesize % $block_size);//$padding is a number from 1-16
fwrite($fc, str_repeat(chr($padding), $padding) );//perform PKCS7 padding
$padding = $block_size - ($infilesize % $block_size); // $padding é um número de 1 a 16
fwrite($fc, str_repeat(chr($padding), $padding) ); // realiza um preenchimento PKCS7
fclose($fin);
fclose($fc);
$hmac_raw = self::calculate_hmac_after_32bytes($password, $hmac_salt, $aes_filename);
$fc = fopen($aes_filename, "rb+");
fwrite($fc, $hmac_raw);//overwrite placeholder
fwrite($fc, $hmac_raw); // sobrescreve o marcador
fclose($fc);
}
}
Expand All @@ -603,7 +603,7 @@ class AES_CBC
$fc = fopen($aes_filename, "rb");
$fout = fopen($out_stream, 'wb');
if (!empty($fout) && !empty($fc) && self::hash_equals($hmac_raw,$hmac_calc)) {
fread($fc, 32+$iv_size);//skip sha256 hmac and salt
fread($fc, 32+$iv_size); // ignora hmac e salt do sha256
$esalt = fread($fc, $iv_size);
$iv = fread($fc, $iv_size);
$ekey = hash_pbkdf2("sha256", $password, $esalt, $it=1000, self::key_size(), $raw=true);
Expand All @@ -612,7 +612,7 @@ class AES_CBC
while (!feof($fc)) {
$block = fread($fc, 8192);
if (feof($fc)) {
$padding = ord($block[strlen($block) - 1]);//assume PKCS7 padding
$padding = ord($block[strlen($block) - 1]); // assume preenchimento PKCS7
$block = substr($block, 0, 0-$padding);
}
fwrite($fout, $block);
Expand Down
8 changes: 4 additions & 4 deletions appendices/migration74/new-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ChildProducer extends Producer {
<![CDATA[
<?php
$array['key'] ??= computeDefault();
// is roughly equivalent to
// é praticamente equivalente a
if (!isset($array['key'])) {
$array['key'] = computeDefault();
}
Expand Down Expand Up @@ -130,7 +130,7 @@ $fruits = ['banana', 'orange', ...$parts, 'watermelon'];
6.674_083e-11; // float
299_792_458; // decimal
0xCAFE_F00D; // hexadecimal
0b0101_1111; // binary
0b0101_1111; // binário
?>
]]>
</programlisting>
Expand Down Expand Up @@ -361,9 +361,9 @@ proc_open(['php', '-r', 'echo "Hello World\n";'], $descriptors, $pipes);
<programlisting role="php">
<![CDATA[
<?php
// Like 2>&1 on the shell
// Similar a 2>&1 no shell
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['redirect', 1]], $pipes);
// Like 2>/dev/null or 2>nul on the shell
// Similar a 2>/dev/null ou 2>nul no shell
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes);
?>
]]>
Expand Down
6 changes: 3 additions & 3 deletions language/control-structures/alternative-syntax.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ A é igual a 5
<![CDATA[
<?php
if ($a == 5):
echo "a equals 5";
echo "a é igual a 5";
echo "...";
elseif ($a == 6):
echo "a equals 6";
echo "a é igual a 6";
echo "!!!";
else:
echo "a is neither 5 nor 6";
echo "a não é 5 nem 6";
endif;
?>
]]>
Expand Down
12 changes: 6 additions & 6 deletions language/control-structures/do-while.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ do {
<literal>do-while</literal>, que permite parar a execução no meio
do bloco de códigos, encapsulando-os em um
<literal>do-while</literal> (0), e usando o <link
linkend="control-structures.break"><literal>break</literal></link>
. O código a seguir demonstra isso:
linkend="control-structures.break"><literal>break</literal></link>.
O código a seguir demonstra isso:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
do {
if ($i < 5) {
echo "i is not big enough";
echo "i não é grande o suficiente";
break;
}
$i *= $factor;
if ($i < $minimum_limit) {
break;
}
echo "i is ok";
echo "i está ok";
/* process i */
/* processa i */
} while (0);
?>
Expand All @@ -72,7 +72,7 @@ do {
<simpara>
É possível usar o
<link linkend="control-structures.goto"><literal>goto</literal></link>
ao invés desse hack.
ao invés desse truque.
</simpara>
</sect1>

Expand Down
10 changes: 5 additions & 5 deletions language/control-structures/else.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
estende a instrução <literal>if</literal> para executar outras
caso a expressão no <literal>if</literal> retornar
&false;. Por exemplo, o código a
seguir exibirá <computeroutput>a is greater than
seguir exibirá <computeroutput>a é maior que
b</computeroutput> se <varname>$a</varname> for maior que
<varname>$b</varname>, e <computeroutput>a is NOT greater
than b</computeroutput> caso contrário:
<varname>$b</varname>, e <computeroutput>a NÃO é maior
que b</computeroutput> caso contrário:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
if ($a > $b) {
echo "a is greater than b";
echo "a é maior que b";
} else {
echo "a is NOT greater than b";
echo "a NÃO é maior que b";
}
?>
]]>
Expand Down
14 changes: 7 additions & 7 deletions language/control-structures/foreach.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $arr = array(1, 2, 3, 4);
foreach ($arr as &$valor) {
$valor = $valor * 2;
}
// $arr is now array(2, 4, 6, 8)
// $arr agora é array(2, 4, 6, 8)
unset($valor); // quebra a referência com o último elemento
?>
]]>
Expand Down Expand Up @@ -129,7 +129,7 @@ foreach (array(1, 2, 3, 4) as &$valor) {
$a = array(1, 2, 3, 17);
foreach ($a as $v) {
echo "Current value of \$a: $v.\n";
echo "Valor atual de \$a: $v.\n";
}
/* Exemplo foreach 2: valor com acesso manual (apenas ilustrativo) */
Expand All @@ -146,17 +146,17 @@ foreach ($a as $v) {
/* Exemplo foreach 3: chave e valor */
$a = array(
"one" => 1,
"two" => 2,
"three" => 3,
"seventeen" => 17
"um" => 1,
"dois" => 2,
"três" => 3,
"dezessete" => 17
);
foreach ($a as $k => $v) {
echo "\$a[$k] => $v.\n";
}
/* Exemplo foreach 4: arrays multi dimencionais */
/* Exemplo foreach 4: arrays multi dimensionais */
$a = array();
$a[0][0] = "a";
$a[0][1] = "b";
Expand Down
10 changes: 5 additions & 5 deletions language/control-structures/if.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ if (expr)
</link>.
</simpara>
<para>
O exemplo a seguir exibirá <computeroutput>a is bigger
than b</computeroutput> se <varname>$a</varname> for maior
O exemplo a seguir exibirá <computeroutput>a é maior
que b</computeroutput> se <varname>$a</varname> for maior
que <varname>$b</varname>:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
if ($a > $b)
echo "a is bigger than b";
echo "a é maior que b";
?>
]]>
</programlisting>
Expand All @@ -48,7 +48,7 @@ if ($a > $b)
executada. É claro que não é necessário envolver cada declaração
em uma cláusula <literal>if</literal>. Em vez disso, pode-se agrupar
várias declarações em grupos. Por exemplo, este código
exibirá <computeroutput>a is bigger than b</computeroutput>
exibirá <computeroutput>a é maior que b</computeroutput>
se <varname>$a</varname> for maior que
<varname>$b</varname>, e atribuirá o valor de
<varname>$a</varname> em <varname>$b</varname>:
Expand All @@ -57,7 +57,7 @@ if ($a > $b)
<![CDATA[
<?php
if ($a > $b) {
echo "a is bigger than b";
echo "a é maior que b";
$b = $a;
}
?>
Expand Down
8 changes: 4 additions & 4 deletions language/control-structures/include.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ function foo()
echo "A $color $fruit";
}
/* vars.php is in the scope of foo() so *
* $fruit is NOT available outside of this *
* scope. $color is because we declared it *
* as global. */
/* vars.php está no escopo de foo() por isso *
* $fruit NÃO está disponível fora deste *
* escopo. $color está, porque foi declarada *
* como global. */
foo(); // A green apple
echo "A $color $fruit"; // A green
Expand Down
4 changes: 2 additions & 2 deletions language/enumerations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pegar_uma_carta('Espadas');

<para>
Por padrão, os casos não são internamente associados por um valor escalar. Ou seja, <literal>Naipe::Copas</literal>
is not equal to <literal>"0"</literal>. Instead, each case is backed by a singleton object of that name. That means that:
não é igual a <literal>"0"</literal>. Ao invés disso, cada caso é apoiado por um objeto único com esse nome. Isso significa que:
</para>

<programlisting role="php">
Expand Down Expand Up @@ -613,7 +613,7 @@ class Foo
// Isto é perfeitamente legal, porque não é uma expressão constante.
$x = Direcao::Cima['curta'];
var_dump("\$x is " . var_export($x, true));
var_dump("\$x é " . var_export($x, true));
$foo = new Foo();
?>
Expand Down
6 changes: 3 additions & 3 deletions language/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ string(11) "hello world"
// Um exemplo básico de carrinho de compras que contém uma lista de produtos
// e a quantidade de cada produto. Inclui um método que
// calcula o preço total dos itens no carrinho utilizando uma
// closure como callback.
// closure como função de retorno.
class Cart
{
const PRICE_BUTTER = 1.00;
Expand Down Expand Up @@ -1279,9 +1279,9 @@ $my_cart->add('butter', 1);
$my_cart->add('milk', 3);
$my_cart->add('eggs', 6);
// Print the total with a 5% sales tax.
// Exibe o total com uma taxa de venda de 5%.
print $my_cart->getTotal(0.05) . "\n";
// The result is 54.29
// O resultado é 54.29
?>
]]>
</programlisting>
Expand Down
8 changes: 4 additions & 4 deletions language/oop5/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ namespace foo {
<programlisting role="php">
<![CDATA[
<?php
const ONE = 1;
const UM = 1;
class foo {
const TWO = ONE * 2;
const THREE = ONE + self::TWO;
const SENTENCE = 'The value of THREE is '.self::THREE;
const DOIS = UM * 2;
const TRES = UM + self::DOIS;
const FRASE = 'O valor de TRES é '.self::TRES;
}
?>
]]>
Expand Down
12 changes: 6 additions & 6 deletions language/oop5/inheritance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Foo
public function printPHP()
{
echo 'PHP is great.' . PHP_EOL;
echo 'PHP é ótimo' . PHP_EOL;
}
}
Expand All @@ -96,10 +96,10 @@ class Bar extends Foo
$foo = new Foo();
$bar = new Bar();
$foo->printItem('baz'); // Output: 'Foo: baz'
$foo->printPHP(); // Output: 'PHP is great'
$bar->printItem('baz'); // Output: 'Bar: baz'
$bar->printPHP(); // Output: 'PHP is great'
$foo->printItem('baz'); // Saída: 'Foo: baz'
$foo->printPHP(); // Saída: 'PHP é ótimo'
$bar->printItem('baz'); // Saída: 'Bar: baz'
$bar->printPHP(); // Saída: 'PHP é ótimo'
?>
]]>
Expand Down Expand Up @@ -173,7 +173,7 @@ class MeuDateTime extends DateTime
public function modify(string $modifier) { return false; }
}
// Nenhuma notícia é acionada
// Nenhum aviso é emitido
?>
]]>
</programlisting>
Expand Down
Loading

0 comments on commit b8f5cce

Please sign in to comment.