From: Peter Lemenkov Date: Thu, 19 May 2016 19:10:47 +0300 Subject: [PATCH] No such function exported gettext_compile:fmt_fileinfo/1 Signed-off-by: Peter Lemenkov diff --git a/src/i18n/po_generator.erl b/src/i18n/po_generator.erl index 0fa61f5..2ad9ccc 100644 --- a/src/i18n/po_generator.erl +++ b/src/i18n/po_generator.erl @@ -31,10 +31,19 @@ generate_file(Lang,Items, Fuzzy) -> %% %% Local Functions %% + +to_list(A) when is_atom(A) -> atom_to_list(A); +to_list(I) when is_integer(I) -> integer_to_list(I); +to_list(B) when is_binary(B) -> binary_to_list(B); +to_list(L) when is_list(L) -> L. + write_entries(Items)-> Fd = get(fd), F = fun({Id,Translation,Finfo}) -> - Fi = gettext_compile:fmt_fileinfo(Finfo), + Fun = fun({Fname,LineNo}, Acc) -> + Fname ++ ":" ++ to_list(LineNo) ++ [$\s|Acc] + end, + Fi = lists:foldr(Fun,[],Finfo), io:format(Fd, "~n#: ~s~n", [Fi]), ok = file:write(Fd, "msgid \"\"\n"), gettext_compile:write_pretty(Id, Fd),