Skip to content

Commit

Permalink
chore(i18n,learn): processed translations (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
camperbot authored Oct 28, 2024
1 parent 9c73d7c commit ceab3f0
Show file tree
Hide file tree
Showing 1,190 changed files with 72,829 additions and 4,254 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dashedName: step-18

# --description--

If `0` is found, the function should immediately return a tuple containing the row index and column index of the empty cell.
If `0` is found, the method should immediately return a tuple containing the row index and column index of the empty cell.

Inside the `try` block, after the assignment of `col`, return `row, col`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ displacement_of_ball = ball._Projectile__calculate_displacement() # 12.617399600

# --hints--

You should declare a function called `__calculate_displacement` with `def __calculate_displacement(self):`.
You should declare a method called `__calculate_displacement` with `def __calculate_displacement(self):`.

```js
({test: () => assert(runPython(`_Node(_code).find_class("Projectile").has_function("__calculate_displacement")`))})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dashedName: step-6

# --description--

Now it's time to work on the function to calculate the coordinates of the trajectory! Create a method of the `Projectile` class named `__calculate_y_coordinate`, it should have, other than `self`, an `x` parameter.
Now it's time to work on calculating the coordinates of the trajectory! Create a method of the `Projectile` class named `__calculate_y_coordinate`, it should have, other than `self`, an `x` parameter.

\\[ y = y_0 + x \tan\theta - \frac{g x^2}{2 v_0^2 \cos^2\theta} \\]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dashedName: step-15

Now it's time for the graph. Create a method `create_trajectory` and replace the last `print` call at the bottom of your code with `print(graph.create_trajectory())`.

As the first step of this new function, make a local copy of the coordinates but where all the values are rounded to integers. Save this new version of the coordinates in a variable named `rounded_coords`, and return this variable.
As the first step of this new method, make a local copy of the coordinates but where all the values are rounded to integers. Save this new version of the coordinates in a variable named `rounded_coords`, and return this variable.

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Return `x_max, y_max`.

# --hints--

The function should return `x_max, y_max`.
The method should return `x_max, y_max`.

```js
({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spam == 'Always look on the spam side of life' # True

It takes three arguments: the regex pattern to match, the replacement, and the string on which you want to perform the replacement.

From your `__str__` function, return a `sub()` call passing the string `'1'`, an empty string, and your existing `equation_string.strip('+')` call as the arguments. This will replace each `1` with an empty string. The result is not refined yet and you'll continue to work on the regex pattern in the next steps.
From your `__str__` method, return a `sub()` call passing the string `'1'`, an empty string, and your existing `equation_string.strip('+')` call as the arguments. This will replace each `1` with an empty string. The result is not refined yet and you'll continue to work on the regex pattern in the next steps.

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ dashedName: step-2

# --description--

變量可以存儲不同數據類型的值。 You just assigned an integer value, but if you want to represent some text, you need to assign a string. Strings are sequences of characters enclosed by single or double quotes, but you cannot start a string with a single quote and end it with a double quote or vice versa:
變量可以存儲不同數據類型的值。 You just assigned an integer value, but if you want to represent some text, you need to assign a string. 字符串是由單引號或雙引號包含的字符序列, 但你不能以單引號開始一個字符串,然後以雙引號結尾,反之亦然:

```py
string_1 = "I am a string"
string_2 = 'I am also a string'
string_3 = 'This is not valid"
```

刪除你的 `number` 變量及其值。 Then, declare another variable called `text` and assign the string `'Hello World'` to this variable.
刪除你的 `number` 變量及其值。 然後聲明另一個變量名爲 `text` 並將字符串 `'Hello World'` 分配到這個變量。

# --hints--

Expand All @@ -32,7 +32,7 @@ You should declare a variable called `text`. 注意將變量名放在行首。
assert.match(code, /^text\s*=/m)
```

You should assign the string `'Hello World'` to your `text` variable. Remember to use either single or double quotes to enclose the string and pay attention to the letter case.
You should assign the string `'Hello World'` to your `text` variable. 請記住使用單引號或雙引號將字符串括起來,並注意字母大小寫。

```js
assert.match(code, /^text\s*=\s*("|')Hello World\1\s*(#.*)?$/m)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ dashedName: step-4

# --description--

An *argument* is an object or an expression passed to a function — added between the opening and closing parentheses — when it is called:
*argument*是傳遞給函數的對象或表達式 - 在調用時添加在左括號和右括號之間:

```py
greet = 'Hello!'
print(greet)
```

The code in the example above would print the string `'Hello!'`, which is the value of the variable `greet` passed to `print()` as the argument.
上面例子中的代碼將打印字符串 `'Hello!'`,它是作爲參數傳遞給 `print()` 的變量 `greet` 的值。

Print your `text` variable to the screen by passing the `text` variable as the argument to the `print()` function.
通過將 `text` 變量作爲參數傳遞給 `print()` 函數,將 `text` 變量打印到屏幕上。

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ dashedName: step-49

# --description--

A function is essentially a reusable block of code. You have already met some built-in functions, like `print()`, `find()` and `len()`. But you can also define custom functions like this:
函數本質上是可重複使用的代碼塊。 You have already met some built-in functions, like `print()`, `find()` and `len()`. But you can also define custom functions like this:

```py
def function_name():
<code>
```

A function declaration starts with the `def` keyword followed by the function name — a valid variable name — and a pair of parentheses. The declaration ends with a colon.
函數聲明以 `def` 關鍵字開始,然後是函數名稱——一個有效的變量名稱——和一對括號。 聲明以冒號結束。

Right after your `shift` variable, declare a function called `caesar` and indent all the following lines to give your new function a body.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ dashedName: step-45

# --description--

When the loop reaches the letter `Z`, the sum `index + shift` exceeds the last index of the string `alphabet`. Therefore, `alphabet[new_index]` is trying to use an invalid index, which causes an `IndexError` to be thrown.
當循環到達字母 `Z` 時,`index + shift` 之和超過了字符串 `alphabet` 的最後一個索引。 因此,`alphabet[new_index]` 嘗試使用無效索引,這會導致拋出 `IndexError` 異常。

You can notice that the output in the terminal stops at the space immediately before the `Z`, the last `print` before the error is thrown.

In this case, the modulo operator (`%`) can be used to return the remainder of the division between two numbers. For example: `5 % 2` is equal to `1`, because 5 divided by 2 has a quotient of 2 and a remainder of 1.
在這種情況下,模運算符 (`%`) 可用於返回兩個數字相除的餘數。 例如:`5 % 2` 等於 `1`,因爲 5 除以 2 的商爲 2,餘數爲 1。

Surround `index + shift` with parentheses, and modulo the expression with `26`, which is the `alphabet` length.
`index + shift` 用括號括起來,並用 `26`(即 `alphabet` 長度)對錶達式取模。

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dashedName: step-16

# --description--

Now you need to link the `styles.css` file, so the styles will be applied again. Inside the `head` element, add a `link` element. Give it a `rel` attribute with the value of `"stylesheet"` and a `href` attribute with the value of `"styles.css"`.
Now you need to link the `styles.css` file, so the styles will be applied again. Inside the `head` element, add a `link` element. Give it a `rel` attribute with the value of `"stylesheet"` and an `href` attribute with the value of `"styles.css"`.

# --hints--

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ dashedName: build-a-cash-register
| Twenty Dollars | 20 美元(TWENTY) |
| One Hundred Dollars | 100 美元(ONE HUNDRED) |

**目標:** 構建一個功能和 <a href="https://cash-register.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://cash-register.freecodecamp.rocks</a> 類似的應用。
**Objective:** Build an app that is functionally similar to <a href="https://cash-register.freecodecamp.rocks" target="_blank" rel="noopener noreferrer nofollow">https://cash-register.freecodecamp.rocks</a>.

**用戶需求:**

1. 你應該有一個 `id` `"cash"``input` 元素
1. 你應該有一個 `id``"change-due"``div``span` 或者 `p` 元素。
1. 你應該有一個 `button` 元素,它的`id` `"purchase-btn"`
1. `#cash` 元素中的值小於 `price`,應該出現提示 `"Customer does not have enough money to purchase the item"`
1. `#cash` 元素中的值等於 `price` 時,`#change-due` 元素的值應爲 `"No change due - customer paid with exact cash"`
1. `price` `19.5` 時,`#cash` 元素的值爲 `20``cid` `[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]`,當 `#purchase-btn` 元素被點擊後,`#change-due` 元素的值應該是 `"Status: OPEN QUARTER: $0.5"`
1. `price` `3.26` 時,`#cash` 元素中的值爲 `100``cid` `[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]`,並且點擊 `#purchase-btn` 元素時,`#change-due` 元素中的值應爲 `"Status: OPEN TWENTY: $60 TEN: $20 FIVE: $15 ONE: $1 QUARTER: $0.5 DIME: $0.2 PENNY: $0.04"`
1. `price` `19.5` 時,`#cash` 元素中的值爲 `20``cid` `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`,並且點擊 `#purchase-btn` 元素時,`#change-due` 元素中的值應爲 `"Status: INSUFFICIENT_FUNDS"`
1. `price` `19.5` 時,`#cash` 元素中的值爲 `20``cid` `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`,並且點擊 `#purchase-btn` 元素時,`#change-due` 元素中的值應爲 `"Status: INSUFFICIENT_FUNDS"`
1. `price` `19.5` 時,`#cash` 元素中的值爲 `20``cid` `[["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`,並且點擊 `#purchase-btn` 元素時,`#change-due` 元素中的值應爲 `"Status: CLOSED PENNY: $0.5"`
1. You should have an `input` element with an `id` of `"cash"`.
1. You should have a `div`, `span` or `p` element with an `id` of `"change-due"`.
1. You should have a `button` element with an `id` of `"purchase-btn"`.
1. When the value in the `#cash` element is less than `price`, an alert should appear with the text `"Customer does not have enough money to purchase the item"`.
1. When the value in the `#cash` element is equal to `price`, the value in the `#change-due` element should be `"No change due - customer paid with exact cash"`.
1. When `price` is `19.5`, the value in the `#cash` element is `20`, `cid` is `[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: OPEN QUARTER: $0.5"`.
1. When `price` is `3.26`, the value in the `#cash` element is `100`, `cid` is `[["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.1], ["QUARTER", 4.25], ["ONE", 90], ["FIVE", 55], ["TEN", 20], ["TWENTY", 60], ["ONE HUNDRED", 100]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: OPEN TWENTY: $60 TEN: $20 FIVE: $15 ONE: $1 QUARTER: $0.5 DIME: $0.2 PENNY: $0.04"`.
1. When `price` is `19.5`, the value in the `#cash` element is `20`, `cid` is `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: INSUFFICIENT_FUNDS"`.
1. When `price` is `19.5`, the value in the `#cash` element is `20`, `cid` is `[["PENNY", 0.01], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 1], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: INSUFFICIENT_FUNDS"`.
1. When `price` is `19.5`, the value in the `#cash` element is `20`, `cid` is `[["PENNY", 0.5], ["NICKEL", 0], ["DIME", 0], ["QUARTER", 0], ["ONE", 0], ["FIVE", 0], ["TEN", 0], ["TWENTY", 0], ["ONE HUNDRED", 0]]`, and the `#purchase-btn` element is clicked, the value in the `#change-due` element should be `"Status: CLOSED PENNY: $0.5"`.

滿足用戶故事並通過下面的所有測試來完成這個項目。 賦予它你的個人風格. 祝你編碼愉快!

Expand Down Expand Up @@ -465,8 +465,9 @@ for (const [denominationName, denomination] of _money) {
const maxCountInChange = Math.floor(changeLeft / denomination);
// If denomination can complete required changeLeft, available amount in drawer cannot
// equal the maximum. Otherwise count in drawer can be greater than maximum count in change.
let defaultAmount = denomination < 100 ? 3 : 15
const drawerCount = _randomNumber(
changeLeft % denomination === 0 ? Math.min(15, maxCountInChange - 1) : 15
changeLeft % denomination === 0 ? Math.min(defaultAmount, maxCountInChange - 1) : defaultAmount
);
const amountInDrawer = drawerCount * denomination;
_cashInDrawer.push([denominationName, amountInDrawer / 100]);
Expand Down
Loading

0 comments on commit ceab3f0

Please sign in to comment.