From 1de4486711f853fdd2cb7752fea834fc5789cd90 Mon Sep 17 00:00:00 2001 From: Cathy Sarisky Date: Mon, 9 Mar 2026 12:59:01 -0400 Subject: [PATCH] update gulpfile and dependencies for building i18n files --- gulpfile.js | 15 +++++++++++++-- package.json | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 3a8f9a3543..61a3079519 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,6 +19,9 @@ const colorFunction = require('postcss-color-mod-function'); const cssnano = require('cssnano'); const easyimport = require('postcss-easy-import'); +// translations support +const { mergeLocales } = require('@tryghost/theme-translations/build'); + const REPO = 'TryGhost/Casper'; const REPO_READONLY = 'TryGhost/Casper'; const CHANGELOG_PATH = path.join(process.cwd(), '.', 'changelog.md'); @@ -89,11 +92,19 @@ function zipper(done) { ], handleError(done)); } +function locales(done) { + mergeLocales({ + local: './locales-local', + output: './locales' + })(done); +} + const cssWatcher = () => watch('assets/css/**', css); const jsWatcher = () => watch('assets/js/**', js); const hbsWatcher = () => watch(['*.hbs', 'partials/**/*.hbs'], hbs); -const watcher = parallel(cssWatcher, jsWatcher, hbsWatcher); -const build = series(css, js); +const localesWatcher = () => watch('./locales-local/**/*.json', locales); +const watcher = parallel(cssWatcher, jsWatcher, hbsWatcher, localesWatcher); +const build = series(css, js, locales); exports.build = build; exports.zip = series(build, zipper); diff --git a/package.json b/package.json index 0088fe5188..7e116319d5 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "contributors": "https://github.com/TryGhost/Casper/graphs/contributors", "devDependencies": { "@tryghost/release-utils": "0.8.1", + "@tryghost/theme-translations": "^0.0.9", "autoprefixer": "10.4.24", "beeper": "2.1.0", "cssnano": "7.1.2",