let string_of_mo_informations ?(compute_plurals=(0,3)) mo_translation =
let buff = Buffer.create 1024
in
let p = Printf.bprintf
in
let extract_string x =
match x with
Some s -> s
| None -> ""
in
p buff "Project-Id-Version : %s\n" (extract_string mo_translation.project_id_version);
p buff "Report-Msgid-Bugs-To : %s\n" (extract_string mo_translation.report_msgid_bugs_to);
p buff "POT-Creation-Date : %s\n" (extract_string mo_translation.pot_creation_date);
p buff "PO-Revision-Date : %s\n" (extract_string mo_translation.po_revision_date);
p buff "Last-Translator : %s\n" (extract_string mo_translation.last_translator);
p buff "Language-Team : %s\n" (extract_string mo_translation.language_tream);
p buff "MIME-Version : %s\n" (extract_string mo_translation.mime_version);
p buff "Content-Type : %s\n" (extract_string mo_translation.content_type);
p buff "Plurals-Forms : %s\n" (extract_string mo_translation.plural_forms);
p buff "Content-Transfer-Encoding : %s\n" (extract_string mo_translation.content_transfer_encoding);
p buff "Content-Type-Charset : %s\n" mo_translation.content_type_charset;
p buff "NPlurals : %d\n" mo_translation.nplurals;
p buff "Fun plural : ";
(
let (a,b) = compute_plurals
in
for i = a to b do
p buff "%d -> %d ; " i (mo_translation.fun_plural_forms i);
done;
);
p buff "\n";
Buffer.contents buff