From 2fe6da03603f3447007f8cb10f72b0d5cecbf318 Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Wed, 5 Aug 2026 20:44:40 +0500 Subject: [PATCH] =?UTF-8?q?es/en:=20=D1=83=D0=B1=D1=80=D0=B0=D1=82=D1=8C?= =?UTF-8?q?=20=D1=80=D1=83=D1=81=D1=81=D0=BA=D0=BE=D1=8F=D0=B7=D1=8B=D1=87?= =?UTF-8?q?=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=20=D0=B8=D0=B7=20=D0=BD=D0=B5=D1=80=D1=83=D1=81=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D1=85=20=D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Два урока содержали материал, осмысленный только для русского читателя. 33-data-types/40-primitive-data-types — раздел «Строки и строчки» объясняет путаницу русских терминов «строка» (тип данных) и «строчка» (line в файле). В переводе он превратился в инструкцию читателю пользоваться русскими словами: «In Russian there can be confusion, so throughout the lessons we'll say "строка"…». Раздел убран из en и es, в ru остаётся. 31-advanced-strings/120-startwith — примеры mb_strpos() построены на 'Валар Моргулис' / 'Дракарис', и проза ссылается на «индекс буквы М». Многобайтность здесь предмет урока, поэтому строки заменены на многобайтные строки своей локали с теми же результатами 6 / 0 / false: es — 'Feliz cumpleaños' (буква c), en — 'Naïve Bayes' (буква B). Осталась намеренная кириллица в 30-encoding (пример несовпадения кодировок) и 100-unicode (strlen('Привет') = 13 против mb_strlen = 7 — это и есть предмет урока). --- modules/31-advanced-strings/120-startwith/en/README.md | 8 ++++---- modules/31-advanced-strings/120-startwith/es/README.md | 8 ++++---- .../33-data-types/40-primitive-data-types/en/README.md | 4 ---- .../33-data-types/40-primitive-data-types/es/README.md | 4 ---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/modules/31-advanced-strings/120-startwith/en/README.md b/modules/31-advanced-strings/120-startwith/en/README.md index e3499c0f..f32ceefb 100644 --- a/modules/31-advanced-strings/120-startwith/en/README.md +++ b/modules/31-advanced-strings/120-startwith/en/README.md @@ -3,15 +3,15 @@ When working with strings, you often need to determine whether one string — a ```php 6 +print_r(mb_strpos('Naïve Bayes', 'Bayes')); // => 6 ``` -The function returned `6` — the index of the letter `М`, where the substring begins. Indexes, as usual, are counted from zero: +The function returned `6` — the index of the letter `B`, where the substring begins. Indexes, as usual, are counted from zero: ```php 0 +print_r(mb_strpos('Naïve Bayes', 'Naïve')); // => 0 ``` Here it returned `0`: the substring was found at the very beginning of the string. @@ -21,7 +21,7 @@ If the substring isn't found, `mb_strpos()` returns the special value `false` (" ```php +print_r(mb_strpos('Naïve Bayes', 'Fisher')); // => ``` There's a hidden trap here that beginners often fall into: the result `0` ("found at the beginning of the string") is easy to confuse with `false` ("not found at all"). To tell them apart, you need a strict comparison — we'll cover it in the lessons about logic. For now, just remember: `mb_strpos()` answers the question "where?", not "is there?". diff --git a/modules/31-advanced-strings/120-startwith/es/README.md b/modules/31-advanced-strings/120-startwith/es/README.md index 0372c3dc..6425ecab 100644 --- a/modules/31-advanced-strings/120-startwith/es/README.md +++ b/modules/31-advanced-strings/120-startwith/es/README.md @@ -3,15 +3,15 @@ A menudo, al trabajar con cadenas de texto, es necesario determinar si una caden ```php 6 +print_r(mb_strpos('Feliz cumpleaños', 'cumpleaños')); // => 6 ``` -La función devolvió `6`: el índice de la letra `М`, donde comienza la subcadena. Los índices, como de costumbre, se cuentan desde cero: +La función devolvió `6`: el índice de la letra `c`, donde comienza la subcadena. Los índices, como de costumbre, se cuentan desde cero: ```php 0 +print_r(mb_strpos('Feliz cumpleaños', 'Feliz')); // => 0 ``` Aquí se devolvió `0`: la subcadena se encontró justo al inicio de la cadena. @@ -21,7 +21,7 @@ Si la subcadena no se encuentra, `mb_strpos()` devuelve el valor especial `false ```php +print_r(mb_strpos('Feliz cumpleaños', 'Navidad')); // => ``` Aquí se esconde una trampa en la que suelen caer los principiantes: el resultado `0` («encontrado al inicio de la cadena») es fácil de confundir con `false` («no encontrado en absoluto»). Para distinguirlos, se necesita una comparación estricta, que veremos en las lecciones sobre lógica. Por ahora, recuerda: `mb_strpos()` responde a la pregunta «¿dónde?», no «¿existe?». diff --git a/modules/33-data-types/40-primitive-data-types/en/README.md b/modules/33-data-types/40-primitive-data-types/en/README.md index 11d42e05..fd4e39d7 100644 --- a/modules/33-data-types/40-primitive-data-types/en/README.md +++ b/modules/33-data-types/40-primitive-data-types/en/README.md @@ -99,7 +99,3 @@ PHP primitive types Besides strings and numbers, PHP has the boolean type `bool` with the values `true` and `false`, as well as the special value `null`. We'll encounter them in more detail in the future. There are also composite types: arrays, objects, and others. We'll get to know them later. Moreover, in PHP you can create your own types (for example, classes), but first it's important to get a good grasp of the primitives. - -## Strings and lines - -In English, strings in programming are called **strings**, while lines of text files are called **lines**. In Russian there can be confusion, so throughout the lessons we'll say "строка" for the "string" data type and "строчка" for lines in files. diff --git a/modules/33-data-types/40-primitive-data-types/es/README.md b/modules/33-data-types/40-primitive-data-types/es/README.md index 09896fea..2fd50544 100644 --- a/modules/33-data-types/40-primitive-data-types/es/README.md +++ b/modules/33-data-types/40-primitive-data-types/es/README.md @@ -99,7 +99,3 @@ Tipos primitivos de PHP Además de las cadenas y los números, PHP tiene el tipo booleano `bool` con los valores `true` y `false`, así como el valor especial `null`. Nos encontraremos con ellos con más detalle en el futuro. También existen tipos compuestos: arrays, objetos y otros. Los conoceremos más adelante. Es más, en PHP se pueden crear tus propios tipos (por ejemplo, clases), pero primero es importante entender bien los primitivos. - -## Strings y lines - -En inglés, las cadenas de texto en programación se llaman **strings**, y las líneas de los archivos de texto se llaman **lines**. En ruso puede haber confusión, por eso en todas las lecciones diremos «строка» para referirnos al tipo de dato «cadena de texto», y «строчка» para las lines en los archivos.