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

String replacements with 0 replacements should throw an error #475

Closed
bbondy opened this issue Jul 3, 2018 · 0 comments
Closed

String replacements with 0 replacements should throw an error #475

bbondy opened this issue Jul 3, 2018 · 0 comments

Comments

@bbondy
Copy link
Member

bbondy commented Jul 3, 2018

For the string replacement hacks we do in: lib/l10nUtil.js
We should throw an error for some of them if the expected number of replacements are not met.

Not for these:

        .replace(/The Chromium Authors/g, 'Brave Software Inc')
        .replace(/Google Chrome/g, 'Brave')
        .replace(/Chromium/g, 'Brave')
        .replace(/Chrome/g, 'Brave')
        .replace(/Google/g, 'Brave'), 'utf8'))

But for these:

 .replace(/<\?xml version="1.0" encoding="utf-8"\?>/i, '<?xml version="1.0" encoding="utf-8"?>\n' + autoGeneratedWarning)
        .replace('<structure name="IDR_MD_EXTENSIONS_SIDEBAR_HTML"', '<structure name="IDR_MD_EXTENSIONS_SIDEBAR_HTML" preprocess="true"')
        .replace('<structure name="IDR_SETTINGS_APPEARANCE_FONTS_PAGE_HTML"', '<structure name="IDR_SETTINGS_APPEARANCE_FONTS_PAGE_HTML" preprocess="true"')
        .replace('<structure name="IDR_SETTINGS_PASSWORDS_SECTION_HTML"', '<structure name="IDR_SETTINGS_PASSWORDS_SECTION_HTML" preprocess="true"')
        .replace('<include name="IDR_MD_HISTORY_SIDE_BAR_HTML"', '<include name="IDR_MD_HISTORY_SIDE_BAR_HTML" flattenhtml="true"')
        .replace(pageVisibility, bravePageVisibility + pageVisibility)
        .replace(/settings_chromium_strings.grdp/g, 'settings_brave_strings.grdp')
@bbondy bbondy added this to the Backlog milestone Jul 3, 2018
@bbondy bbondy modified the milestones: Backlog, Releasable builds Jul 26, 2018
bbondy added a commit that referenced this issue Jul 26, 2018
Fix #645
Fix #646
Fix #475

Also calls out to upload missing strings
This was referenced Jul 26, 2018
@bbondy bbondy added the QA/No label Aug 18, 2018
petemill pushed a commit to brave/brave-core that referenced this issue Jul 27, 2020
petemill pushed a commit to brave/brave-core that referenced this issue Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant