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

Fix translation of routing constraints note #1099

Merged

Conversation

pocke
Copy link

@pocke pocke commented Nov 18, 2021

routingのガイドを読んでいて、少し気になったので3つの修正をします。

原文は次のように書かれているところです。

Request constraints work by calling a method on the Request object with the same name as the hash key and then comparing the return value with the hash value. Therefore, constraint values should match the corresponding Request object method return type. For example: constraints: { subdomain: 'api' } will match an api subdomain as expected. However, using a symbol constraints: { subdomain: :api } will not, because request.subdomain returns 'api' as a String.

1つ目は、「メソッド呼び出し時にハッシュキーと同じ名前をメソッドに渡し、」に違和感がありました。
この文ではハッシュキーを何かしらのメソッドに引数として渡しているように読めますが、実際にはハッシュキーと同じ名前のメソッドを呼んでいます。そのため、そのように翻訳を修正しました。

2つ目は、その続きの「返された値をハッシュ値と比較します。」の部分です。
ハッシュ値と言うとObject#hashの戻り値のようなものを想像しますが、実際にはここでは「呼び出したハッシュのキーに対応する値」が比較対象になります。それがわかりやすいように「ハッシュの値」と変更してみました。

3つ目は細かい点ですが、「Requestオブジェクトメソッド」となっていて「オブジェクトメソッド」が1語になっていたので、これを「オブジェクトのメソッド」としました。

@yasulab
Copy link
Member

yasulab commented Nov 24, 2021

修正 PR ありがとうございます...!! 😻🆒✨
「オブジェクトメソッド」は Typo っぽいですね 😂
こちらも修正ありがとうございます! (>人< )💖

@yasulab yasulab merged commit cc9fc32 into yasslab:master Nov 24, 2021
@pocke pocke deleted the Fix_translation_of_routing_constraints_note branch November 24, 2021 14:32
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.

None yet

2 participants