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

[RNMobile] Retrieve translation of color settings strings #38026

Merged
merged 3 commits into from
Jan 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions packages/components/src/mobile/color-settings/utils.native.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

const gradients = {
linear: 'linear-gradient',
radial: 'radial-gradient',
};

const gradientOptions = [
{ label: 'Linear', value: gradients.linear },
{ label: 'Radial', value: gradients.radial },
{ label: __( 'Linear' ), value: gradients.linear },
{ label: __( 'Radial' ), value: gradients.radial },
Comment on lines +12 to +13
Copy link
Contributor Author

Choose a reason for hiding this comment

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

gradientOptions is being used in Custom Gradient Picker component:

const { getGradientType, gradients, gradientOptions } = colorsUtils;

<PanelBody title={ __( 'Gradient Type' ) }>
<RadioControl
selected={ gradientType }
options={ gradientOptions }

];

const getGradientType = ( color ) => {
Expand All @@ -23,7 +28,7 @@ export const colorsUtils = {
picker: 'Picker',
palette: 'Palette',
},
segments: [ 'Solid', 'Gradient' ],
segments: [ __( 'Solid' ), __( 'Gradient' ) ],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

segments is being used in the Palette screen component:

const { segments, isGradient } = colorsUtils;

<SegmentedControls
segments={ segments }

gradients,
gradientOptions,
getGradientType,
Expand Down