3

I have five different regions and five different language. When loading my site url like domainname/regionname/langname .When user change the language or region url will be change selected region name or language.how can i done this drupal?

0

You can change language based on such parameters (I am not at the position to check at the moment) under /admin/config/regional/i18n

0

I've used a couple hooks in the past to rewrite all inbound/outbound URLs for Drupal 6. The Drupal 7 equivalent hooks are:

function mymodule_url_inbound_alter(&$path, $original_path, $path_language) {
  // Remove "region/language/" from beginning of $path
}

Official documentation: hook_url_inbound_alter

function mymodule_url_outbound_alter(&$path, &$options, $original_path) {
  // Prepend $path with "region/language/"
}

Official documentation: hook_url_outbound_alter

I don't recall the details of my implementation (it was several years ago), but this was the core of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.