mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
translate.erl: Bugfix, ?MYLANG macro returns a list().
SVN Revision: 1828
This commit is contained in:
parent
25009ff9f4
commit
e2ee44617c
@ -1,3 +1,7 @@
|
||||
2009-01-19 Pablo Polvorin <pablo.polvorin@process-one.net>
|
||||
|
||||
* src/translate.erl: Bugfix, ?MYLANG macro returns a list().
|
||||
|
||||
2009-01-19 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
|
||||
|
||||
Merge from trunk (r1752 to r1787).
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user