Skip to content

Commit c157d82

Browse files
committed
Revert "Changed theme i18n to use i18next (#23161)"
This reverts commit 36b3e1c.
1 parent 36b3e1c commit c157d82

File tree

12 files changed

+10
-569
lines changed

12 files changed

+10
-569
lines changed

apps/admin-x-settings/src/components/settings/advanced/labs/BetaFeatures.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ const BetaFeatures: React.FC = () => {
7171
action={<FeatureToggle flag="additionalPaymentMethods" />}
7272
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></>}
7373
title='Additional payment methods' />
74-
<LabItem
75-
action={<FeatureToggle flag="themeTranslation" />}
76-
detail={<>Enable theme translation using i18next instead of the old translation package.</>}
77-
title='Updated theme Translation (beta)' />
7874
<LabItem
7975
action={<div className='flex flex-col items-end gap-1'>
8076
<FileUpload

ghost/core/core/frontend/helpers/t.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
// {{tags prefix=(t " on ")}}
1212

1313
const {themeI18n} = require('../services/handlebars');
14-
const {themeI18next} = require('../services/handlebars');
15-
const labs = require('../../shared/labs');
16-
const config = require('../../shared/config');
17-
const settingsCache = require('../../shared/settings-cache');
1814

1915
module.exports = function t(text, options = {}) {
2016
if (!text || text.length === 0) {
@@ -30,29 +26,5 @@ module.exports = function t(text, options = {}) {
3026
}
3127
}
3228

33-
if (labs.isSet('themeTranslation')) {
34-
// Use the new translation package when feature flag is enabled
35-
36-
// Initialize only if needed
37-
if (!themeI18next._i18n) {
38-
themeI18next.init({
39-
activeTheme: settingsCache.get('active_theme'),
40-
locale: config.get('locale')
41-
});
42-
}
43-
44-
return themeI18next.t(text, bindings);
45-
} else {
46-
// Use the existing translation package when feature flag is disabled
47-
48-
// Initialize only if needed
49-
if (!themeI18n._strings) {
50-
themeI18n.init({
51-
activeTheme: settingsCache.get('active_theme'),
52-
locale: config.get('locale')
53-
});
54-
}
55-
56-
return themeI18n.t(text, bindings);
57-
}
29+
return themeI18n.t(text, bindings);
5830
};

ghost/core/core/frontend/services/handlebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
// Theme i18n
2020
// @TODO: this should live somewhere else...
2121
themeI18n: require('./theme-engine/i18n'),
22-
themeI18next: require('./theme-engine/i18next'),
22+
2323
// TODO: these need a more sensible home
2424
localUtils: require('./theme-engine/handlebars/utils')
2525
};

ghost/core/core/frontend/services/theme-engine/active.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const themeConfig = require('./config');
1818
const config = require('../../../shared/config');
1919
const engine = require('./engine');
2020
const themeI18n = require('./i18n');
21-
const themeI18next = require('./i18next');
22-
const labs = require('../../../shared/labs');
2321

2422
// Current instance of ActiveTheme
2523
let currentActiveTheme;
@@ -103,13 +101,7 @@ class ActiveTheme {
103101
options.activeTheme = options.activeTheme || this._name;
104102
options.locale = options.locale || this._locale;
105103

106-
if (labs.isSet('themeTranslation')) {
107-
// Initialize the new translation service
108-
themeI18next.init(options);
109-
} else {
110-
// Initialize the legacy translation service
111-
themeI18n.init(options);
112-
}
104+
themeI18n.init(options);
113105
}
114106

115107
mount(siteApp) {

ghost/core/core/frontend/services/theme-engine/i18next/ThemeI18n.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

ghost/core/core/frontend/services/theme-engine/i18next/index.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

ghost/core/core/shared/labs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ const PUBLIC_BETA_FEATURES = [
3434
'ActivityPub',
3535
'superEditors',
3636
'editorExcerpt',
37-
'additionalPaymentMethods',
38-
'themeTranslation'
37+
'additionalPaymentMethods'
3938
];
4039

4140
// These features are considered private they live in the private tab of the labs settings page

ghost/core/test/e2e-api/admin/__snapshots__/config.test.js.snap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Object {
2727
"stripeAutomaticTax": true,
2828
"superEditors": true,
2929
"themeErrorsNotification": true,
30-
"themeTranslation": true,
3130
"trafficAnalytics": true,
3231
"ui60": true,
3332
"urlCache": true,

ghost/core/test/unit/frontend/helpers/t-new.test.js

Lines changed: 0 additions & 89 deletions
This file was deleted.

ghost/core/test/unit/frontend/services/theme-engine/i18next.test.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)