let merge filename_pot filename_po_lst backup_extension =
let pot =
po_of_filename filename_pot
in
let merge_one filename_po =
let po =
po_of_filename filename_po
in
let po_merged =
GettextPo.merge_pot pot po
in
let _ =
(* BUG: should use add_extension *)
(* BUG: should use mv *)
Sys.rename filename_po (filename_po^"."^backup_extension)
in
let chn =
open_out filename_po
in
GettextPo.output_po chn po_merged;
close_out chn
in
List.iter merge_one filename_po_lst