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

White-labeled plugin: Remove feature flag and translation checks for strings #95557

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading