Closed (won't fix)
Project:
Internationalization
Version:
6.x-1.1
Component:
Blocks
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2009 at 13:17 UTC
Updated:
19 Sep 2011 at 15:52 UTC
i18nsync says that now we can add more sync fields by adding appropriate strings to settings.php:
// Available fields for synchronization, for all node types.
$conf['i18nsync_fields_node'] = array(
'field1' => t('Field 1 name'),
'field2' => t('Field 2 name'),
...
); I wonder if this trick can be used to synchronize node URL's across translations, so that all translations would just inherit the original node's path alias, and the URL's would differ only with their language prefixes?
Thank you!
Comments
Comment #1
lightnin commentedHow I long for this feature! Perhaps it could be done with pathauto, using a token that reference's the original untranslated node's path?
subscribe...
Comment #2
GN commentedsee http://drupal.org/node/533254#comment-2472244 by fm_jay
He suggests using in tokenSTARTER
I have just tested it.
It seems to work – but, as I actually expected, it requires reopening and resaving nodes after translation:
when you create an original node and save it, first you get [tnid]=0; then, if you open it and save again, you get [tnid]=nid;
and when you create a translation and save it for the first time, [tnid]=0 – you need to open and save it again with an automatic URL alias to get [tnid]=tnid.
Update:
dereine suggests using the following code:
It works better - now [tnid] is first set to nid instead of 0, so that we need to reopen and resave only the translation to get [tnid]=tnid instead of the second nid.
Comment #3
lightnin commentedInteresting! Thanks for the help. Where exactly should I put this code? In settings.php, like so?
// Available fields for synchronization, for all node types.
$conf['i18nsync_fields_node'] = array(
$values['tnid'] = $object->tnid ? $object->tnid : $object->nid
);
Upon testing this, I receive this message when saving the translated nod:
warning: unlink(sites/default/files/languages/fr_1ee30e38f785a8bf1f624a323a678680.js) [function.unlink]: Permission denied in /usr/share/drupal6/includes/file.inc on line 435.
Comment #4
jose reyero commentedNo patch so far. And no new features for 6.x