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

Removed i18n toggle from labs UI (#21927) #21975

Merged
merged 3 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ const BetaFeatures: React.FC = () => {
action={<FeatureToggle flag="additionalPaymentMethods" />}
detail={<>Enable support for CashApp, iDEAL, Bancontact, and others. <a className='text-green' href="https://ghost.org/help/payment-methods" rel="noopener noreferrer" target="_blank">Learn more &rarr;</a></>}
title='Additional payment methods' />
<LabItem
action={<FeatureToggle flag='i18n' />}
detail={<>Translate your membership flows into your publication language (<a className='text-green' href="https://github.com/TryGhost/Ghost/tree/main/ghost/i18n/locales" rel="noopener noreferrer" target="_blank">supported languages</a>). Don’t see yours? <a className='text-green' href="https://forum.ghost.org/t/help-translate-ghost-beta/37461" rel="noopener noreferrer" target="_blank">Get involved</a></>}
title='Portal translation' />
<LabItem
action={<div className='flex flex-col items-end gap-1'>
<FileUpload
Expand Down
25 changes: 11 additions & 14 deletions ghost/core/test/e2e-browser/admin/i18n.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@ const {expect} = require('@playwright/test');
const test = require('../fixtures/ghost-test');
const {createPostDraft} = require('../utils');

/**
* @param {import('@playwright/test').Page} page
*/
async function setLanguage(sharedPage, language) {
await sharedPage.goto('/ghost/#/settings/publication-language');
const section = sharedPage.getByTestId('publication-language');
const input = section.getByPlaceholder('Site language');
await input.fill(language);
await section.getByRole('button', {name: 'Save'}).click();
}

test.describe('i18n', () => {
test.describe('Newsletter', () => {
test('changing the site language immediately translates strings in newsletters', async ({sharedPage}) => {
await sharedPage.goto('/ghost/#/settings/publication-language');
const section = sharedPage.getByTestId('publication-language');
const input = section.getByPlaceholder('Site language');
await input.fill('fr');
await section.getByRole('button', {name: 'Save'}).click();

const labsSection = sharedPage.getByTestId('labs');
await labsSection.getByRole('button', {name: 'Open'}).click();
let portalLabel = labsSection.getByText('Portal translation');
let portalToggle = portalLabel.locator('..').locator('..').locator('..').getByRole('switch');
await portalToggle.click();
await setLanguage(sharedPage, 'fr');

const postData = {
title: 'Publish and email post',
Expand All @@ -40,6 +34,9 @@ test.describe('i18n', () => {
const metaText = await sharedPage.frameLocator('iframe.gh-pe-iframe').locator('td.post-meta').first().textContent();
expect(metaText).toContain('Par Joe Bloggs');
expect(metaText).not.toContain('By Joe Bloggs');

// Set the language back before the next test!
await setLanguage(sharedPage, 'en');
});
});
});
Loading