I'm using rate module for voting. When an anonymous user clicks on the voting widget, the user is redirected to a url "user/login-to-rate". I'm also using i18n for localization. The issue with both of these together is that when I'm on a page with the URL "en/my-url" and I click on the voting widget, I'm redirected to "de/user/login-to-rate" where "de" is my default language. Ideally the user should be going to "en/user/login-to-rate" i.e. user selected language should be respected.

Going into details, I find that the rate module calls url function:

print url('user/login-to-rate', array('query' => $query, 'absolute' => TRUE));

and here there is no language paramater that is passed which means the default site language gets selected.

Am I missing something here in the configuration? Has anyone faced a similar problem and can help?

Comments

jose reyero’s picture

Project: Internationalization » Rate
Version: 7.x-1.4 » 7.x-2.x-dev
Component: Compatibility » Code

That url() function should use the current language so I guess there's something wrong with either your language negotiation set up or the rate module.

Anyway, this module won't change anything about generated links, so moving to rate module.

mukesh.agarwal17’s picture

Isn't i18n module responsible for converting all the calls to url() and l() functions to language specific urls? If yes, I think I'm missing on some configuration that could have helped me. Anyways, I dont think this should be an issue with rate module.

ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Drupal 7 is EOL. Issue will be closed

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.