Skip to content

Commit 84bbbca

Browse files
authored
Translate 'Variables' page (#28)
Originally translated by @effhAVE, updated and corrected by @jakubdrozdek.
1 parent 39efa82 commit 84bbbca

File tree

9 files changed

+160
-160
lines changed

9 files changed

+160
-160
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
In the code below, each line corresponds to the item in the task list.
1+
W kodzie poniżej, każda linia odpowiada podpunktowi w liście zadań.
22

33
```js run
4-
let admin, name; // can declare two variables at once
4+
let admin, name; // można zadeklarować dwie zmienne jednocześnie
55

6-
name = "John";
6+
name = "Jan";
77

88
admin = name;
99

10-
alert( admin ); // "John"
10+
alert( admin ); // "Jan"
1111
```
1212

1-js/02-first-steps/04-variables/1-hello-variables/task.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 2
22

33
---
44

5-
# Working with variables
5+
# Praca ze zmiennymi
66

7-
1. Declare two variables: `admin` and `name`.
8-
2. Assign the value `"John"` to `name`.
9-
3. Copy the value from `name` to `admin`.
10-
4. Show the value of `admin` using `alert` (must output "John").
7+
1. Zadeklaruj dwie zmienne: `admin` oraz `name`.
8+
2. Przypisz wartość `"Jan"` do `name`.
9+
3. Skopiuj wartość z `name` do `admin`.
10+
4. Wyświetl wartość `admin` używając funkcji `alert` (musi wyświetlić "Jan").
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
## The variable for our planet
1+
## Zmienna dla naszej planety
22

3-
That's simple:
3+
To proste:
44

55
```js
6-
let ourPlanetName = "Earth";
6+
let ourPlanetName = "Ziemia";
77
```
88

9-
Note, we could use a shorter name `planet`, but it might be not obvious what planet it refers to. It's nice to be more verbose. At least until the variable isNotTooLong.
9+
Zauważ, że mogliśmy użyć krótszej nazwy `planet`, ale nie jest oczywiste, do jakiej planety się odnosimy. Dobrze jest być konkretnym. Przynajmniej dopóki nazwa nie jest za długa.
1010

11-
## The name of the current visitor
11+
## Nazwa obecnego użytkownika
1212

1313
```js
14-
let currentUserName = "John";
14+
let currentUserName = "Jan";
1515
```
1616

17-
Again, we could shorten that to `userName` if we know for sure that the user is current.
17+
Znowu mogliśmy skrócić nazwę do `userName`, jeśli jesteśmy pewni, że dany użytkownik jest użytkownikiem bieżącym.
1818

19-
Modern editors and autocomplete make long variable names easy to write. Don't save on them. A name with 3 words in it is fine.
19+
Współczesne edytory i autouzupełnianie ułatwiają pisanie długich nazw zmiennych. Nie oszczędzaj na nich. Nazwa składająca się z 3 wyrazów jest w porządku.
2020

21-
And if your editor does not have proper autocompletion, get [a new one](/code-editors).
21+
Jeśli twój edytor nie ma odpowiedniego autouzupełniania, [spraw sobie nowy](/code-editors).

1-js/02-first-steps/04-variables/2-declare-variables/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ importance: 3
22

33
---
44

5-
# Giving the right name
5+
# Nadawanie właściwych nazw
66

7-
1. Create a variable with the name of our planet. How would you name such a variable?
8-
2. Create a variable to store the name of a current visitor to a website. How would you name that variable?
7+
1. Utwórz zmienną z nazwą naszej planety. Jak nazwać taką zmienną?
8+
2. Utwórz zmienną do przechowywania nazwy obecnego gościa strony internetowej. Jak nazwać tę zmienną?
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
We generally use upper case for constants that are "hard-coded". Or, in other words, when the value is known prior to execution and directly written into the code.
1+
Zazwyczaj wielkimi literami zapisujemy stałe, które są "zakodowane na sztywno". Lub, innymi słowy, gdy ich wartość jest znana przed wykonaniem programu i bezpośrednio zapisana w kodzie.
22

3-
In this code, `birthday` is exactly like that. So we could use the upper case for it.
3+
W tym kodzie `birthday` (pol. *data urodzenia*) jest dokładnie takim przypadkiem. Możemy więc użyć wielkich liter.
44

5-
In contrast, `age` is evaluated in run-time. Today we have one age, a year after we'll have another one. It is constant in a sense that it does not change through the code execution. But it is a bit "less of a constant" than `birthday`: it is calculated, so we should keep the lower case for it.
5+
W przeciwieństwie do niej, wartość `age` (pol. *wiek*) jest obliczana w czasie wykonywania programu. Dzisiaj mamy jeden wiek, a za rok będziemy mieli inny. Jest to stała w tym sensie, że nie zmienia się w trakcie wykonania kodu, ale jest trochę "mniej stała" niż `birthday`. Jest to wartość obliczana, więc powinniśmy pozostać przy małych literach.

1-js/02-first-steps/04-variables/3-uppercast-constant/task.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ importance: 4
22

33
---
44

5-
# Uppercase const?
5+
# Stała zapisana wielkimi literami?
66

7-
Examine the following code:
7+
Zbadaj poniższy kod:
88

99
```js
1010
const birthday = '18.04.1982';
1111

1212
const age = someCode(birthday);
1313
```
1414

15-
Here we have a constant `birthday` date and the `age` is calculated from `birthday` with the help of some code (it is not provided for shortness, and because details don't matter here).
15+
Mamy tutaj stałą datę urodzenia `birthday` oraz wiek `age`, który jest obliczany na podstawie `birthday` za pomocą jakiegoś kodu (który nie jest podany dla uproszczenia, ponieważ szczegóły nie są tutaj istotne).
1616

17-
Would it be right to use upper case for `birthday`? For `age`? Or even for both?
17+
Czy byłoby poprawne użycie wielkich liter dla `birthday`? Albo dla `age`? A może nawet dla obydwóch zmiennych?
1818

1919
```js
20-
const BIRTHDAY = '18.04.1982'; // make uppercase?
20+
const BIRTHDAY = '18.04.1982'; // wielkimi literami?
2121

22-
const AGE = someCode(BIRTHDAY); // make uppercase?
22+
const AGE = someCode(BIRTHDAY); // wielkimi literami?
2323
```
2424

0 commit comments

Comments
 (0)