parameters: (extension_name, locales_src_dir_path, config, staging_dir, g_archive_inputs)
docstring: Copies extension localization files from locales_src_dir_path to
      \\<out_gen_dir>\\chrome\\installer\\mini_installer\\mini_installer\\temp_installer_archive
          \\Chrome-bin\\<version>\\resources\\extension_name\\_locales
docstring_summary: Copies extension localization files from locales_src_dir_path to
      \\<out_gen_dir>\\chrome\\installer\\mini_installer\\mini_installer\\temp_installer_archive
          \\Chrome-bin\\<version>\\resources\\extension_name\\_locales
docstring_tokens: Copies extension localization files from locales_src_dir_path to \\ <out_gen_dir > \\ chrome \\ installer \\ mini_installer \\ mini_installer \\ temp_installer_archive \\ Chrome - bin \\ <version > \\ resources \\ extension_name \\ _locales
function: def CopyExtensionLocalization(extension_name, locales_src_dir_path, config, staging_dir, g_archive_inputs):
      """Copies extension localization files from locales_src_dir_path to
      \\<out_gen_dir>\\chrome\\installer\\mini_installer\\mini_installer\\temp_installer_archive
          \\Chrome-bin\\<version>\\resources\\extension_name\\_locales
      """
      locales_dest_path = staging_dir
      locales_dest_path = os.path.join(locales_dest_path, config.get('GENERAL', 'brave_resources.pak'),
                                       'resources', extension_name, '_locales')
      locales_dest_path = os.path.realpath(locales_dest_path)
      try:
          shutil.rmtree(locales_dest_path)
      except Exception as e:
          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', extension_name, '_locales', rel_file)
              g_archive_inputs.append(candidate)
function_tokens: def CopyExtensionLocalization ( extension_name , locales_src_dir_path , config , staging_dir , g_archive_inputs ) : locales_dest_path = staging_dir locales_dest_path = os . path . join ( locales_dest_path , config . get ( 'GENERAL' , 'brave_resources.pak' ) , 'resources' , extension_name , '_locales' ) locales_dest_path = os . path . realpath ( locales_dest_path ) try : shutil . rmtree ( locales_dest_path ) except Exception as e : 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' , extension_name , '_locales' , rel_file ) g_archive_inputs . append ( candidate )