Skip to content

Commit

Permalink
Make language dependent URL rewriting configurable. Fixes zotonic#315
Browse files Browse the repository at this point in the history
  • Loading branch information
mmzeeman committed May 16, 2012
1 parent dabf2d1 commit 0db7f49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/mod_translation/mod_translation.erl
Expand Up @@ -142,7 +142,8 @@ observe_set_user_language(#set_user_language{}, Context, _Context) ->
observe_url_rewrite(#url_rewrite{args=Args}, Url, Context) ->
case lists:keyfind(z_language, 1, Args) of
false ->
case is_multiple_languages_config(Context) of
RewriteUrl = z_convert:to_bool(m_config:get_value(?MODULE, rewrite_url, true, Context)),
case RewriteUrl and is_multiple_languages_config(Context) of
true ->
% Insert the current language in front of the url
iolist_to_binary([$/, atom_to_list(z_context:language(Context)), Url]);
Expand Down

0 comments on commit 0db7f49

Please sign in to comment.