From 2fb24db771ec8cfeee9b8ba31e1c331caf964737 Mon Sep 17 00:00:00 2001 From: YutamaKotaro Date: Sat, 29 May 2021 23:54:30 +0900 Subject: [PATCH 1/2] translate switch.md --- docs/switch.md | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/docs/switch.md b/docs/switch.md index 365755d61ee..4ad8303bc7c 100644 --- a/docs/switch.md +++ b/docs/switch.md @@ -3,10 +3,12 @@ id: switch title: Switch --- -Renders a boolean input. +真偽値のインプットを描画します。 This is a controlled component that requires an `onValueChange` callback that updates the `value` prop in order for the component to reflect user actions. If the `value` prop is not updated, the component will continue to render the supplied `value` prop instead of the expected result of any user actions. +ユーザーの操作を反映させるためには props の `value` を更新する必要があるため、`onValueChange`にコールバック関数を与えて `value` を更新させる必要があります。もし `value` が更新されない場合は、コンポーネントはユーザーの操作の結果期待される値の代わりに、渡された `value` を使い描画し続けてしまいます。 + ## Example ```SnackPlayer name=Switch&supportedPlatforms=android,ios @@ -49,15 +51,15 @@ export default App; ### [View Props](view.md#props) -Inherits [View Props](view.md#props). +[View Props](view.md#props)を継承しています。 --- ### `disabled` -If true the user won't be able to toggle the switch. +true の場合、ユーザーは switch の値を変更できません。 -| Type | Default | +| 型 | デフォルト値 | | ---- | ------- | | bool | `false` | @@ -65,9 +67,10 @@ If true the user won't be able to toggle the switch. ### `ios_backgroundColor`
iOS
-On iOS, custom color for the background. This background color can be seen either when the switch value is `false` or when the switch is disabled (and the switch is translucent). +iOS 用の、カスタムバックグラウンドカラーです。このバックグラウンドカラーは、switch の value が false あるいは switch の disabled が true の時(switch は半透明になります)に反映されます。 + -| Type | +| 型 | | ------------------ | | [color](colors.md) | @@ -75,9 +78,9 @@ On iOS, custom color for the background. This background color can be seen eithe ### `onChange` -Invoked when the user tries to change the value of the switch. Receives the change event as an argument. If you want to only receive the new value, use `onValueChange` instead. +ユーザーが switch の値を変更しようとした時に呼び出されます。引数として change event を受け取る事ができます。もしも、変更後の値のみを受け取りたい場合は、代わりに `onValueChange` を使用してください。 -| Type | +| 型 | | -------- | | function | @@ -86,8 +89,9 @@ Invoked when the user tries to change the value of the switch. Receives the chan ### `onValueChange` Invoked when the user tries to change the value of the switch. Receives the new value as an argument. If you want to instead receive an event, use `onChange`. +ユーザーが switch の値を変更しようとした時に呼び出されます。引数として変更後の値を受け取ります。もしも、値の代わりに event を受け取りたい場合は `onChange` を使用してください。 -| Type | +| 型 | | -------- | | function | @@ -95,9 +99,9 @@ Invoked when the user tries to change the value of the switch. Receives the new ### `thumbColor` -Color of the foreground switch grip. If this is set on iOS, the switch grip will lose its drop shadow. +switch のつまみの部分の色です。もし iOS でこのプロパティを設定した場合、つまみの drop shadow は消えます。 -| Type | +| 型 | | ------------------ | | [color](colors.md) | @@ -105,11 +109,13 @@ Color of the foreground switch grip. If this is set on iOS, the switch grip will ### `trackColor` -Custom colors for the switch track. +switch の可動域の色です。 _iOS_: When the switch value is `false`, the track shrinks into the border. If you want to change the color of the background exposed by the shrunken track, use [`ios_backgroundColor`](switch.md#ios_backgroundColor). -| Type | +_iOS_: switch の value が false の時は可動域の色は境界の中まで縮小されてしまいます。もし、縮小してる状態の背景色を変更したい場合は[`ios_backgroundColor`](switch.md#ios_backgroundColor)を使用してください。 + +| 型 | | --------------------------------------------------------------- | | object: { false: [color](colors.md), true: [color](colors.md) } | @@ -118,7 +124,8 @@ _iOS_: When the switch value is `false`, the track shrinks into the border. If y ### `value` The value of the switch. If true the switch will be turned on. Default value is false. +switch の値です。もし true であれば switch はオンになります。デフォルト値は false です。 -| Type | +| 型 | | ---- | | bool | From 1b13d11037c6ad6a47b76a51cd114e1f50cfc862 Mon Sep 17 00:00:00 2001 From: YutamaKotaro Date: Wed, 14 Jul 2021 00:46:07 +0900 Subject: [PATCH 2/2] remove excess line --- docs/switch.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/switch.md b/docs/switch.md index 4ad8303bc7c..e16c29fcbb7 100644 --- a/docs/switch.md +++ b/docs/switch.md @@ -5,8 +5,6 @@ title: Switch 真偽値のインプットを描画します。 -This is a controlled component that requires an `onValueChange` callback that updates the `value` prop in order for the component to reflect user actions. If the `value` prop is not updated, the component will continue to render the supplied `value` prop instead of the expected result of any user actions. - ユーザーの操作を反映させるためには props の `value` を更新する必要があるため、`onValueChange`にコールバック関数を与えて `value` を更新させる必要があります。もし `value` が更新されない場合は、コンポーネントはユーザーの操作の結果期待される値の代わりに、渡された `value` を使い描画し続けてしまいます。 ## Example