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