Skip to content

Commit

Permalink
Fixup some strings for google product names
Browse files Browse the repository at this point in the history
We should not replace google's own product name such as Google Docs
or Google Drive.

fix #5450
  • Loading branch information
simonhong committed Feb 3, 2020
1 parent 638457a commit d748a44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/l10nUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ module.exports.rebaseBraveStringFilesOnChromiumL10nFiles = async function (path)
for (const replacement of defaultReplacements) {
contents = contents.replace(replacement[0], replacement[1])
}
for (const replacement of fixupReplacements) {
contents = contents.replace(replacement[0], replacement[1])
}
await new Promise(resolve => fs.writeFile(destPath, contents, 'utf8', resolve))
})
await Promise.all(ops)
Expand Down Expand Up @@ -230,7 +233,6 @@ const defaultReplacements = [
[/Chrome/g, 'Brave'],
[/Google LLC. All rights reserved./g, 'The Brave Authors. All rights reserved.'],
[/(Google)(?! Play)/g, 'Brave'],
[/Brave Safe Browsing/g, 'Google Safe Browsing'],
[/You're incognito/g, 'This is a private window'],
[/an incognito/g, 'a private'],
[/an Incognito/g, 'a Private'],
Expand All @@ -248,3 +250,12 @@ const defaultReplacements = [
[/bookmarks bar\n/g, 'bookmarks\n'],
[/Copyright <ph name="(YEAR|year)">/g, 'Copyright © <ph name="$1">'],
]

// Fix up some strings after aggressive first round replacement.
const fixupReplacements = [
[/Brave Cloud Print/g, 'Google Cloud Print'],
[/Brave Docs/g, 'Google Docs'],
[/Brave Drive/g, 'Google Drive'],
[/Brave OS/g, 'Chrome OS'],
[/Brave Safe Browsing/g, 'Google Safe Browsing'],
]

0 comments on commit d748a44

Please sign in to comment.