Skip to content

Commit

Permalink
Windows extension localization changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyBarabash authored and bbondy committed Mar 22, 2018
1 parent 0c9c2b8 commit 4243ca1
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions patches/chrome-tools-build-win-create_installer_archive.py.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
diff --git a/chrome/tools/build/win/create_installer_archive.py b/chrome/tools/build/win/create_installer_archive.py
index 51c91715d0fc03bd352a498405f13cf45b141b2c..ae29f6258b70972d5cf611353d4c9cf2688e96db 100755
index 51c91715d0fc03bd352a498405f13cf45b141b2c..4fc84f0978a4188669d29697c64c64ae7b753000 100755
--- a/chrome/tools/build/win/create_installer_archive.py
+++ b/chrome/tools/build/win/create_installer_archive.py
@@ -565,6 +565,9 @@ def main(options):
@@ -109,6 +109,33 @@ def CopyAllFilesToStagingDir(config, distribution, staging_dir, build_dir,
if enable_hidpi == '1':
CopySectionFilesToStagingDir(config, 'HIDPI', staging_dir, build_dir)

+ CopyBraveExtensionLocalization(config, staging_dir)
+
+def CopyBraveExtensionLocalization(config, staging_dir):
+ """Copies extension localization files from
+ \\brave\vendor\brave-extension\app\_locales to
+ \\<out_gen_dir>\chrome\installer\mini_installer\mini_installer\temp_installer_archive\Chrome-bin\<version>\resources\brave_extension\_locales
+ """
+ brave_extension_dir = os.path.realpath(os.path.dirname(os.path.realpath(__file__)) )
+ brave_extension_dir = os.path.realpath(os.path.join(brave_extension_dir,
+ os.pardir, os.pardir, os.pardir, os.pardir, 'brave', 'vendor', 'brave-extension'))
+ locales_src_dir_path = os.path.join(brave_extension_dir, 'app', '_locales')
+ locales_dest_path = staging_dir
+ locales_dest_path = os.path.join(locales_dest_path, config.get('GENERAL', 'brave_resources.pak'),
+ 'resources', 'brave_extension', '_locales')
+ locales_dest_path = os.path.realpath(locales_dest_path)
+ try:
+ shutil.rmtree(locales_dest_path)
+ except:
+ pass
+ shutil.copytree(locales_src_dir_path, locales_dest_path)
+ # Files are copied, but we need to inform g_archive_inputs about that
+ for root, dirs, files in os.walk(locales_dest_path):
+ for name in files:
+ rel_dir = os.path.relpath(root, locales_dest_path)
+ rel_file = os.path.join(rel_dir, name)
+ candidate = os.path.join('.', 'resources', 'brave_extension' '_locales', rel_file)
+ g_archive_inputs.append(candidate)

def CopySectionFilesToStagingDir(config, section, staging_dir, src_dir):
"""Copies installer archive files specified in section from src_dir to
@@ -565,6 +592,9 @@ def main(options):
version_numbers = prev_version.split('.')
prev_build_number = version_numbers[2] + '.' + version_numbers[3]

Expand Down

0 comments on commit 4243ca1

Please sign in to comment.