Hi,
I’m trying to implement a multilingual solution that would
avoid manual edition of a template variable when duplicating the tree of the original language for translation.
In other words, when duplicating a whole tree to translate it, my solution would avoid step 4 of the conclusion here :
http://wiki.modxcms.com/index.php/How_to_make_Multi_Lingual_Site
It would also
permit different document titles and aliases for the miscellaneous languages.
The
basic idea is to use a TV (template variable) storing a
document id that is shared by all translations of a document.
Just before duplicating the original language documents, a PHP script would be run to set the TV value for all documents to the same value as the document id.
(For the detailed idea, see
http://modxcms.com/forums/index.php/topic,31908.msg193862.html#msg193862 )
I’ve been
trying to write the PHP script that sets the TV automatically, but for some reason it is not creating the necessary records in table dbprefix_site_templvar_contentvalues . The script is here :
http://modxcms.com/forums/index.php/topic,31908.msg194010.html#msg194010
Warning : For security, backup your database before running my script.
My solution would be multilingual (not just bilingual as the discussion thread tells).
Can someone help finding what’s wrong with the script ? Thanks.