diff --git a/lib/pullL10n.js b/lib/pullL10n.js index f6b8c81957..f4cf357da6 100644 --- a/lib/pullL10n.js +++ b/lib/pullL10n.js @@ -1,3 +1,4 @@ +const path = require('path') const config = require('../lib/config') const util = require('../lib/util') const {braveTopLevelPaths, ethereumRemoteClientPaths} = require('./l10nUtil') @@ -17,7 +18,7 @@ const pullL10n = (options) => { } braveTopLevelPaths.forEach((sourceStringPath) => { - if (!options.grd_path || sourceStringPath.endsWith(`/${options.grd_path}`)) + if (!options.grd_path || sourceStringPath.endsWith(path.sep + `${options.grd_path}`)) util.run('python', ['script/pull-l10n.py', '--source_string_path', sourceStringPath], cmdOptions) }) } diff --git a/lib/pushL10n.js b/lib/pushL10n.js index 81b57cd54f..98f6504381 100644 --- a/lib/pushL10n.js +++ b/lib/pushL10n.js @@ -1,3 +1,4 @@ +const path = require('path') const config = require('../lib/config') const util = require('../lib/util') const {braveTopLevelPaths, ethereumRemoteClientPaths} = require('./l10nUtil') @@ -22,7 +23,8 @@ const pushL10n = (options) => { args = ['checkout', '--', '*.grd*'] util.run('git', args, runOptions) braveTopLevelPaths.forEach((sourceStringPath) => { - util.run('python', ['script/push-l10n.py', '--source_string_path', sourceStringPath], cmdOptions) + if (!options.grd_path || sourceStringPath.endsWith(path.sep + `${options.grd_path}`)) + util.run('python', ['script/push-l10n.py', '--source_string_path', sourceStringPath], cmdOptions) }) } } diff --git a/scripts/commands.js b/scripts/commands.js index 8555814ef4..be7fe3aad7 100755 --- a/scripts/commands.js +++ b/scripts/commands.js @@ -128,6 +128,7 @@ program program .command('push_l10n') .option('--extension ', 'Scope this command to localize a Brave extension such as ethereum-remote-client') + .option('--grd_path ', `Relative path to match end of full GRD path, e.g: '/generated_resources.grd'.`) .action(pushL10n) program