I am working on a D7 multilingual site which have many languages – english, french, dutch etc.
I am trying to redirect the user to an internal path as
drupal_goto('my-internal-path', array('query' => drupal_get_destination());
It is giving — http://www.example.com/en/my-internal-path?destination=my-current-path
Here destination parameter is working but taking language as default which is ‘en’ in my case and giving 404 as the internal path is of french language, and I want it to be ‘fr’.
So I used —
drupal_goto('my-internal-path', array('query' => drupal_get_destination(), 'language' => (object)array('language' => 'fr')));
Now, the page is redirecting properly to fr page, but the destination parameter gets removed.
The url get become —
but I want like,
I tried many different thing, but the query and language parameter are not working together in drupal_goto,
Not sure, I am trying something wrong
any solution will be helpful.