Skip to content

Commit 61790e8

Browse files
mildabredg
authored andcommitted
better wording [Closes #1038][Closes #1040][Closes #1026][Closes #1025][Closes #1019][Closes #1016][Closes #1015]
1 parent d6e5ea7 commit 61790e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+142
-142
lines changed

application/cs/components.texy

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Odkaz, který zavolá signál, vytvoříme obvyklým způsobem, tedy v šabloně
198198
<a n:href="click! $x, $y">click here</a>
199199
```
200200

201-
Signál se vždy volá na aktuálním presenteru a view, tudíž není možné jej vyvolat na jiném presenteru nebo view.
201+
Signál se vždy volá na aktuálním presenteru a action, není možné jej vyvolat na jiném presenteru nebo jiné action.
202202

203203
Signál tedy způsobí znovunačtení stránky úplně stejně jako při původním požadavku, jen navíc zavolá obslužnou metodu signálu s příslušnými parametry. Pokud metoda neexistuje, vyhodí se výjimka [api:Nette\Application\UI\BadSignalException], která se uživateli zobrazí jako chybová stránka 403 Forbidden.
204204

@@ -430,7 +430,7 @@ class PaginatingControl extends Control
430430
}
431431
```
432432

433-
Opačný proces, tedy sesbírání hodnot z persistentních properites, má na starosti metoda `saveState()`.
433+
Opačný proces, tedy sesbírání hodnot z persistentních properties, má na starosti metoda `saveState()`.
434434

435435

436436
Signály do hloubky
@@ -444,7 +444,7 @@ Signál může přijímat jakákoliv komponenta, presenter nebo objekt, který i
444444

445445
Mezi hlavní příjemce signálů budou patřit `Presentery` a vizuální komponenty dědící od `Control`. Signál má sloužit jako znamení pro objekt, že má něco udělat – anketa si má započítat hlas od uživatele, blok s novinkami se má rozbalit a zobrazit dvakrát tolik novinek, formulář byl odeslán a má zpracovat data a podobně.
446446

447-
URL pro signál vytváříme pomocí metody [Component::link() |api:Nette\Application\UI\Component::link()]. Jako parametr `$destination` předáme řetězec `{signal}!` a jako `$args` pole argumentů, které chceme signálu předat. Signál se vždy volá na aktuální view s aktuálními parametry, parametry signálu se jen přidají. Navíc se přidává hned na začátku **parametr `?do`, který určuje signál**.
447+
URL pro signál vytváříme pomocí metody [Component::link() |api:Nette\Application\UI\Component::link()]. Jako parametr `$destination` předáme řetězec `{signal}!` a jako `$args` pole argumentů, které chceme signálu předat. Signál se vždy volá na aktuálním presenteru a action s aktuálními parametry, parametry signálu se jen přidají. Navíc se přidává hned na začátku **parametr `?do`, který určuje signál**.
448448

449449
Jeho formát je buď `{signal}`, nebo `{signalReceiver}-{signal}`. `{signalReceiver}` je název komponenty v presenteru. Proto nemůže být v názvu komponenty pomlčka – používá se k oddělení názvu komponenty a signálu, je ovšem možné takto zanořit několik komponent.
450450

application/el/components.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class PaginatingControl extends Control
430430
}
431431
```
432432

433-
Η αντίθετη διαδικασία, δηλαδή η συλλογή τιμών από persistent properites, αντιμετωπίζεται από τη μέθοδο `saveState()`.
433+
Η αντίθετη διαδικασία, δηλαδή η συλλογή τιμών από persistent properties, αντιμετωπίζεται από τη μέθοδο `saveState()`.
434434

435435

436436
Σήματα σε βάθος .[#toc-signals-in-depth]

application/en/components.texy

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ The link that calls the signal is created in the usual way, i.e. in the template
198198
<a n:href="click! $x, $y">click here</a>
199199
```
200200

201-
The signal is always called on the current presenter and view, so it is not possible to link to signal in different presenter / action.
201+
The signal is always called on the current presenter and action, it cannot be called on another presenter or action.
202202

203203
Thus, the signal causes the page to be reloaded in exactly the same way as in the original request, only in addition it calls the signal handling method with the appropriate parameters. If the method does not exist, exception [api:Nette\Application\UI\BadSignalException] is thrown, which is displayed to the user as error page 403 Forbidden.
204204

@@ -430,7 +430,7 @@ class PaginatingControl extends Control
430430
}
431431
```
432432

433-
The opposite process, that is, collecting values from persistent properites, is handled by the `saveState()` method.
433+
The opposite process, that is, collecting values from persistent properties, is handled by the `saveState()` method.
434434

435435

436436
Signals in Depth
@@ -444,7 +444,7 @@ Signal can be received by any component, presenter of object which implements in
444444

445445
The main receivers of signals are `Presenters` and visual components extending `Control`. A signal is a sign for an object that it has to do something - poll counts in a vote from user, box with news has to unfold, form was sent and has to process data and so on.
446446

447-
The URL for the signal is created using the method [Component::link() |api:Nette\Application\UI\Component::link()]. As parameter `$destination` we pass string `{signal}!` and as `$args` an array of arguments which we want to pass to the signal handler. Signal parameters are attached to the URL of the current presenter/view. **The parameter `?do` in the URL determines the signal called.**
447+
The URL for the signal is created using the [Component::link() |api:Nette\Application\UI\Component::link()] method. We pass the string `{signal}!` as the `$destination` parameter and the array of arguments we want to pass to the signal as `$args`. The signal is always called on the current presenter and action with the current parameters, the signal parameters are just added. In addition, the **parameter `?do`, which specifies the signal** is added right at the beginning.
448448

449449
Its format is `{signal}` or `{signalReceiver}-{signal}`. `{signalReceiver}` is the name of the component in the presenter. This is why hyphen (inaccurately dash) can't be present in the name of components - it is used to divide the name of the component and signal, but it's possible to compose several components.
450450

application/pl/components.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class PaginatingControl extends Control
430430
}
431431
```
432432

433-
Procesem przeciwnym, czyli pobieraniem wartości z persistent properites, zajmuje się metoda `saveState()`.
433+
Procesem przeciwnym, czyli pobieraniem wartości z persistent properties, zajmuje się metoda `saveState()`.
434434

435435

436436
Sygnały w głąb .[#toc-signaly-do-hloubky]

application/pt/components.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ class PaginatingControl extends Control
430430
}
431431
```
432432

433-
O processo oposto, ou seja, a coleta de valores de properites persistentes, é tratado pelo método `saveState()`.
433+
O processo oposto, ou seja, a coleta de valores de properties persistentes, é tratado pelo método `saveState()`.
434434

435435

436436
Sinais em profundidade .[#toc-signals-in-depth]

best-practices/cs/composer.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ composer update
5858

5959
Composer stáhne Nette Database do složky `vendor/`. Dále vytvoří soubor `composer.lock`, který obsahuje informace o tom, které verze knihoven přesně nainstaloval.
6060

61-
Composer vygeneruje soubor `vendor/autoload.php`, který můžeme jednoduše zainkludovat a začít používat knihovny bez jakékoli další práce:
61+
Composer vygeneruje soubor `vendor/autoload.php`, který můžeme jednoduše inkludovat a začít používat knihovny bez jakékoli další práce:
6262

6363
```php
6464
require __DIR__ . '/vendor/autoload.php';

best-practices/cs/inject-method-attribute.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MyPresenter extends Nette\Application\UI\Presenter
6161

6262
Výhodou tohoto způsobu předávání závislostí byla velice úsporná podoba zápisu. Nicméně s příchodem [constructor property promotion |https://blog.nette.org/cs/php-8-0-kompletni-prehled-novinek#toc-constructor-property-promotion] se jeví snazší použít konstruktor.
6363

64-
Naopak tento způsob trpí stejnými nedostatky, jako předávání závislosti do properites obecně: nemáme kontrolu nad změnami v proměnné a zároveň se proměnná stává součástí veřejného rozhraní třídy, což je nežádnoucí.
64+
Naopak tento způsob trpí stejnými nedostatky, jako předávání závislosti do properties obecně: nemáme kontrolu nad změnami v proměnné a zároveň se proměnná stává součástí veřejného rozhraní třídy, což je nežádnoucí.
6565

6666

6767
{{sitename: Best Practices}}

database/cs/upgrading.texy

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Přechod z verze 3.1 na 3.2
77

88
Minimální požadovaná verze PHP je 8.1.
99

10-
Kód byl pečlivě vyladěn pro PHP 8.1. Byly doplněny všechny nové typehinty u metod a properites. Změny jsou jen drobné:
10+
Kód byl pečlivě vyladěn pro PHP 8.1. Byly doplněny všechny nové typehinty u metod a properties. Změny jsou jen drobné:
1111

1212
- MySQL: nulové datum `0000-00-00` vrací jako `null`
1313
- MySQL: decimal bez desetinných míst vrací jako int místo float

forms/bg/validation.texy

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
В Nette е много лесно да се реагира на изпълнението или неизпълнението на дадено условие от страна на JavaScript, като се използва методът `toggle()`, вж. раздел [Динамичен JavaScript |#Динамический JavaScript].
156156

157157

158-
Връзки между контролите .[#toc-references-between-controls]
159-
===========================================================
158+
Препратка към друг елемент .[#toc-reference-to-another-element]
159+
===============================================================
160160

161-
Аргумент на правило или условие може да бъде препратка към друг елемент. Например можете динамично да потвърдите, че `text` има толкова знаци, колкото са посочени в полето `length`:
161+
Като аргумент за правило или условие можете да предадете и друг елемент от формуляра. Тогава правилото ще използва стойността, въведена по-късно от потребителя в браузъра. Това може да се използва например за динамично потвърждаване, че елементът `password` съдържа същия низ като елемента `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

forms/cs/validation.texy

+7-7
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
V Nette lze velmi snadno reagovat na splnění či nesplnění podmínky i na straně JavaScriptu pomocí metody `toggle()`, viz [#dynamický JavaScript].
156156

157157

158-
Reference mezi prvky
159-
====================
158+
Reference na jiný prvek
159+
=======================
160160

161-
Jako argument pravidla či podmínky lze uvádět referenci na jiný prvek. Takto lze např. dynamicky validovat, že prvek `text` má tolik znaků, jako je hodnota prvku `length`:
161+
Jako argument pravidla či podmínky lze předat i jiný prvek formuláře. Pravidlo potom použije hodnotu vloženou později uživatelem v prohlížeči. Takto lze např. dynamicky validovat, že prvek `password` obsahuje stejný řetězec jako prvek `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Heslo');
165+
$form->addPassword('password_confirm', 'Potvrďte heslo')
166+
->addRule($form::Equal, 'Zadaná hesla se neshodují', $form['password']);
167167
```
168168

169169

@@ -172,7 +172,7 @@ Vlastní pravidla a podmínky
172172

173173
Občas se dostaneme do situace, kdy nám vestavěná validační pravidla v Nette nestačí a potřebujeme data od uživatele validovat po svém. V Nette je to velmi jednoduché!
174174

175-
Metodám `addRule()` či `addCondition()` lze první parametr předat libovolný callback. Ten přijímá jako první parametr samotný prvek a vrací boolean hodnotu určující, zda validace proběhla v pořádku. Při přidávání pravidla pomocí `addRule()` je možné zadat i další argumenty, ty jsou pak předány jako druhý parametr.
175+
Metodám `addRule()` či `addCondition()` lze jako první parametr předat libovolný callback. Ten přijímá jako první parametr samotný prvek a vrací boolean hodnotu určující, zda validace proběhla v pořádku. Při přidávání pravidla pomocí `addRule()` je možné zadat i další argumenty, ty jsou pak předány jako druhý parametr.
176176

177177
Vlastní sadu validátorů tak můžeme vytvořit jako třídu se statickými metodami:
178178

forms/de/validation.texy

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
In Nette ist es sehr einfach, auf die Erfüllung oder Nichterfüllung einer Bedingung auf der JavaScript-Seite mit der Methode `toggle()` zu reagieren, siehe [Dynamisches JavaScript |#Dynamic JavaScript].
156156

157157

158-
Referenzen zwischen Controls .[#toc-references-between-controls]
159-
================================================================
158+
Verweis auf ein anderes Element .[#toc-reference-to-another-element]
159+
====================================================================
160160

161-
Das Regel- oder Bedingungsargument kann ein Verweis auf ein anderes Element sein. Sie können zum Beispiel dynamisch überprüfen, ob `text` so viele Zeichen hat wie der Wert des Feldes `length` beträgt:
161+
Als Argument für eine Regel oder Bedingung können Sie auch ein anderes Formularelement übergeben. Die Regel wird dann den Wert verwenden, den der Benutzer später im Browser eingibt. Auf diese Weise kann z. B. dynamisch überprüft werden, ob das Element `password` dieselbe Zeichenfolge enthält wie das Element `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

forms/el/validation.texy

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
Στη Nette, είναι πολύ εύκολο να αντιδράσετε στην εκπλήρωση ή όχι μιας συνθήκης από την πλευρά της JavaScript χρησιμοποιώντας τη μέθοδο `toggle()`, βλέπε [Δυναμική JavaScript |#Dynamic JavaScript].
156156

157157

158-
Αναφορές μεταξύ στοιχείων ελέγχου .[#toc-references-between-controls]
159-
=====================================================================
158+
Αναφορά σε άλλο στοιχείο .[#toc-reference-to-another-element]
159+
=============================================================
160160

161-
Το όρισμα του κανόνα ή της συνθήκης μπορεί να είναι μια αναφορά σε ένα άλλο στοιχείο. Για παράδειγμα, μπορείτε να επικυρώσετε δυναμικά ότι το `text` έχει τόσους χαρακτήρες όσοι είναι οι τιμές του πεδίου `length`:
161+
Ως όρισμα για έναν κανόνα ή συνθήκη, μπορείτε επίσης να περάσετε ένα άλλο στοιχείο της φόρμας. Ο κανόνας θα χρησιμοποιήσει τότε την τιμή που θα εισαχθεί αργότερα από τον χρήστη στο πρόγραμμα περιήγησης. Αυτό μπορεί να χρησιμοποιηθεί, για παράδειγμα, για τη δυναμική επικύρωση ότι το στοιχείο `password` περιέχει την ίδια συμβολοσειρά με το στοιχείο `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

forms/en/validation.texy

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
In Nette, it is very easy to react to the fulfillment or not of a condition on the JavaScript side using the `toggle()` method, see [#Dynamic JavaScript].
156156

157157

158-
References Between Controls
159-
===========================
158+
Reference to Another Element
159+
============================
160160

161-
The rule or condition argument can be a reference to another element. For example, you can dynamically validate that the `text` has as many characters as the value of the `length` field is:
161+
As an argument for a rule or condition, you can also pass another form element. The rule will then use the value entered later by the user in the browser. This can be used, for example, to dynamically validate that the `password` element contains the same string as the `password_confirm` element:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

forms/es/validation.texy

+5-5
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
En Nette, es muy fácil reaccionar al cumplimiento o no de una condición en la parte JavaScript utilizando el método `toggle()`, véase [JavaScript dinámico |#Dynamic JavaScript].
156156

157157

158-
Referencias entre Controles .[#toc-references-between-controls]
158+
Referencia a otro elemento .[#toc-reference-to-another-element]
159159
===============================================================
160160

161-
El argumento de la regla o condición puede ser una referencia a otro elemento. Por ejemplo, puede validar dinámicamente que `text` tenga tantos caracteres como el valor del campo `length`:
161+
Como argumento para una regla o condición, también puede pasar otro elemento del formulario. La regla utilizará entonces el valor introducido posteriormente por el usuario en el navegador. Esto se puede utilizar, por ejemplo, para validar dinámicamente que el elemento `password` contiene la misma cadena que el elemento `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

forms/fr/validation.texy

+6-6
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ $form->addText(/* ... */)
155155
Dans Nette, il est très facile de réagir à la réalisation ou non d'une condition du côté JavaScript en utilisant la méthode `toggle()`, voir [Dynamic JavaScript |#Dynamic JavaScript].
156156

157157

158-
Références entre les contrôles .[#toc-references-between-controls]
159-
==================================================================
158+
Référence à un autre élément .[#toc-reference-to-another-element]
159+
=================================================================
160160

161-
L'argument de la règle ou de la condition peut être une référence à un autre élément. Par exemple, vous pouvez valider dynamiquement que le champ `text` comporte autant de caractères que la valeur du champ `length`:
161+
En tant qu'argument d'une règle ou d'une condition, vous pouvez également transmettre un autre élément de formulaire. La règle utilisera alors la valeur introduite ultérieurement par l'utilisateur dans le navigateur. Cela peut être utilisé, par exemple, pour valider dynamiquement que l'élément `password` contient la même chaîne de caractères que l'élément `password_confirm`:
162162

163163
```php
164-
$form->addInteger('length');
165-
$form->addText('text')
166-
->addRule($form::Length, null, $form['length']);
164+
$form->addPassword('password', 'Password');
165+
$form->addPassword('password_confirm', 'Confirm Password')
166+
->addRule($form::Equal, 'The passwords do not match', $form['password']);
167167
```
168168

169169

0 commit comments

Comments
 (0)