0

I have a Multilingual Drupal 7 site using i18.

But how do I get my homepage meta Title and description translated?

0

To solve your query. You need to create a custom module with using Token & Variable module.

I am refer you to this LINK. Hope you can solve by using this link.

OR

Use Translation Table module.

UI for quick translation of taxonomies and menus. The i18n module allows for translation of taxonomy terms and menu items, but the process is tedious - you need to look up strings you want to translate, there is no overview of what's already translated etc.

  • Goto admin/config/regional/translate/translate
  • then filter by metatag and it will show all the metatags that you can translate.
  • i enabled Translation table module. But when i go to admin/config/regional/translate/translate and filter by Metatag, i don't see any results listed? – Meez Jun 24 '15 at 16:13
  • Have you check that LINK which I have mentioned ? – Nishant Jun 25 '15 at 4:35
0

You can use hook_metatag_metatags_view_alter

/**
 * Implements hook_metatag_metatags_view_alter().
 */
 function mymodule_metatag_metatags_view_alter(&$output, $instance, $options) {
   if (drupal_is_front_page()) {
     $output['title']['#attached']['metatag_set_preprocess_variable'][0][2] = t($output['title']['#attached']['metatag_set_preprocess_variable'][0][2]);
     $output['description']['#attached']['drupal_add_html_head'][0][0]['#value'] = t($output['description']['#attached']['drupal_add_html_head'][0][0]['#value']);
   }
 }
0

My solution was to install and enable the Translation table module. Then follow these steps

1.Go to admin/config/regional/translate/translate.

2.Then filter by metatag and it will show all the metatags that you can translate. enter image description here

  • i enabled Translation table module. But when i go to admin/config/regional/translate/translate and filter by Metatag, i don't see any results? – Meez Jun 24 '15 at 12:48
0

You need to install the variable translation module.

The Variable translation module, part of the Internationalization (i18n) package, allows you to translate text and settings that are stored in Drupal as variables. These variables include text such as 'site name' and 'site slogan', as well as settings like 'Default front page' and 'Default 404 page'.

Go to

admin/config/regional/i18n/variable

and select the variables you would like to translate. Then translate the string(s) at

admin/config/system/site-information

  • i have that one installed. I use also Metatag module and set Global: Front page meta settings. But how do i translate those meta settings? – Meez Jun 24 '15 at 10:56
  • @samiksha.gupta008 (one who suggested edit): repeating the same link twice serves no purpose. If anything, link to i18n project page was missing. And i18n is short name, not code, so using code block made no sense. – Mołot Jun 24 '15 at 12:04
  • @Meez please check the updated answer :) – Potney Switters Jun 24 '15 at 13:53
  • @Potney Switters regarding your updated answer i have in admin/config/system/site-information > E.g. Sitename for all 3 languages different values... But my Title and description is controlled with Metatag module? – Meez Jun 24 '15 at 16:14

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.