diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-15 17:07:01 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-15 17:07:01 +0000 |
commit | e969a4d57c50899544bb7c508180e02bd681bca5 (patch) | |
tree | 6b46d3aab0e14f982a2389726189596f4075a01b /perl_checker.src/parser_helper.ml | |
parent | 9078ded56fc608344a48437878686764056e2bca (diff) | |
download | perl-MDK-Common-e969a4d57c50899544bb7c508180e02bd681bca5.tar perl-MDK-Common-e969a4d57c50899544bb7c508180e02bd681bca5.tar.gz perl-MDK-Common-e969a4d57c50899544bb7c508180e02bd681bca5.tar.bz2 perl-MDK-Common-e969a4d57c50899544bb7c508180e02bd681bca5.tar.xz perl-MDK-Common-e969a4d57c50899544bb7c508180e02bd681bca5.zip |
perl_checker: when generating pot, add an header and fake line numbers to please msgmerge
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 19ee2da..d04e79f 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -493,7 +493,26 @@ let check_format_a_la_printf s pos = in check_format_a_la_printf_ 0 let generate_pot file = - let fd = open_out file in + let fd = open_out file in + output_string fd +"# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid \"\" +msgstr \"\" +\"Project-Id-Version: PACKAGE VERSION\\n\" +\"POT-Creation-Date: 2002-12-05 19:52+0100\\n\" +\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\" +\"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n\" +\"Language-Team: LANGUAGE <LL@li.org>\\n\" +\"MIME-Version: 1.0\\n\" +\"Content-Type: text/plain; charset=CHARSET\\n\" +\"Content-Transfer-Encoding: 8-bit\\n\" + +" ; + let rec print_formatted_char = function | '"' -> output_char fd '\\'; output_char fd '"' | '\t' -> output_char fd '\\'; output_char fd 't' @@ -508,7 +527,7 @@ let generate_pot file = List.iter (fun po_comment -> output_string fd ("#. " ^ po_comment ^ "\n")) po_comments; List.iter (fun _ -> Hashtbl.remove pot_strings_and_file s) l ; - fprintf fd "#: %s\n" (String.concat " " l) ; + fprintf fd "#: %s\n" (String.concat " " (List.map (fun s -> s ^ ":1") l)) ; output_string fd "#, c-format\n" ; output_string fd (if String.contains s '\n' then "msgid \"\"\n\"" else "msgid \"") ; |