diff --git a/lib/chromiumRebaseL10n.js b/lib/chromiumRebaseL10n.js index 06fe1e825cc2..824e04691cfa 100644 --- a/lib/chromiumRebaseL10n.js +++ b/lib/chromiumRebaseL10n.js @@ -11,8 +11,12 @@ const resetChromeStringFiles = () => { // Revert to original before string replacement for android_chrome_strings.grd // because original grd is overwritten with replaced one in ./src/brave. const srcDir = config.projects['chrome'].dir - const androidChromeStringsPath = path.resolve(path.join(srcDir, 'chrome', 'android', 'java', 'strings', 'android_chrome_strings.grd')) - util.run('git', ['checkout', androidChromeStringsPath], { cwd: srcDir }) + const targetFilesForReset = [] + targetFilesForReset.push(path.resolve(path.join(srcDir, 'chrome', 'android', 'java', 'strings', 'android_chrome_strings.grd'))) + targetFilesForReset.push(path.resolve(path.join(srcDir, 'components', 'management_strings.grdp'))) + targetFilesForReset.forEach((targetFile) => { + util.run('git', ['checkout', targetFile], { cwd: srcDir }) + }) } const chromiumRebaseL10n = async (options) => { diff --git a/lib/l10nUtil.js b/lib/l10nUtil.js index 6a420949e9dc..8c5f7b3aaacc 100644 --- a/lib/l10nUtil.js +++ b/lib/l10nUtil.js @@ -38,6 +38,10 @@ const braveComponentsStringsPath = path.resolve(path.join(srcDir, 'brave', 'app' const chromiumBookmarksBarStringsPartPath = path.resolve(path.join(srcDir, 'components', 'bookmark_bar_strings.grdp')) const braveBookmarksBarStringsPartPath = path.resolve(path.join(srcDir, 'brave', 'app', 'bookmark_bar_strings.grdp')) +// src/components/components_strings.grd and any of its parts files. +const chromiumManagementStringsPartPath = path.resolve(path.join(srcDir, 'components', 'management_strings.grdp')) +const braveManagementStringsPartPath = path.resolve(path.join(srcDir, 'brave', 'chromium_src', 'components', 'management_strings.grdp')) + // generated_resources.grd and any of its parts files that we track localization for in transifex // There is also chromeos_strings.grdp but we don't need to track it here // These map to brave/app/resources/generated_resoruces*.xtb @@ -99,7 +103,8 @@ const chromiumToAutoGeneratedBraveMapping = { [chromiumAppManagementStringsPartPath]: braveAppManagementStringsPartPath, [chromiumGlobalMediaControlsStringsPartPath]: braveGlobalMediaControlsStringsPartPath, [chromiumSupervisedUserErrorPageStringsPartPath]: braveSupervisedUserErrorPageStringsPartPath, - [androidChromeStringsPath]: braveAndroidChromeStringsPath + [androidChromeStringsPath]: braveAndroidChromeStringsPath, + [chromiumManagementStringsPartPath]: braveManagementStringsPartPath } // Same as with chromiumToAutoGeneratedBraveMapping but maps in the opposite direction diff --git a/lib/util.js b/lib/util.js index de0ae85894c2..65dc2d01a318 100755 --- a/lib/util.js +++ b/lib/util.js @@ -149,6 +149,7 @@ const util = { const braveAppVectorIconsDir = path.join(config.projects['brave-core'].dir, 'vector_icons', 'chrome', 'app') const chromeAndroidDir = path.join(config.srcDir, 'chrome', 'android') const braveAndroidDir = path.join(config.projects['brave-core'].dir, 'android') + const braveChromiumSrcDir = path.join(config.projects['brave-core'].dir, 'chromium_src') let fileMap = new Set(); // The following 3 entries we map to the same name, not the chromium equivalent name for copying back @@ -156,6 +157,7 @@ const util = { autoGeneratedBraveToChromiumMapping[path.join(braveAppDir, 'settings_brave_strings.grdp')] = path.join(chromeAppDir, 'settings_brave_strings.grdp') autoGeneratedBraveToChromiumMapping[path.join(braveAppDir, 'components_brave_strings.grd')] = path.join(config.srcDir, 'components', 'components_brave_strings.grd') autoGeneratedBraveToChromiumMapping[path.join(braveAndroidDir, 'java', 'strings', 'android_chrome_strings.grd')] = path.join(chromeAndroidDir, 'java', 'strings', 'android_chrome_strings.grd') + autoGeneratedBraveToChromiumMapping[path.join(braveChromiumSrcDir, 'components', 'management_strings.grdp')] = path.join(config.srcDir, 'components', 'management_strings.grdp') Object.entries(autoGeneratedBraveToChromiumMapping).forEach(mapping => fileMap.add(mapping)) // Copy xtb files for: