def po_to_csv_merge(languages, locale_root, po_files_path,<EOL>local_trans_csv, local_meta_csv,<EOL>gdocs_trans_csv, gdocs_meta_csv):
msgids = []<EOL>trans_reader = UnicodeReader(gdocs_trans_csv)<EOL>meta_reader = UnicodeReader(gdocs_meta_csv)<EOL>try:<EOL><INDENT>trans_title = trans_reader.next()<EOL>meta_title = meta_reader.next()<EOL><DEDENT>except StopIteration:<EOL><INDENT>trans_title = ['<STR_LIT:file>', '<STR_LIT>', '<STR_LIT>']<EOL>trans_title += map(lambda s: s + '<STR_LIT>', languages)<EOL>meta_title = ['<STR_LIT>']<EOL><DEDENT>trans_writer, meta_writer = _get_new_csv_writers(<EOL>trans_title, meta_title, local_trans_csv, local_meta_csv)<EOL>for trans_row, meta_row in izip_longest(trans_reader, meta_reader):<EOL><INDENT>msgids.append(trans_row[<NUM_LIT:2>])<EOL>trans_writer.writerow(trans_row)<EOL>meta_writer.writerow(meta_row if meta_row else [METADATA_EMPTY])<EOL><DEDENT>trans_reader.close()<EOL>meta_reader.close()<EOL>po_files = _get_all_po_filenames(locale_root, languages[<NUM_LIT:0>], po_files_path)<EOL>new_trans = False<EOL>for po_filename in po_files:<EOL><INDENT>new_msgstrs = {}<EOL>for lang in languages[<NUM_LIT:1>:]:<EOL><INDENT>po_file_path = os.path.join(locale_root, lang,<EOL>po_files_path, po_filename)<EOL>if not os.path.exists(po_file_path):<EOL><INDENT>open(po_file_path, '<STR_LIT:a>').close()<EOL><DEDENT>new_msgstrs[lang] = _get_new_msgstrs(po_file_path, msgids)<EOL><DEDENT>if len(new_msgstrs[languages[<NUM_LIT:1>]].keys()) > <NUM_LIT:0>:<EOL><INDENT>new_trans = True<EOL>po_file_path = os.path.join(locale_root, languages[<NUM_LIT:0>],<EOL>po_files_path, po_filename)<EOL>_write_new_messages(po_file_path, trans_writer, meta_writer,<EOL>msgids, new_msgstrs, languages)<EOL><DEDENT><DEDENT>trans_writer.close()<EOL>meta_writer.close()<EOL>return new_trans<EOL>
Converts po file to csv GDocs spreadsheet readable format.
Merges them if some msgid aren't in the spreadsheet.
:param languages: list of language codes
:param locale_root: path to locale root folder containing directories
                    with languages
:param po_files_path: path from lang directory to po file
:param local_trans_csv: path where local csv with translations
                        will be created
:param local_meta_csv: path where local csv with metadata will be created
:param gdocs_trans_csv: path to gdoc csv with translations