Skip to content

Commit

Permalink
Launch sidebar uses react-i18n for some of it's translations
Browse files Browse the repository at this point in the history
  • Loading branch information
p-jackson committed Nov 20, 2020
1 parent f10182f commit de7947d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
import { registerPlugin as originalRegisterPlugin, PluginSettings } from '@wordpress/plugins';
import { doAction, hasAction } from '@wordpress/hooks';
import { LaunchContext } from '@automattic/launch';
import { I18nProvider } from '@automattic/react-i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -41,9 +42,11 @@ registerPlugin( 'a8c-editor-site-launch', {
}

return (
<LaunchContext.Provider value={ { siteId: window._currentSiteId } }>
<LaunchModal onClose={ closeSidebar } />
</LaunchContext.Provider>
<I18nProvider>
<LaunchContext.Provider value={ { siteId: window._currentSiteId } }>
<LaunchModal onClose={ closeSidebar } />
</LaunchContext.Provider>
</I18nProvider>
);
},
} );
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import * as React from 'react';
import { useSelect, useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { useI18n } from '@automattic/react-i18n';

/**
* Internal dependencies
Expand All @@ -19,6 +19,7 @@ interface Props {
}

const LaunchMenu: React.FunctionComponent< Props > = ( { onMenuItemClick } ) => {
const { __ } = useI18n();
const { step: currentStep } = useSelect( ( select ) => select( LAUNCH_STORE ).getState() );
const LaunchStep = useSelect( ( select ) => select( LAUNCH_STORE ).getLaunchStep() );
const LaunchSequence = useSelect( ( select ) => select( LAUNCH_STORE ).getLaunchSequence() );
Expand Down

0 comments on commit de7947d

Please sign in to comment.