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

Rename "Bookmarks Bar/bar" to "Bookmarks" (brave-browser) #6344

Merged
merged 1 commit into from
Oct 16, 2019
Merged
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
22 changes: 17 additions & 5 deletions lib/l10nUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ const braveAndroidChromeStringsPath = path.resolve(path.join(srcDir, 'brave', 'a

// component_chromium_strings.grd and any of its parts files that we track localization for in transifex
// These map to brave/app/strings/components_chromium_strings*.xtb
const chromiumComponentsStringsPath = path.resolve(path.join(srcDir, 'components', 'components_chromium_strings.grd'))
const braveChromiumComponentsStringsPath = path.resolve(path.join(srcDir, 'brave', 'app', 'components_brave_strings.grd'))
const chromiumComponentsChromiumStringsPath = path.resolve(path.join(srcDir, 'components', 'components_chromium_strings.grd'))
const braveComponentsBraveStringsPath = path.resolve(path.join(srcDir, 'brave', 'app', 'components_brave_strings.grd'))

// component_strings.grd and any of its parts files that we track localization for in transifex
// These map to brave/app/strings/components_strings*.xtb
const chromiumComponentsStringsPath = path.resolve(path.join(srcDir, 'components', 'components_strings.grd'))
const braveComponentsStringsPath = path.resolve(path.join(srcDir, 'brave', 'app', 'components_strings.grd'))
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'))

// 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
Expand Down Expand Up @@ -65,7 +72,7 @@ const braveSupervisedUserErrorPageStringsPartPath = path.resolve(path.join(srcDi
// brave_components_strings.grd maps to brave/components/resources/strings/brave_components_resources*.xtb
// messages.json localization is handled inside of brave-extension.
const braveSpecificGeneratedResourcesPath = path.resolve(path.join(srcDir, 'brave', 'app', 'brave_generated_resources.grd'))
const braveComponentsStringsPath = path.resolve(path.join(srcDir, 'brave', 'components', 'resources', 'brave_components_strings.grd'))
const braveResourcesComponentsStringsPath = path.resolve(path.join(srcDir, 'brave', 'components', 'resources', 'brave_components_strings.grd'))
const braveExtensionMessagesPath = path.resolve(path.join(srcDir, 'brave', 'components', 'brave_extension', 'extension', 'brave_extension', '_locales', 'en_US', 'messages.json'))
const braveRewardsExtensionMessagesPath = path.resolve(path.join(srcDir, 'brave', 'components', 'brave_rewards', 'resources', 'extension', 'brave_rewards', '_locales', 'en_US', 'messages.json'))

Expand All @@ -77,7 +84,9 @@ const braveRewardsExtensionMessagesPath = path.resolve(path.join(srcDir, 'brave'
const chromiumToAutoGeneratedBraveMapping = {
[chromiumStringsPath]: braveStringsPath,
[chromiumSettingsPartPath]: braveSettingsPartPath,
[chromiumComponentsStringsPath]: braveChromiumComponentsStringsPath,
[chromiumComponentsChromiumStringsPath]: braveComponentsBraveStringsPath,
[chromiumComponentsStringsPath]: braveComponentsStringsPath,
[chromiumBookmarksBarStringsPartPath]: braveBookmarksBarStringsPartPath,
[chromiumGeneratedResourcesPath]: braveGeneratedResourcesPath,
[chromiumBookmarksPartPath]: braveBookmarksPartPath,
[chromiumMediaRouterPartPath]: braveMediaRouterPartPath,
Expand All @@ -99,7 +108,7 @@ module.exports.autoGeneratedBraveToChromiumMapping = Object.keys(chromiumToAutoG

// All paths which are not generated
module.exports.braveNonGeneratedPaths = [
braveSpecificGeneratedResourcesPath, braveComponentsStringsPath, braveExtensionMessagesPath, braveRewardsExtensionMessagesPath
braveSpecificGeneratedResourcesPath, braveResourcesComponentsStringsPath, braveExtensionMessagesPath, braveRewardsExtensionMessagesPath
]

// All paths which are generated
Expand Down Expand Up @@ -160,4 +169,7 @@ const defaultReplacements = [
[/(?<!authenticate )people(?! with slow connections?)/g, 'profiles'],
[/(Person)(?!\w)/g, 'Profile'],
[/(person)(?!\w)/g, 'profile'],
[/Bookmarks Bar\n/g, 'Bookmarks\n'],
Copy link
Member

Choose a reason for hiding this comment

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

nit: couldn't this be done in 1 line by using case-insensitive regex /bookmarks bar\n/gi?

Copy link
Member Author

Choose a reason for hiding this comment

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

no because the third one is replaced by bookmarks

[/Bookmarks bar\n/g, 'Bookmarks\n'],
[/bookmarks bar\n/g, 'bookmarks\n'],
]