diff --git a/ChangeLog b/ChangeLog index 8a3b0c38b..e283e15f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-19 Pablo Polvorin + + * src/translate.erl: Bugfix, ?MYLANG macro returns a list(). + 2009-01-19 Jean-Sébastien Pédron Merge from trunk (r1752 to r1787). diff --git a/src/translate.erl b/src/translate.erl index df76d145e..f54fe6f86 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -105,6 +105,7 @@ load_file(Lang, File) -> end. translate(Lang, Msg) -> + io:format("translate(~p, ~p) ~n",[Lang, Msg]), LLang = ascii_tolower(Lang), case ets:lookup(translations, {LLang, Msg}) of [{_, Trans}] -> @@ -132,13 +133,15 @@ translate(Lang, Msg) -> end. translate(Msg) -> + %%TODO: ?MYLANG macro returns lang as a list(). Lang should be a binary. case ?MYLANG of undefined -> Msg; - <<"en">> -> + "en" -> Msg; Lang -> - LLang = ascii_tolower(Lang), + BLang = list_to_binary(Lang), + LLang = ascii_tolower(BLang), case ets:lookup(translations, {LLang, Msg}) of [{_, Trans}] -> Trans; @@ -152,7 +155,7 @@ translate(Msg) -> case ShortLang of <<"en">> -> Msg; - Lang -> + BLang -> Msg; _ -> case ets:lookup(translations, {ShortLang, Msg}) of