Hello,

i'd like Drupal to redirect English users to a page translated to English via i18n and Italian users to node/7...

i set node/7 on admin/user/logintoboggan -> Redirect path on registration:

but also my English users are redirected to node/7...

thanks!

Comments

hunmonk’s picture

Status: Active » Closed (works as designed)

not supported, you'll have to write your own module for that.

pfrenssen’s picture

Version: 6.x-1.7 » 7.x-1.x-dev
Category: support » feature
Status: Closed (works as designed) » Needs review
StatusFileSize
new1.5 KB

This is possible in D7 with the Internationalization module and an implementation of hook_variable_info(). This informs the Internationalization module that the redirection path variables are localize-able. The actual localization action is then handled transparently by the i18n_variable module.

I've attached a patch that adds this functionality to LoginToboggan.

To use it:

  1. Install the Internationalization module, and enable i18n_variable.
  2. Go to admin/config/regional/i18n/variable and select the two redirection variables "Redirect path on registration" and "Redirect path on confirmation"
  3. Go to admin/config/system/logintoboggan, and set your paths for each language. The language can be chosen at the top of the form.
hunmonk’s picture

Status: Needs review » Needs work

hook_variable_info() isn't a core hook, and i'm not keen on putting module-specific code in LT. if somebody wants to roll up this patch into a logintoboggan_variable integration module, i'd toss it into the contrib folder.

pfrenssen’s picture

This is a very good idea, it would keep the core functionality clean, and would still provide this functionality for whoever needs it. I would suggest calling this submodule logintoboggan_i18n though.

samundra’s picture

Your problem looks similar to the http://drupal.org/node/1269640#comment-4981732, I have also given piece of code that does the redirection thing. I think you can modify that to suit your need.

that was a piece of code form my custom module.

hunmonk’s picture

@pfrenssen: as far as i can tell, http://drupal.org/project/i18n leverages http://drupal.org/project/variable in order to make this work, so what we'd be building here is compatibility with that module, not i18n. that also would leave open the possibility to export other variables that other modules leveraging the variable module might be interested in.

setvik’s picture

Status: Needs work » Needs review
StatusFileSize
new597 bytes

Rolled up pfrenssen's patch in #2 as a contrib module that provides Variable module integration.

hunmonk’s picture

Status: Needs review » Postponed (maintainer needs more info)

looks good. the one thing that would be nice is to get all current, relevant LT variables exported (for a complete implementation of the bridge). i won't hold this up if nobody wants to do this, but i do at least want a yay/nay on the idea.

pfrenssen’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new6.25 KB

I've added support for the other variables. I have not tested this code so it might not work. I've basically copied all variable descriptions over from logintoboggan.admin.inc and shortened the descriptions where necessary.

hunmonk’s picture

would be great if somebody who's interested in this functionality could run some quick tests to confirm the module is working correctly.

hunmonk’s picture

Title: Redirect path on registration based on user language » Add logintoboggan_variable module to contrib
Status: Needs review » Fixed

Committed the module to contrib on 7.x-1.x-dev

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

jose reyero’s picture

Status: Closed (fixed) » Active

I've just seen this new module and wondering why do we need another module.

All these variable definitions could very well be in logintoboggan.variable.inc in the root folder, and the hook renamed to logintoboggan_variable_info().

This way we'd save one more module, and the file is only included by variable.module when needed anyway.

(Maybe I should explain this feature better somewhere in the Variable documentation?)