0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Removed i18n toggle from labs UI (#21927)

ref bb9a69e
ref https://linear.app/ghost/issue/ENG-1753/labs-flags-cleanup

- We promoted i18n to GA several weeks ago now, and it's going fine
- Removing the UI first to reduce confusion before cleaning up all the other references to the flag
- Also changed the i18n test to set the language back at the end of the test, to ensure no conflicts
This commit is contained in:
Hannah Wolfe 2024-12-19 15:52:10 +00:00 committed by GitHub
parent 4a3626696e
commit fab5544217
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 16 deletions

View file

@ -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>). Dont 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

View file

@ -6,21 +6,19 @@ 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');
await section.getByRole('button', {name: 'Edit'}).click();
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');
await section.getByRole('button', {name: 'Edit'}).click();
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',
@ -41,6 +39,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');
});
});
});