Skip to content

Commit

Permalink
Remove feature flag and translation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sixhours committed Oct 21, 2024
1 parent 2d68e51 commit 07ce119
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 46 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import config from '@automattic/calypso-config';
import { ExternalLink } from '@automattic/components';
import { useHasEnTranslation } from '@automattic/i18n-utils';
import { useTranslate } from 'i18n-calypso';
import { useSite } from 'calypso/landing/stepper/hooks/use-site';
import { recordMigrationInstructionsLinkClick } from '../tracking';
Expand All @@ -9,17 +7,11 @@ import type { FC } from 'react';

export const StepAddMigrationKeyFallback: FC = () => {
const translate = useTranslate();
const hasEnTranslation = useHasEnTranslation();
const site = useSite();
const siteUrl = site?.URL ?? '';
const isWhiteLabeledPluginEnabled = config.isEnabled(
'migration-flow/enable-white-labeled-plugin'
);
const migrationKeyLabel = isWhiteLabeledPluginEnabled
? 'Migration Key'
: 'Migrate Guru Migration Key';
const migrateLabel = isWhiteLabeledPluginEnabled ? 'Start migration' : 'Migrate';
const pluginName = isWhiteLabeledPluginEnabled ? 'Migrate to WordPress.com' : 'Migrate Guru';
const migrationKeyLabel = 'Migration Key';
const migrateLabel = 'Start migration';
const pluginName = 'Migrate to WordPress.com';
const ctaTranslationComponents = {
a: (
<ExternalLink
Expand All @@ -35,23 +27,13 @@ export const StepAddMigrationKeyFallback: FC = () => {

return (
<p>
{ hasEnTranslation(
'Go to the {{a}}%(pluginName)s page on the new WordPress.com site{{/a}} and copy the migration key. Then paste it on the {{strong}}%(migrationKeyLabel)s{{/strong}} field of your existing site and click {{strong}}%(migrateLabel)s{{/strong}}.'
)
? translate(
'Go to the {{a}}%(pluginName)s page on the new WordPress.com site{{/a}} and copy the migration key. Then paste it on the {{strong}}%(migrationKeyLabel)s{{/strong}} field of your existing site and click {{strong}}%(migrateLabel)s{{/strong}}.',
{
components: ctaTranslationComponents,
args: { pluginName, migrationKeyLabel, migrateLabel },
}
)
: translate(
'Go to the {{a}}Migrate Guru page on the new WordPress.com site{{/a}} and copy the migration key. Then paste it on the {{strong}}%(migrationKeyLabel)s{{/strong}} field of your existing site and click {{strong}}%(migrateLabel)s{{/strong}}.',
{
components: ctaTranslationComponents,
args: { migrationKeyLabel, migrateLabel },
}
) }
{ translate(
'Go to the {{a}}%(pluginName)s page on the new WordPress.com site{{/a}} and copy the migration key. Then paste it on the {{strong}}%(migrationKeyLabel)s{{/strong}} field of your existing site and click {{strong}}%(migrateLabel)s{{/strong}}.',
{
components: ctaTranslationComponents,
args: { pluginName, migrationKeyLabel, migrateLabel },
}
) }
</p>
);
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config from '@automattic/calypso-config';
import clsx from 'clsx';
import { useTranslate } from 'i18n-calypso';
import { MigrationKeyInput } from '../migration-key-input';
Expand All @@ -11,13 +10,8 @@ interface Props {

export const StepAddMigrationKey: FC< Props > = ( { migrationKey, preparationError } ) => {
const translate = useTranslate();
const isWhiteLabeledPluginEnabled = config.isEnabled(
'migration-flow/enable-white-labeled-plugin'
);
const migrationKeyLabel = isWhiteLabeledPluginEnabled
? 'Migration Key'
: 'Migrate Guru Migration Key';
const migrateLabel = isWhiteLabeledPluginEnabled ? 'Start migration' : 'Migrate';
const migrationKeyLabel = 'Migration Key';
const migrateLabel = 'Start migration';

if ( '' === migrationKey ) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import config from '@automattic/calypso-config';
import { ExternalLink } from '@automattic/components';
import { useHasEnTranslation } from '@automattic/i18n-utils';
import { StepContainer } from '@automattic/onboarding';
import { useTranslate } from 'i18n-calypso';
import FormattedHeader from 'calypso/components/formatted-header';
Expand All @@ -16,10 +14,6 @@ const recordLinkClick = ( linkname: string ) => {

const SiteMigrationStarted: Step = function () {
const translate = useTranslate();
const hasEnTranslation = useHasEnTranslation();
const isWhiteLabeledPluginEnabled = config.isEnabled(
'migration-flow/enable-white-labeled-plugin'
);

const stepContent = (
<div className="migration-started-card">
Expand Down Expand Up @@ -65,10 +59,7 @@ const SiteMigrationStarted: Step = function () {
<>
{ translate( 'Your migration process has started.' ) }
<br />
{ isWhiteLabeledPluginEnabled &&
hasEnTranslation( "We'll email you when the process is finished." )
? translate( "We'll email you when the process is finished." )
: translate( 'Migrate Guru will email you when the process is finished.' ) }
{ translate( "We'll email you when the process is finished." ) }
</>
}
align="center"
Expand Down

0 comments on commit 07ce119

Please sign in to comment.