Skip to content

Commit

Permalink
typo [Closes #1050]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 4, 2024
1 parent b7f1ba6 commit bdde973
Show file tree
Hide file tree
Showing 48 changed files with 176 additions and 176 deletions.
6 changes: 3 additions & 3 deletions quickstart/bg/comments.texy
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ $form->onSuccess[] = $this->commentFormSucceeded(...);
```php .{file:app/UI/Post/PostPresenter.php}
private function commentFormSucceeded(\stdClass $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

$this->database->table('comments')->insert([
'post_id' => $postId,
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
Expand Down Expand Up @@ -134,7 +134,7 @@ Nette Database Explorer използва чужди ключове, за да о
Както си спомняте, предадохме променливата `$post` на шаблона в `PostPresenter::renderShow()` и сега искаме да изброим всички коментари, които имат колона `post_id`, равна на нашата `$post->id`. Можете да направите това, като се обадите на `$post->related('comments')`. Всичко е толкова просто. Разгледайте получения код.

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $postId): void
public function renderShow(int $id): void
{
...
$this->template->post = $post;
Expand Down
14 changes: 7 additions & 7 deletions quickstart/bg/creating-posts.texy
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ private function postFormSucceeded(array $data): void
Ще добавим нова страница `edit` към `EditPresenter`:

```php .{file:app/UI/Edit/EditPresenter.php}
public function renderEdit(int $postId): void
public function renderEdit(int $id): void
{
$post = $this->database
->table('posts')
->get($postId);
->get($id);

if (!$post) {
$this->error('Пост не найден');
Expand All @@ -149,12 +149,12 @@ public function renderEdit(int $postId): void
```php .{file:app/UI/Edit/EditPresenter.php}
private function postFormSucceeded(array $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

if ($postId) {
if ($id) {
$post = $this->database
->table('posts')
->get($postId);
->get($id);
$post->update($data);

} else {
Expand All @@ -168,9 +168,9 @@ private function postFormSucceeded(array $data): void
}
```

Ако е посочен `postId`, това означава, че публикацията се редактира. В този случай ще проверим дали публикацията действително съществува и ако е така, ще я актуализираме в базата данни. Ако не е посочен `postId`, това означава, че ще бъде добавена нова публикация.
Ако е посочен `id`, това означава, че публикацията се редактира. В този случай ще проверим дали публикацията действително съществува и ако е така, ще я актуализираме в базата данни. Ако не е посочен `id`, това означава, че ще бъде добавена нова публикация.

Но откъде идва `postId`? Това е параметърът, който се предава на метода `renderEdit`.
Но откъде идва `id`? Това е параметърът, който се предава на метода `renderEdit`.

Сега можете да добавите връзка за промяна на публикацията в шаблона `app/UI/Post/show.latte`:

Expand Down
2 changes: 1 addition & 1 deletion quickstart/bg/single-post.texy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ final class PostPresenter extends Nette\Application\UI\Presenter
Проверка на ID на публикацията .[#toc-checking-post-id]
=======================================================

Какво ще стане, ако някой промени URL адреса и вмъкне несъществуващ `postId`? Трябва да предоставим на потребителя хубава страница за грешка "Страницата не е намерена". Нека да актуализираме метода `render` във файла `PostPresenter.php`:
Какво ще стане, ако някой промени URL адреса и вмъкне несъществуващ `id`? Трябва да предоставим на потребителя хубава страница за грешка "Страницата не е намерена". Нека да актуализираме метода `render` във файла `PostPresenter.php`:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $id): void
Expand Down
6 changes: 3 additions & 3 deletions quickstart/cs/comments.texy
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ Předchozí zápis znamená "po úspěšném odeslání formuláře zavolej meto
```php .{file:app/UI/Post/PostPresenter.php}
private function commentFormSucceeded(\stdClass $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

$this->database->table('comments')->insert([
'post_id' => $postId,
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
Expand Down Expand Up @@ -134,7 +134,7 @@ Nette Database Explorer používá cizí klíče pro vyřešení vzájemného vz
Jak si jistě pamatujete, do šablony jsme předali proměnnou `$post` pomocí metody `PostPresenter::renderShow()` a nyní chceme iterovat přes všechny komentáře, které mají hodnotu sloupce `post_id` shodnou s `$post->id`. Toho můžeme docílit voláním `$post->related('comments')`. Ano, takhle jednoduše. Podívejme se na výsledný kód:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $postId): void
public function renderShow(int $id): void
{
...
$this->template->post = $post;
Expand Down
14 changes: 7 additions & 7 deletions quickstart/cs/creating-posts.texy
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ Nyní přidáme také možnost editace příspěvku. Bude to velmi jednoduché.
Přidáme novou stránku `edit` do presenteru `EditPresenter`:

```php .{file:app/UI/Edit/EditPresenter.php}
public function renderEdit(int $postId): void
public function renderEdit(int $id): void
{
$post = $this->database
->table('posts')
->get($postId);
->get($id);

if (!$post) {
$this->error('Post not found');
Expand All @@ -149,12 +149,12 @@ A upravíme metodu `postFormSucceeded`, která bude schopna jednak přidat nový
```php .{file:app/UI/Edit/EditPresenter.php}
private function postFormSucceeded(array $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

if ($postId) {
if ($id) {
$post = $this->database
->table('posts')
->get($postId);
->get($id);
$post->update($data);

} else {
Expand All @@ -168,9 +168,9 @@ private function postFormSucceeded(array $data): void
}
```

Pokud je k dispozici parametr `postId`, znamená to, že budeme upravovat příspěvek. V tom případě ověříme, že požadovaný příspěvek opravdu existuje a pokud ano, aktualizujeme jej v databázi. Pokud parametr `postId` není k dispozici, pak to znamená, že by měl být nový příspěvek přidán.
Pokud je k dispozici parametr `id`, znamená to, že budeme upravovat příspěvek. V tom případě ověříme, že požadovaný příspěvek opravdu existuje a pokud ano, aktualizujeme jej v databázi. Pokud parametr `id` není k dispozici, pak to znamená, že by měl být nový příspěvek přidán.

Kde se však onen parametr `postId` vezme? Jedná se o parametr, který byl vložen do metody `renderEdit`.
Kde se však onen parametr `id` vezme? Jedná se o parametr, který byl vložen do metody `renderEdit`.

Nyní můžeme přidat odkaz do šablony `app/UI/Post/show.latte`:

Expand Down
2 changes: 1 addition & 1 deletion quickstart/cs/single-post.texy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Pátá a poslední řádka šablony zobrazuje celý obsah jednoho konkrétního
Kontrola ID příspěvku
=====================

Co se stane, když někdo změní ID v URL a vloží nějaké neexistující `postId`? Měli bychom uživateli nabídnout pěknou chybu typu "stránka nebyla nalezena". Pozměníme tedy trošku render metodu v `PostPresenter`:
Co se stane, když někdo změní ID v URL a vloží nějaké neexistující `id`? Měli bychom uživateli nabídnout pěknou chybu typu "stránka nebyla nalezena". Pozměníme tedy trošku render metodu v `PostPresenter`:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $id): void
Expand Down
6 changes: 3 additions & 3 deletions quickstart/de/comments.texy
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ Sie bedeutet "nachdem das Formular erfolgreich abgeschickt wurde, rufe die Metho
```php .{file:app/UI/Post/PostPresenter.php}
private function commentFormSucceeded(\stdClass $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

$this->database->table('comments')->insert([
'post_id' => $postId,
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
Expand Down Expand Up @@ -134,7 +134,7 @@ Der Nette Database Explorer verwendet die Fremdschlüssel, um die Beziehungen zw
Wie Sie sich vielleicht erinnern, haben wir die Variable `$post` an die Vorlage in `PostPresenter::renderShow()` übergeben, und jetzt wollen wir alle Kommentare durchgehen, deren Spalte `post_id` gleich unserer `$post->id` ist. Sie können dies tun, indem Sie `$post->related('comments')` aufrufen. So einfach ist das. Sehen Sie sich den resultierenden Code an.

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $postId): void
public function renderShow(int $id): void
{
...
$this->template->post = $post;
Expand Down
14 changes: 7 additions & 7 deletions quickstart/de/creating-posts.texy
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ Lassen Sie uns auch die Möglichkeit hinzufügen, bestehende Beiträge zu bearbe
Wir fügen eine neue Seite `edit` zu `EditPresenter` hinzu:

```php .{file:app/UI/Edit/EditPresenter.php}
public function renderEdit(int $postId): void
public function renderEdit(int $id): void
{
$post = $this->database
->table('posts')
->get($postId);
->get($id);

if (!$post) {
$this->error('Post not found');
Expand All @@ -149,12 +149,12 @@ Und aktualisieren Sie die Methode `postFormSucceeded`, mit der Sie entweder eine
```php .{file:app/UI/Edit/EditPresenter.php}
private function postFormSucceeded(array $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

if ($postId) {
if ($id) {
$post = $this->database
->table('posts')
->get($postId);
->get($id);
$post->update($data);

} else {
Expand All @@ -168,9 +168,9 @@ private function postFormSucceeded(array $data): void
}
```

Wenn der Parameter `postId` angegeben wird, bedeutet dies, dass ein Beitrag bearbeitet wird. In diesem Fall wird überprüft, ob der Beitrag wirklich existiert, und wenn ja, wird er in der Datenbank aktualisiert. Wenn der Parameter `postId` nicht angegeben wird, bedeutet dies, dass ein neuer Beitrag hinzugefügt wird.
Wenn der Parameter `id` angegeben wird, bedeutet dies, dass ein Beitrag bearbeitet wird. In diesem Fall wird überprüft, ob der Beitrag wirklich existiert, und wenn ja, wird er in der Datenbank aktualisiert. Wenn der Parameter `id` nicht angegeben wird, bedeutet dies, dass ein neuer Beitrag hinzugefügt wird.

Aber woher kommt die `postId`? Es ist der Parameter, der an die Methode `renderEdit` übergeben wird.
Aber woher kommt die `id`? Es ist der Parameter, der an die Methode `renderEdit` übergeben wird.

Sie können nun einen Link zur Vorlage `app/UI/Post/show.latte` hinzufügen:

Expand Down
2 changes: 1 addition & 1 deletion quickstart/de/single-post.texy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ In der fünften und letzten Zeile der Vorlage wird der gesamte Inhalt Ihres Beit
Überprüfen der Post-ID .[#toc-checking-post-id]
===============================================

Was passiert, wenn jemand die URL ändert und `postId` einfügt, die nicht existiert? Wir sollten dem Benutzer eine schöne Fehlermeldung "Seite nicht gefunden" geben. Aktualisieren wir die Render-Methode in `PostPresenter`:
Was passiert, wenn jemand die URL ändert und `id` einfügt, die nicht existiert? Wir sollten dem Benutzer eine schöne Fehlermeldung "Seite nicht gefunden" geben. Aktualisieren wir die Render-Methode in `PostPresenter`:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $id): void
Expand Down
6 changes: 3 additions & 3 deletions quickstart/el/comments.texy
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ $form->onSuccess[] = $this->commentFormSucceeded(...);
```php .{file:app/UI/Post/PostPresenter.php}
private function commentFormSucceeded(\stdClass $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

$this->database->table('comments')->insert([
'post_id' => $postId,
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
Expand Down Expand Up @@ -134,7 +134,7 @@ private function commentFormSucceeded(\stdClass $data): void
Όπως ίσως θυμάστε, έχουμε περάσει τη μεταβλητή `$post` στο πρότυπο στο `PostPresenter::renderShow()` και τώρα θέλουμε να επαναλάβουμε όλα τα σχόλια που έχουν τη στήλη `post_id` ίση με το `$post->id` μας . Μπορείτε να το κάνετε καλώντας το `$post->related('comments')`. Είναι τόσο απλό. Κοιτάξτε τον κώδικα που προκύπτει.

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $postId): void
public function renderShow(int $id): void
{
...
$this->template->post = $post;
Expand Down
14 changes: 7 additions & 7 deletions quickstart/el/creating-posts.texy
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ private function postFormSucceeded(array $data): void
Θα προσθέσουμε μια νέα σελίδα `edit` στο `EditPresenter`:

```php .{file:app/UI/Edit/EditPresenter.php}
public function renderEdit(int $postId): void
public function renderEdit(int $id): void
{
$post = $this->database
->table('posts')
->get($postId);
->get($id);

if (!$post) {
$this->error('Post not found');
Expand All @@ -149,12 +149,12 @@ public function renderEdit(int $postId): void
```php .{file:app/UI/Edit/EditPresenter.php}
private function postFormSucceeded(array $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

if ($postId) {
if ($id) {
$post = $this->database
->table('posts')
->get($postId);
->get($id);
$post->update($data);

} else {
Expand All @@ -168,9 +168,9 @@ private function postFormSucceeded(array $data): void
}
```

Όταν παρέχεται η παράμετρος `postId`, σημαίνει ότι γίνεται επεξεργασία μιας ανάρτησης. Σε μια τέτοια περίπτωση, θα ελέγξουμε ότι η ανάρτηση υπάρχει πραγματικά και αν ναι, θα την ενημερώσουμε στη βάση δεδομένων. Εάν δεν παρέχεται η παράμετρος `postId`, σημαίνει ότι θα προστεθεί μια νέα ανάρτηση.
Όταν παρέχεται η παράμετρος `id`, σημαίνει ότι γίνεται επεξεργασία μιας ανάρτησης. Σε μια τέτοια περίπτωση, θα ελέγξουμε ότι η ανάρτηση υπάρχει πραγματικά και αν ναι, θα την ενημερώσουμε στη βάση δεδομένων. Εάν δεν παρέχεται η παράμετρος `id`, σημαίνει ότι θα προστεθεί μια νέα ανάρτηση.

Αλλά από πού προέρχεται το `postId`; Είναι η παράμετρος που δίνεται στη μέθοδο `renderEdit`.
Αλλά από πού προέρχεται το `id`; Είναι η παράμετρος που δίνεται στη μέθοδο `renderEdit`.

Μπορείτε τώρα να προσθέσετε έναν σύνδεσμο στο πρότυπο `app/UI/Post/show.latte`:

Expand Down
2 changes: 1 addition & 1 deletion quickstart/el/single-post.texy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ final class PostPresenter extends Nette\Application\UI\Presenter
Έλεγχος του αναγνωριστικού της δημοσίευσης .[#toc-checking-post-id]
===================================================================

Τι συμβαίνει αν κάποιος αλλάξει το URL και εισάγει το `postId` που δεν υπάρχει? Θα πρέπει να παρέχουμε στο χρήστη ένα ωραίο σφάλμα "η σελίδα δεν βρέθηκε". Ας ενημερώσουμε τη μέθοδο render στο `PostPresenter`:
Τι συμβαίνει αν κάποιος αλλάξει το URL και εισάγει το `id` που δεν υπάρχει? Θα πρέπει να παρέχουμε στο χρήστη ένα ωραίο σφάλμα "η σελίδα δεν βρέθηκε". Ας ενημερώσουμε τη μέθοδο render στο `PostPresenter`:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $id): void
Expand Down
6 changes: 3 additions & 3 deletions quickstart/en/comments.texy
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ It means "after the form is successfully submitted, call the method `commentForm
```php .{file:app/UI/Post/PostPresenter.php}
private function commentFormSucceeded(\stdClass $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

$this->database->table('comments')->insert([
'post_id' => $postId,
'post_id' => $id,
'name' => $data->name,
'email' => $data->email,
'content' => $data->content,
Expand Down Expand Up @@ -134,7 +134,7 @@ Nette Database Explorer uses the foreign keys to resolve relations between table
As you may remember, we’ve passed the `$post` variable to the template in `PostPresenter::renderShow()` and now we want to iterate through all the comments that have the column `post_id` equal to our `$post->id`. You can do it by calling `$post->related('comments')`. It’s that simple. Look at the resulting code.

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $postId): void
public function renderShow(int $id): void
{
...
$this->template->post = $post;
Expand Down
14 changes: 7 additions & 7 deletions quickstart/en/creating-posts.texy
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ Let’s also add the capability to edit existing posts. It shall be pretty simpl
We’ll add a new `edit` page to the `EditPresenter`:

```php .{file:app/UI/Edit/EditPresenter.php}
public function renderEdit(int $postId): void
public function renderEdit(int $id): void
{
$post = $this->database
->table('posts')
->get($postId);
->get($id);

if (!$post) {
$this->error('Post not found');
Expand All @@ -149,12 +149,12 @@ And update the method `postFormSucceeded`, which will be able either to add a ne
```php .{file:app/UI/Edit/EditPresenter.php}
private function postFormSucceeded(array $data): void
{
$postId = $this->getParameter('postId');
$id = $this->getParameter('id');

if ($postId) {
if ($id) {
$post = $this->database
->table('posts')
->get($postId);
->get($id);
$post->update($data);

} else {
Expand All @@ -168,9 +168,9 @@ private function postFormSucceeded(array $data): void
}
```

When `postId` parameter is provided, it means that a post is being edited. In such case, we’ll check that the post really exists and if so, we’ll update it in the database. If the `postId` is not provided, it means that a new post shall be added.
When `id` parameter is provided, it means that a post is being edited. In such case, we’ll check that the post really exists and if so, we’ll update it in the database. If the `id` is not provided, it means that a new post shall be added.

But where does the `postId` come from? It is the parameter passed to `renderEdit` method.
But where does the `id` come from? It is the parameter passed to `renderEdit` method.

You can now add a link to the `app/UI/Post/show.latte` template:

Expand Down
2 changes: 1 addition & 1 deletion quickstart/en/single-post.texy
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ The fifth and the last line of the template displays full content of your post.
Checking Post ID
================

What happens if someone alters the URL and inserts `postId` which does not exist? We should provide the user with a nice "page not found" error. Let’s update the render method in `PostPresenter`:
What happens if someone alters the URL and inserts `id` which does not exist? We should provide the user with a nice "page not found" error. Let’s update the render method in `PostPresenter`:

```php .{file:app/UI/Post/PostPresenter.php}
public function renderShow(int $id): void
Expand Down
Loading

0 comments on commit bdde973

Please sign in to comment.