Skip to content

Commit

Permalink
[feat] Translate guide>scaling-up>routing page
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonlicau committed Feb 7, 2025
1 parent addb29a commit fa7849d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ export default defineConfigWithTheme<ThemeConfig>({

editLink: {
repo: 'vuejs/docs',
text: 'Edit this page on GitHub'
text: 'Edytuj tę stronę na GitHub'
},

footer: {
Expand Down
26 changes: 13 additions & 13 deletions src/guide/scaling-up/routing.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Routing {#routing}

## Client-Side vs. Server-Side Routing {#client-side-vs-server-side-routing}
## Routing po stronie klienta vs. po stronie serwera {#client-side-vs-server-side-routing}

Routing on the server side means the server is sending a response based on the URL path that the user is visiting. When we click on a link in a traditional server-rendered web app, the browser receives an HTML response from the server and reloads the entire page with the new HTML.
Routing po stronie serwera oznacza, że serwer zwraca response opierając się na URL pod którym użytkownik odwiedza aplikację. Gdy klikamy w link w tradycyjnej aplikacji renderowanej po stronie serwera, przeglądarka pobiera odpowiedź HTML z serwera i przeładowuje całą stronę z nowym kodem HTML.

In a [Single-Page Application](https://developer.mozilla.org/en-US/docs/Glossary/SPA) (SPA), however, the client-side JavaScript can intercept the navigation, dynamically fetch new data, and update the current page without full page reloads. This typically results in a more snappy user experience, especially for use cases that are more like actual "applications", where the user is expected to perform many interactions over a long period of time.
W aplikacjach [Single-Page](https://developer.mozilla.org/en-US/docs/Glossary/SPA) (SPA), kod JavaScript po stronie klienta może przechwycić nawigację, dynamicznie pobrać nowe dane i zaktualizować stronę bez pełnego odświeżania strony. Zazwyczaj oznacza to lepsze user experience, szczególnie w przypadkach, które są bardziej jak faktyczne "aplikacje" - tj użytkownik wykonuje bardzo wiele interakcji przez dłuższy okres czasu.

In such SPAs, the "routing" is done on the client side, in the browser. A client-side router is responsible for managing the application's rendered view using browser APIs such as [History API](https://developer.mozilla.org/en-US/docs/Web/API/History) or the [`hashchange` event](https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event).
W takich aplikacjach SPA "routing" dzieje się po stronie klienta, w jego przeglądarce. Router w tym wypadku jest odpowiedzialny za zarządzanie renderowanym widokiem aplikacji wykorzystując API przeglądarek jak [History API](https://developer.mozilla.org/en-US/docs/Web/API/History) lub [event `hashchange`](https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event).

## Official Router {#official-router}
## Oficjalny Router {#official-router}

<!-- TODO update links -->
<div>
<VueSchoolLink href="https://vueschool.io/courses/vue-router-4-for-everyone" title="Free Vue Router Course">
Watch a Free Video Course on Vue School
<VueSchoolLink href="https://vueschool.io/courses/vue-router-4-for-everyone" title="Darmowa lekcja o Vue Router">
Obejrzyj bezpłatną lekcję wideo na Vue School
</VueSchoolLink>
</div>

Vue is well-suited for building SPAs. For most SPAs, it's recommended to use the officially-supported [Vue Router library](https://github.com/vuejs/router). For more details, see Vue Router's [documentation](https://router.vuejs.org/).
Vue świetnie nadaje się do budowania aplikacji SPA. Dla większości SPA, zalecamy użycie oficjalnie wspieranej [biblioteki Vue Router](https://github.com/vuejs/router). Aby dowiedzieć się więcej, odwiedź dokumentację [Vue Routera](https://router.vuejs.org/).

## Simple Routing from Scratch {#simple-routing-from-scratch}
## Prosty routing od podstaw {#simple-routing-from-scratch}

If you only need very simple routing and do not wish to involve a full-featured router library, you can do so with [Dynamic Components](/guide/essentials/component-basics#dynamic-components) and update the current component state by listening to browser [`hashchange` events](https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event) or using the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History).
Jeśli potrzebujesz jedynie bardzo prostego routingu i nie chcesz korzystać z pełnoprawnej biblioteki routingu, możesz wykorzystać [dynamiczne komponenty](/guide/essentials/component-basics#dynamic-components) i aktualizować obecny komponent nasłuchując do eventów [`hashchange` przegląrdki](https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event) lub wykorzystać [History API](https://developer.mozilla.org/en-US/docs/Web/API/History).

Here's a bare-bone example:
Poniżej przedstawiamy bardzo uproszczony przykład:

<div class="composition-api">

Expand Down Expand Up @@ -58,7 +58,7 @@ const currentView = computed(() => {
</template>
```

[Try it in the Playground](https://play.vuejs.org/#eNptUk1vgkAQ/SsTegAThZp4MmhikzY9mKanXkoPWxjLRpgly6JN1P/eWb5Eywlm572ZN2/m5GyKwj9U6CydsIy1LAyUaKpiHZHMC6UNnEDjbgqxyovKYAIX2GmVg8sktwe9qhzbdz+wga15TW++VWX6fB3dAt6UeVEVJT2me2hhEcWKSgOamVjCCk4RAbiBu6xbT5tI2ML8VDeI6HLlxZXWSOZdmJTJPJB3lJSoo5+pWBipyE9FmU4soU2IJHk+MGUrS4OE2nMtIk4F/aA7BW8Cq3WjYlDbP4isQu4wVp0F1Q1uFH1IPDK+c9cb1NW8B03tyJ//uvhlJmP05hM4n60TX/bb2db0CoNmpbxMDgzmRSYMcgQQCkjZhlXkPASRs7YmhoFYw/k+WXvKiNrTcQgpmuFv7ZOZFSyQ4U9a7ZFgK2lvSTXFDqmIQbCUJTMHFkQOBAwKg16kM3W6O7K3eSs+nbeK+eee1V/XKK0dY4Q3vLhR6uJxMUK8/AFKaB6k)
[Wypróbuj w piaskownicy](https://play.vuejs.org/#eNptUk1vgkAQ/SsTegAThZp4MmhikzY9mKanXkoPWxjLRpgly6JN1P/eWb5Eywlm572ZN2/m5GyKwj9U6CydsIy1LAyUaKpiHZHMC6UNnEDjbgqxyovKYAIX2GmVg8sktwe9qhzbdz+wga15TW++VWX6fB3dAt6UeVEVJT2me2hhEcWKSgOamVjCCk4RAbiBu6xbT5tI2ML8VDeI6HLlxZXWSOZdmJTJPJB3lJSoo5+pWBipyE9FmU4soU2IJHk+MGUrS4OE2nMtIk4F/aA7BW8Cq3WjYlDbP4isQu4wVp0F1Q1uFH1IPDK+c9cb1NW8B03tyJ//uvhlJmP05hM4n60TX/bb2db0CoNmpbxMDgzmRSYMcgQQCkjZhlXkPASRs7YmhoFYw/k+WXvKiNrTcQgpmuFv7ZOZFSyQ4U9a7ZFgK2lvSTXFDqmIQbCUJTMHFkQOBAwKg16kM3W6O7K3eSs+nbeK+eee1V/XKK0dY4Q3vLhR6uJxMUK8/AFKaB6k)

</div>

Expand Down Expand Up @@ -102,6 +102,6 @@ export default {
</template>
```

[Try it in the Playground](https://play.vuejs.org/#eNptUstO6zAQ/ZVR7iKtVJKLxCpKK3Gli1ggxIoNZmGSKbFoxpEzoUi0/87YeVBKNonHPmfOmcdndN00yXuHURblbeFMwxtFpm6sY7i1NcLW2RriJPWBB8bT8/WL7Xh6D9FPwL3lG9tROWHGiwGmqLDUMjhhYgtr+FQEEKdxFqRXfaR9YrkKAoqOnocfQaDEre523PNKzXqx7M8ADrlzNEYAReccEj9orjLYGyrtPtnZQrOxlFS6rXqgZJdPUC5s3YivMhuTDCkeDe6/dSalvognrkybnIgl7c4UuLhcwuHgS3v2/7EPvzRruRXJ7/SDU12W/98l451pGQndIvaWi0rTK8YrEPx64ymKFQOce5DOzlfs4cdlkA+NzdNpBSRgrJudZpQIINdQOdyuVfQnVdHGzydP9QYO549hXIII45qHkKUL/Ail8EUjBgX+z9k3JLgz9OZJgeInYElAkJlWmCcDUBGkAsrTyWS0isYV9bv803x1OTiWwzlrWtxZ2lDGDO90mWepV3+vZojHL3QQKQE=)
[Wypróbuj w piaskownicy](https://play.vuejs.org/#eNptUstO6zAQ/ZVR7iKtVJKLxCpKK3Gli1ggxIoNZmGSKbFoxpEzoUi0/87YeVBKNonHPmfOmcdndN00yXuHURblbeFMwxtFpm6sY7i1NcLW2RriJPWBB8bT8/WL7Xh6D9FPwL3lG9tROWHGiwGmqLDUMjhhYgtr+FQEEKdxFqRXfaR9YrkKAoqOnocfQaDEre523PNKzXqx7M8ADrlzNEYAReccEj9orjLYGyrtPtnZQrOxlFS6rXqgZJdPUC5s3YivMhuTDCkeDe6/dSalvognrkybnIgl7c4UuLhcwuHgS3v2/7EPvzRruRXJ7/SDU12W/98l451pGQndIvaWi0rTK8YrEPx64ymKFQOce5DOzlfs4cdlkA+NzdNpBSRgrJudZpQIINdQOdyuVfQnVdHGzydP9QYO549hXIII45qHkKUL/Ail8EUjBgX+z9k3JLgz9OZJgeInYElAkJlWmCcDUBGkAsrTyWS0isYV9bv803x1OTiWwzlrWtxZ2lDGDO90mWepV3+vZojHL3QQKQE=)

</div>

0 comments on commit fa7849d

Please sign in to comment.