@@ -200,64 +200,8 @@ module.exports.rebaseBraveStringFilesOnChromiumL10nFiles = async function (path)
200
200
const removedMap = getRemovedGRDParts ( grdsWithAutoAddedGrdps )
201
201
const ops = Object . entries ( chromiumToAutoGeneratedBraveMapping ) . map ( async ( [ sourcePath , destPath ] ) => {
202
202
let contents = await new Promise ( resolve => fs . readFile ( sourcePath , 'utf8' , ( err , data ) => resolve ( data ) ) )
203
- for ( const replacement of defaultReplacements ) {
204
- contents = contents . replace ( replacement [ 0 ] , replacement [ 1 ] )
205
- }
206
- for ( const replacement of fixupReplacements ) {
207
- contents = contents . replace ( replacement [ 0 ] , replacement [ 1 ] )
208
- }
209
203
await new Promise ( resolve => fs . writeFile ( destPath , contents , 'utf8' , resolve ) )
210
204
} )
211
205
await Promise . all ( ops )
212
206
return removedMap
213
207
}
214
-
215
- // Straight-forward string replacement list.
216
- // Consider mapping chromium resource ID to a new brave resource ID
217
- // for whole-message replacements, instead of adding to this list.
218
- // TODO(petemill): Get affected message IDs and clear out the translations in transifex for re-translation.
219
- // This could be achieved with a regex like:
220
- // (?<before><message name="(?<id>[^"]*)"[^>]*>[^<]*)The Chromium Authors(?<after>[^<]*<\/message>)
221
- // Until that is implemented, when adding to or modifying this list, you must manually find the
222
- // affected source strings in transifex, and delete every language's translation via the script
223
- // 'npm run delete_string_translations -- ...'.
224
- // Otherwise, languages apart from US English will not get updated.
225
- const defaultReplacements = [
226
- [ / A u t o m a t i c a l l y s e n d u s a g e s t a t i s t i c s a n d c r a s h r e p o r t s t o G o o g l e / g, 'Automatically send crash reports to Google' ] ,
227
- [ / A u t o m a t i c a l l y s e n d s u s a g e s t a t i s t i c s a n d c r a s h r e p o r t s t o G o o g l e / g, 'Automatically sends crash reports to Google' ] ,
228
- [ / C h r o m e W e b S t o r e / g, 'Web Store' ] ,
229
- [ / T h e C h r o m i u m A u t h o r s \n / g, 'Brave Software Inc\n' ] ,
230
- [ / T h e C h r o m i u m A u t h o r s . A l l r i g h t s r e s e r v e d ./ g, 'The Brave Authors. All rights reserved.' ] ,
231
- [ / G o o g l e C h r o m e / g, 'Brave' ] ,
232
- [ / C h r o m i u m / g, 'Brave' ] ,
233
- [ / C h r o m e / g, 'Brave' ] ,
234
- [ / G o o g l e L L C . A l l r i g h t s r e s e r v e d ./ g, 'The Brave Authors. All rights reserved.' ] ,
235
- [ / ( G o o g l e ) (? ! P l a y ) / g, 'Brave' ] ,
236
- [ / Y o u ' r e i n c o g n i t o / g, 'This is a private window' ] ,
237
- [ / a n i n c o g n i t o / g, 'a private' ] ,
238
- [ / a n I n c o g n i t o / g, 'a Private' ] ,
239
- [ / i n c o g n i t o / g, 'private' ] ,
240
- [ / I n c o g n i t o / g, 'Private' ] ,
241
- [ / i n c o \& a m p \; g n i t o / g, '&private' ] ,
242
- [ / I n c o \& a m p \; g n i t o / g, '&Private' ] ,
243
- [ / P e o p l e / g, 'Profiles' ] ,
244
- // 'people' but only in the context of profiles, not humans.
245
- [ / (?< ! a u t h e n t i c a t e ) p e o p l e (? ! w i t h s l o w c o n n e c t i o n s ? ) / g, 'profiles' ] ,
246
- [ / ( P e r s o n ) (? ! \w ) / g, 'Profile' ] ,
247
- [ / ( p e r s o n ) (? ! \w ) / g, 'profile' ] ,
248
- [ / B o o k m a r k s B a r \n / g, 'Bookmarks\n' ] ,
249
- [ / B o o k m a r k s b a r \n / g, 'Bookmarks\n' ] ,
250
- [ / b o o k m a r k s b a r \n / g, 'bookmarks\n' ] ,
251
- [ / C o p y r i g h t < p h n a m e = " ( Y E A R | y e a r ) " > / g, 'Copyright © <ph name="$1">' ] ,
252
- ]
253
-
254
- // Fix up some strings after aggressive first round replacement.
255
- const fixupReplacements = [
256
- [ / B r a v e C l o u d P r i n t / g, 'Google Cloud Print' ] ,
257
- [ / B r a v e D o c s / g, 'Google Docs' ] ,
258
- [ / B r a v e D r i v e / g, 'Google Drive' ] ,
259
- [ / B r a v e O S / g, 'Chrome OS' ] ,
260
- [ / B r a v e S a f e B r o w s i n g / g, 'Google Safe Browsing' ] ,
261
- [ / S a f e B r o w s i n g \( p r o t e c t s y o u a n d y o u r d e v i c e f r o m d a n g e r o u s s i t e s \) / g, 'Google Safe Browsing \(protects you and your device from dangerous sites\)' ] ,
262
- [ / S e n d s U R L s o f s o m e p a g e s y o u v i s i t t o B r a v e / g, 'Sends URLs of some pages you visit to Google' ]
263
- ]
0 commit comments