Skip to content

Commit

Permalink
e2e test fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
cathysarisky committed Oct 29, 2024
1 parent 01e5bdb commit 869ea0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
13 changes: 3 additions & 10 deletions ghost/core/core/server/services/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const debug = require('@tryghost/debug')('i18n');

/** @type {import('i18next').i18n} */
let i18nInstance;
let i18nInstanceNewsletter;

module.exports.init = function () {
const i18n = require('@tryghost/i18n');
const events = require('../lib/common/events');
Expand All @@ -14,19 +14,13 @@ module.exports.init = function () {
if (labs.isSet('i18n')) {
locale = settingsCache.get('locale');
}
i18nInstance = i18n(locale, 'ghost');
i18nInstanceNewsletter = i18n(locale, 'newsletter');

module.exports = {
i18nInstance,
i18nInstanceNewsletter
};
module.exports = i18nInstance = i18n(locale, 'ghost');

events.on('settings.labs.edited', () => {
if (labs.isSet('i18n')) {
debug('labs i18n enabled, updating i18n to', settingsCache.get('locale'));
i18nInstance.changeLanguage(settingsCache.get('locale'));
i18nInstanceNewsletter.changeLanguage(settingsCache.get('locale'));
} else {
debug('labs i18n disabled, updating i18n to en');
i18nInstance.changeLanguage('en');
Expand All @@ -37,7 +31,6 @@ module.exports.init = function () {
if (labs.isSet('i18n')) {
debug('locale changed, updating i18n to', model.get('value'));
i18nInstance.changeLanguage(model.get('value'));
i18nInstanceNewsletter.changeLanguage(model.get('value'));
}
});
};
};
1 change: 0 additions & 1 deletion ghost/email-service/lib/EmailRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function escapeHtml(unsafe) {
}

function formatDateLong(date, timezone, locale = 'en-gb') {

return DateTime.fromJSDate(date).setZone(timezone).setLocale(locale).toLocaleString({
year: 'numeric',
month: 'long',
Expand Down

0 comments on commit 869ea0b

Please sign in to comment.