Multilingual site - i18n+i18nviews+Metatag+metatag_views. Language as suffix(site.com/en).

Internationalization: i18n.module
------------------------------------------------------------------------------
All default configurations may be translated using the Internationalization
(i18n) module. The custom strings that are assigned to e.g. the "Global: Front
page" configuration will show up in the Translate Interface admin page
(admin/config/regional/translate/translate) and may be customized per language.
---------------------------------------------------------------------------------
This work only for default configuration from Metatag group, but for tags in custom views I can't translate meta tags through translate interface.

Also I can't add translation through path tab - multiligual path's not supported :(.

How to resolve this problems?

Files: 
CommentFileSizeAuthor
#19 metatag-panels-i18n-1986032.patch2.83 KBPlacinta
#16 metatag-1986032-7.patch1.03 KBTharna
#15 metatag_views-translate-description.patch698 bytesstijndmd
#6 metatag-1986032-6.patch2.01 KByang_yi_cn
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#5 metatag-1986032-5.patch4.09 KByang_yi_cn
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#4 metatag-1986032-4.patch1.98 KByang_yi_cn
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-4.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Title:Meta tags attached to custom views aren't translated, i18ni18n support for Metatag submodules (Views, Contrib, Panels)
Issue tags:+D7 stable release blocker

Clarifying the title. This needs to be fixed for the final 1.0 release.

strings in Metatag: Context are also not translatable.

Title:i18n support for Metatag submodules (Views, Contrib, Panels)i18n support for Metatag submodules (Views, Context, Panels)

Doh, wrote the wrong word.

StatusFileSize
new1.98 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-4.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

created a patch for the metatag_context module (note that I made the patch on metatag module level).

This patch adds the i18n_string_update() part in add/edit admin forms of the Metatag Context module to allow translations, and pulls the translated value when display.

StatusFileSize
new4.09 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

after some thoughts I think it's better to have the "context" part in the i18n text string name to avoid namespace conflicts with other metatag modules.

<?php
$name
= 'metatag:context:' . $context->name . ':' . $key;
?>

Patch re-rolled.

StatusFileSize
new2.01 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch metatag-1986032-6.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

sorry, the previous patch included some unnecessary stuff related to entity_translation.

Use this one instead.

#6 Thanks yang_yi_cn, patch is working fine for me.

Status:Active» Needs review

Status:Needs review» Needs work

The last submitted patch, metatag-1986032-6.patch, failed testing.

This patch only fixes Metatag: Context, and not Metatag: Panels or Metatag: Views yet.
It's a good start, but if you're trying out the patch, it's something to be aware of.

Component:Code» Multilingual/intl

Patch in #6 failed for me. I think it is important to have Metatag play nice together with transleted contexts. At the moment i can not translate the Metatags for any View.

Hi,
I have similar issue but i needed panels. As metatag panels module is almost ready to implement the translation I added jus a few more lines to get the strings to appear in the translation interface :

changed metatag_panels_form_submit as :

function metatag_panels_form_submit($form, $form_state) {
  $conf = array(
    'enabled' => $form_state['values']['metatags_enabled'],
    'metatags' => $form_state['values']['metatags'],
  );
  $form_state['handler']->conf['metatag_panels'] = $conf;
  if ($conf['enabled']) {
    $handler = $form_state['handler'];
    $instance = 'panels:' . $handler->task . ':' . $handler->subtask . ':' . $handler->name;
    foreach ($conf['metatags'] as $field => $item) {
      $name = "metatag:" . $instance . ":" . $field;
      i18n_string_update($name, $item['value']);
    }
  }
}

and then in metatag_panels_ctools_render_alter i had to change
$instance = 'panels:' . $handler->name;
to
$instance = 'panels:' . $handler->task . ':' . $handler->subtask . ':' . $handler->name;
as handler->task and handler->subtask give a bit more information where that text come from in the translation inteface.

handler->name is unique so even if stick to default of $instance = 'panels:' . $handler->name; it will be cool .

This has its issues as deleting page/variant will not remove the strings , can't refresh the strings from the administration and so on .
Maybe we could implement something as i18n_panels module does (with the panels uuid patch and ctools-uuis_for_exported_object patch) though they rely on uuid as key but as said the $handler->name is unique and adding task and subtask provide enough meaningful information so when translation the text to have proper information where this text is actually used.

Kind Regards,
Dobromir

StatusFileSize
new698 bytes

Considering Metatag Views:
Since the only one of the defaults here that isn't translatable is the description, here is kind of an unclean quick fix to make your view description translatable.
I know it's far from ideal, this fix, but if you're also in a hurry and need this now...

StatusFileSize
new1.03 KB

Made this into a patch with a small change of requiring this patch to fix some notices.

Issue summary:View changes
StatusFileSize
new1.39 KB

Attaching patch with changes proposed in #14, for Panels i18n.

StatusFileSize
new2.82 KB

Attaching modified patch for panels i18n, that:
1) Checks for existence of i18n_string before trying to update the translation strings.
2) Removes the updated strings if the display / handler / variant is removed.

StatusFileSize
new2.83 KB

Hiding old patches.
Attaching new patch that uses function_exists to check for i18n_string, to be more in correspondence with the code used throughout the module.

#6 patch for metatag_context works good with metatag 7.x-1.0-beta9.