diff --git a/src/gettext.erl b/src/gettext.erl index ba2b562..3b5b6e7 100644 --- a/src/gettext.erl +++ b/src/gettext.erl @@ -64,10 +64,10 @@ recreate_db(Server) -> %%-------------------------------------------------------------------- -store_pofile(Lang, File) when binary(File) -> +store_pofile(Lang, File) when is_binary(File) -> store_pofile(?DEFAULT_SERVER, Lang, File). -store_pofile(Server, Lang, File) when binary(File) -> +store_pofile(Server, Lang, File) when is_binary(File) -> gen_server:call(Server, {store_pofile, Lang, File}, infinity). %%-------------------------------------------------------------------- @@ -153,10 +153,10 @@ eat_more([$"|T], Acc) -> eat_string(T, Acc); eat_more(T, Acc) -> {lists:reverse(Acc), T}. -to_list(A) when atom(A) -> atom_to_list(A); -to_list(I) when integer(I) -> integer_to_list(I); -to_list(B) when binary(B) -> binary_to_list(B); -to_list(L) when list(L) -> L. +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. %%% -------------------------------------------------------------------- diff --git a/src/gettext_compile.erl b/src/gettext_compile.erl index 629328f..001e502 100644 --- a/src/gettext_compile.erl +++ b/src/gettext_compile.erl @@ -201,7 +201,7 @@ pt(Form, Opts) -> put(fname, ""), pt(Form, Opts, undefined). -pt([H|T],Opts,Func) when list(H) -> +pt([H|T],Opts,Func) when is_list(H) -> ?debug( "--- 1 --- ~p~n",[H]), F = fun (X) -> pt(X,Opts,Func) end, [lists:map(F,H)|pt(T,Opts,Func)]; @@ -237,7 +237,7 @@ pt([{block,N,B}|T], Opts, Func) -> Block = {block,N,pt(B,Opts,Func)}, [Block|pt(T, Opts, Func)]; %%% -pt([H|T], Opts, Func) when tuple(H) -> +pt([H|T], Opts, Func) when is_tuple(H) -> ?debug( "--- 3 --- ~p~n",[H]), [while(size(H), H, Opts, Func) | pt(T, Opts, Func)]; %%% @@ -245,7 +245,7 @@ pt([H|T], Opts, Func) -> ?debug( "--- 4 --- ~p~n",[H]), [H | pt(T, Opts, Func)]; %%% -pt(T, Opts, Func) when tuple(T) -> +pt(T, Opts, Func) when is_tuple(T) -> ?debug( "--- 5 --- ~p~n",[T]), while(size(T), T, Opts, Func); %%% @@ -305,10 +305,10 @@ open_po_file(Gettext_App_Name, GtxtDir, DefLang) -> close_file() -> file:close(get(fd)). -to_list(A) when atom(A) -> atom_to_list(A); -to_list(I) when integer(I) -> integer_to_list(I); -to_list(B) when binary(B) -> binary_to_list(B); -to_list(L) when list(L) -> L. +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. diff --git a/src/gettext_server.erl b/src/gettext_server.erl index b674e14..df3267c 100644 --- a/src/gettext_server.erl +++ b/src/gettext_server.erl @@ -120,7 +120,7 @@ get_gettext_dir(CallBackMod) -> case os:getenv("GETTEXT_DIR") of false -> case catch CallBackMod:gettext_dir() of - Dir when list(Dir) -> Dir; + Dir when is_list(Dir) -> Dir; _ -> code:priv_dir(gettext) % fallback end; Dir -> Dir