def copy_plugins_to_language(page, source_language, target_language, only_empty=True):
 copied = 0
 placeholders = page.get_placeholders()
 for placeholder in placeholders:
  if ((not only_empty) or (not placeholder.get_plugins(language=target_language).exists())):
   plugins = list(placeholder.get_plugins(language=source_language).order_by('path'))
   copied_plugins = copy_plugins.copy_plugins_to(plugins, placeholder, target_language)
   copied += len(copied_plugins)
 return copied

def copy_plugins_to_language ( page , source_language , target_language , only_empty = True ) : copied = 0 placeholders = page . get_placeholders ( ) for placeholder in placeholders : if ( ( not only_empty ) or ( not placeholder . get_plugins ( language = target_language ) . exists ( ) ) ) : plugins = list ( placeholder . get_plugins ( language = source_language ) . order_by ( 'path' ) ) copied_plugins = copy_plugins . copy_plugins_to ( plugins , placeholder , target_language ) copied += len ( copied_plugins ) return copied
copy the plugins to another language in the same page for all the page placeholders .