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

Fix translations transform build errors #24631

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

wendevlin
Copy link
Contributor

Proposed change

  • let gulp handle translations tranfrom errors to be able to see what exactly failed.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@github-actions github-actions bot added the Build Related to building the code label Mar 14, 2025
@wendevlin wendevlin requested a review from bramkragten March 14, 2025 12:46
@bramkragten
Copy link
Member

I'm not sure if this is the right solution or if we should use the .on("error") and callback function of a task:

diff --git a/build-scripts/gulp/translations.js b/build-scripts/gulp/translations.js
index 059babc09..3f593fbce 100755
--- a/build-scripts/gulp/translations.js
+++ b/build-scripts/gulp/translations.js
@@ -145,14 +145,14 @@ gulp.task("clean-translations", () => deleteAsync([workDir]));
 
 const makeWorkDir = () => mkdir(workDir, { recursive: true });
 
-const createTestTranslation = () =>
+const createTestTranslation = (cb) =>
   env.isProdBuild()
     ? Promise.resolve()
     : gulp
-        .src(EN_SRC)
-        .pipe(new CustomJSON(null, testReviver))
-        .pipe(rename(`${TEST_LOCALE}.json`))
-        .pipe(gulp.dest(workDir));
+      .src(EN_SRC)
+      .pipe(new CustomJSON(null, testReviver)).on("error", cb)
+      .pipe(rename(`${TEST_LOCALE}.json`))
+      .pipe(gulp.dest(workDir));
 
 /**
  * This task will build a master translation file, to be used as the base for

Both work, but not sure which is the better one, @steverep you got any input on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Related to building the code cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants