Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

プリント文の翻訳 part 2 #342

Merged
merged 23 commits into from
Aug 17, 2022

Conversation

SatoTakeshiX
Copy link
Contributor

@SatoTakeshiX SatoTakeshiX commented Aug 13, 2022

Closes #143 <紐付けたいIssueの番号>

下記pull requestのpart 2です。
#335

TODO

下記タスクが終わった後にpull requestをready for reviewに変更します。

訳さなかったもの

functions.mdのこのprint文は意図的に翻訳していません。
hello, world は決り文句みたいなものですし、前後の文章とつながりはないです。
なので訳さなくても問題ないと判断しました。

func printHelloWorld() {
    print("hello, world")
}

```

特定のアイテムが含まれているかどうかを調べるには、`contains(_:)` メソッドを使用することができます。

```swift
if favoriteGenres.contains("Funk") {
print("I get up on the good foot.")
print("James BrownのGet On The Good Footは最高です!")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

意訳しました。
「いい足で起き上がる」だと意味が通じないので。
FunkといえばJames BrownのOn The Good Footなので、それがわかるようにしました。
https://www.youtube.com/watch?v=VgGwI12zMJg

@@ -490,11 +490,11 @@ default:
let stillAnotherPoint = (9, 0)
switch stillAnotherPoint {
case (let distance, 0), (0, let distance):
print("On an axis, \(distance) from the origin")
print("x 軸上または y 軸上にあり、原点から \(distance) 離れている。")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[self review] 意訳しています。

an axis を「ある軸上」と訳すよりは具体的な軸に言及したほうがわかりやすいかなと思いました。

@@ -62,10 +62,10 @@ Swift では、関数のパラメータと戻り値は非常に柔軟です。

```swift
func sayHelloWorld() -> String {
return "hello, world"
return "こんにちは、 world"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他の箇所で「Hello」を「こんにちは」で訳したので、ここは訳しました
違和感ある場合は言ってください!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

関数名がsayHelloWorldなのでhelloままでも良いかもしれないですね。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

オッケーです。 "hello, world" のままにしておきます 👍

Comment on lines +121 to +123
// "hello, world" を出力し、 12 の値が返されます
printWithoutCounting(string: "hello, world")
// hello, world" but doesn't return a value
// "hello, world" を出力しますが、値は返されません
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文は以下のようです。

printAndCount(string: "hello, world")
// prints "hello, world" and returns a value of 12
printWithoutCounting(string: "hello, world")
// prints "hello, world" but doesn't return a value

https://docs.swift.org/swift-book/LanguageGuide/Functions.html

printの英文が抜けていたので、翻訳は原文を参照しました。

@@ -312,7 +312,7 @@ func findIndex<T: Equatable>(of valueToFind: T, in array:[T]) -> Int? {

```swift
let doubleIndex = findIndex(of: 9.3, in: [3.14159, 0.1, 0.25])
// doubleIndex は、9.3 が配列にないため、オプショナルの Int です
// doubleIndex は、9.3 が配列にないため、オプショナルの Int 型で値はありません
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文は以下です。
https://docs.swift.org/swift-book/LanguageGuide/Generics.html

let doubleIndex = findIndex(of: 9.3, in: [3.14159, 0.1, 0.25])
// doubleIndex is an optional Int with no value, because 9.3 isn't in the array

with no valueの情報が現状抜け落ちていたので補いました

@@ -190,7 +190,7 @@ print("Car: \(car.description)")
> NOTE
> 継承した定数の格納プロパティまたは継承した読み取り専用計算プロパティにプロパティオブザーバを追加することはできません。これらのプロパティの値は変更できないため、オーバーライドの一部として `willSet` または `didSet` の実装を提供することは適切ではありません。 同じプロパティに対して、set のオーバーライドとプロパティオブザーバのオーバーライドの、両方を提供することはできないことにも注意してください。プロパティの値の変更を監視する必要があり、そのプロパティのカスタムの set を既に提供している場合は、カスタムの set 内から値の変更が簡単に監視できます。

次の例では、`Car` のサブクラスの `AutomaticCar` という新しいクラスを定義しています。`AutomaticCar` クラスは、現在の速度に基づいて使用する適切なギアを自動的に選択する自動ギアボックスを備えた車を表します:
次の例では、`Car` のサブクラスの `AutomaticCar` という新しいクラスを定義しています。`AutomaticCar` クラスは、現在の速度に基づいて使用する適切なギアを自動的に選択する自動ギアボックスを備えた車、オートマ車を表します:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 210で「オートマ車」の単語を使いたかったので、ここで初出させました。

@SatoTakeshiX SatoTakeshiX marked this pull request as ready for review August 13, 2022 12:37
@github-actions github-actions bot requested a review from stzn August 13, 2022 12:38
}
// (1, 1) is inside the box
// (1, 1) は箱の中にあります
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// (1, 1) は箱の中にあります
// (1, 1) はボックスの中にあります

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

表記ゆれ直します

Copy link
Owner

@stzn stzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!いくつかコメントしました🙇🏻‍♂️

@@ -230,7 +230,7 @@ func loadPicture(from server: Server, completion: (Picture) -> Void, onFailure:
loadPicture(from: someServer) { picture in
someView.currentPicture = picture
} onFailure: {
print("Couldn't download the next picture.")
print("画像がダウンロードできませんでした。")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("画像がダウンロードできませんでした。")
print("画像をダウンロードできませんでした。")

@@ -458,13 +458,13 @@ func collectCustomerProviders(_ customerProvider: @autoclosure @escaping () -> S
collectCustomerProviders(customersInLine.remove(at: 0))
collectCustomerProviders(customersInLine.remove(at: 0))

print("Collected \(customerProviders.count) closures.")
// Collected 2 closures.
print("集められた \(customerProviders.count) 個のクロージャー。")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

集められたという表現がややわかりづらいかなあと思いました。配列には今何個のprovider があります的なニュアンスを上手く表現したいですね。

Suggested change
print("集められた \(customerProviders.count) 個のクロージャー。")
print("\(customerProviders.count) 個のクロージャーが保持されています。")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

わかりやすくなったと思います。 保持されています良いと思います

@@ -458,13 +458,13 @@ func collectCustomerProviders(_ customerProvider: @autoclosure @escaping () -> S
collectCustomerProviders(customersInLine.remove(at: 0))
collectCustomerProviders(customersInLine.remove(at: 0))

print("Collected \(customerProviders.count) closures.")
// Collected 2 closures.
print("集められた \(customerProviders.count) 個のクロージャー。")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -306,19 +306,19 @@ var favoriteGenres: Set = ["Rock", "Classical", "Hip hop"]
セットのアイテムの数を調べるために、読み取り専用の `count` プロパティをチェックします。

```swift
print("I have \(favoriteGenres.count) favorite music genres.")
// I have 3 favorite music genres.
print("私には \(favoriteGenres.count) 個の好きな音楽ジャンがあります。")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("私には \(favoriteGenres.count) 個の好きな音楽ジャンがあります。")
print("私には \(favoriteGenres.count) 個の好きな音楽ジャンルがあります。")

print("I have \(favoriteGenres.count) favorite music genres.")
// I have 3 favorite music genres.
print("私には \(favoriteGenres.count) 個の好きな音楽ジャンがあります。")
// 私には 3 個の好きな音楽ジャンがあります。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 私には 3 個の好きな音楽ジャンがあります
// 私には 3 個の好きな音楽ジャンルがあります

}
// This is a defined temperature unit, so initialization succeeded.
// これは温度の単位として定義されているので、初期化は成功しました。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// これは温度の単位として定義されているので、初期化は成功しました
// これは温度の単位として定義されているので、初期化に成功しました


let unknownUnit = TemperatureUnit(rawValue: "X")
if unknownUnit == nil {
print("This isn't a defined temperature unit, so initialization failed.")
print("これは温度の単位としては定義されていないので、初期化は失敗しました。")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print("これは温度の単位としては定義されていないので、初期化は失敗しました。")
print("これは温度の単位としては定義されていないので、初期化に失敗しました。")

}
// This isn't a defined temperature unit, so initialization failed.
// これは温度の単位としては定義されていないので、初期化は失敗しました。
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// これは温度の単位としては定義されていないので、初期化は失敗しました
// これは温度の単位としては定義されていないので、初期化に失敗しました

@@ -43,10 +43,10 @@ struct BlackjackCard {
// BlackjackCard のプロパティとメソッド
let rank: Rank, suit: Suit
var description: String {
var output = "suit is \(suit.rawValue),"
output += " value is \(rank.values.first)"
var output = "スートは \(suit.rawValue),"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var output = "スートは \(suit.rawValue),"
var output = "柄は \(suit.rawValue),"

@@ -71,7 +71,7 @@ struct BlackjackCard {
```swift
let theAceOfSpades = BlackjackCard(rank: .ace, suit: .spades)
print("theAceOfSpades: \(theAceOfSpades.description)")
// theAceOfSpades: suit is ♠, value is 1 or 11
// theAceOfSpades: スートは ♠, 数字は 1 と 11
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// theAceOfSpades: スートは ♠, 数字は 1 と 11
// theAceOfSpades: 柄は ♠, 数字は 1 と 11

@SatoTakeshiX
Copy link
Contributor Author

@t-ae
更新しました
6b52a7a

@SatoTakeshiX
Copy link
Contributor Author

SatoTakeshiX commented Aug 14, 2022

@stzn 更新しました
ed64796

漏れがあったら教えてください

@SatoTakeshiX SatoTakeshiX requested review from t-ae and stzn August 14, 2022 07:24
}
}

do {
try nourish(with: "Beet-Flavored Chips")
} catch {
print("Unexpected non-vending-machine-related error: \(error)")
print("予期しない自動販売機とは関係ないのエラーが発生: \(error)")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すいません誤字の修正とちょっとだけ変えてみました🙇🏻‍♂️

Suggested change
print("予期しない自動販売機とは関係ないのエラーが発生: \(error)")
print("予期せぬ自動販売機とは関係ないエラーが発生: \(error)")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

誤字ぜんぜん気づかなかったです。
更新しました!
50bb671

@SatoTakeshiX SatoTakeshiX requested a review from stzn August 14, 2022 07:31
stzn
stzn previously approved these changes Aug 14, 2022
Copy link
Owner

@stzn stzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです👍🏻ありがとうございます!

language-guide/control-flow.md Outdated Show resolved Hide resolved
language-guide/control-flow.md Outdated Show resolved Hide resolved
language-guide/control-flow.md Outdated Show resolved Hide resolved
apply t-ae san feedback

Co-authored-by: t.ae <t-ae@users.noreply.github.com>
SatoTakeshiX and others added 2 commits August 17, 2022 13:36
apply t-ae san feedback

Co-authored-by: t.ae <t-ae@users.noreply.github.com>
@SatoTakeshiX
Copy link
Contributor Author

@t-ae さん、提案いただいた修正、問題なさそうなのでそのまま取り込みました。
レビューお願いします

@SatoTakeshiX SatoTakeshiX requested review from t-ae and stzn August 17, 2022 04:42
Copy link
Owner

@stzn stzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@stzn stzn merged commit 92e4b0e into stzn:master Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

コードのprintの翻訳(コメント部分も)
3 participants