Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libs/native-federation/src/utils/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ export async function translateFederationArtefacts(

const sourceLocalePath = path.join(outputPath, 'browser', sourceLocale);

const cmd = `node node_modules/.bin/localize-translate -r ${sourceLocalePath} -s "${sourcePattern}" -t ${translationFiles} -o ${translationOutPath} --target-locales ${targetLocales} -l ${sourceLocale}`;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here executing execSync("node node_modules/.bin/localize-translate ... ") where "localize-translate" contains

@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\@angular\localize\tools\bundles\src\translate\cli.js" %*

does not make much sense, no? we execute it a bit node wrapped, something like node node translate -args i guess.

const localizeTranslate = path.resolve("node_modules/.bin/localize-translate");

const cmd = `${localizeTranslate} -r ${sourceLocalePath} -s "${sourcePattern}" -t ${translationFiles} -o ${translationOutPath} --target-locales ${targetLocales} -l ${sourceLocale}`;
Copy link
Author

@ValentinBossi ValentinBossi Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also just removing "node" in the cmd makes some trouble so i use path.resolve().
this code is tested and runs on windows 11 and on gitpod with a linux.


ensureDistFolders(locales, outputPath);
copyRemoteEntry(locales, outputPath, sourceLocalePath);
Expand Down