Hi
I've successfully integrated the differents mods and patch, i18nnodeimport module and finally I see the language field in nodes import.
But I dont see it when importing taxonomy terms.
Is there some workaround, or maybe it needs some new code, maybe in 18nnodeimport module ?
Any help welcome

Comments

artatum’s picture

Title: No language field in taxonomy import process » No language field in taxonomy terms import process

I've first tried to add this:

$fields['language']['title'] = t('Language');
	$fields['language']['is_required'] = FALSE;
	$fields['language']['has_multiple'] = FALSE;
	$fields['language']['default_value'] = 'en';
	$fields['language']['module'] = 'i18n';
  $fields['language']['allowed_values'] = i18n_language_list();

in taxonomy.inc line 260
It worked pretty well.
The last step was to add

	$fields['trid']['title'] = t('Translation Taxonomy Source ID');
	$fields['trid']['is_required'] = FALSE;
	$fields['trid']['has_multiple'] = FALSE;
	$fields['trid']['module'] = 'i18n';

to get and set trid in term_data.
But mysteriuously if the previous field language worked, trid didnt. Whatever I tried, I couldn't set this field.
I'm a beginner in code, and would really appreciate some helping hand.

artatum’s picture

Well, after 1 week of struggle, I succeeded to import taxonomy with languages in sql.
If someone know how you can say this in Drupal :

CREATE TRIGGER  after_term_data_delete
     AFTER DELETE ON term_data
	 FOR EACH ROW
           DELETE from term_hierarchy WHERE tid = OLD.tid;
		   
delete  from term_data where vid = 9;
 CREATE TRIGGER  after_term_data_insert
     AFTER insert ON term_data
     FOR EACH ROW
       insert into term_hierarchy ( tid, parent) VALUES ( new.tid, 0);
    
INSERT INTO `term_data` ( `vid`, `name`, `description`, `weight`, `language`, `trid`) VALUES


(9, 'Fromage Gouda', '', 0, 'fr', 1),
(9, 'Gouda cheese', '', 0, 'en', 1),
(9, 'Gouda-Käse', '', 0, 'de', 1),
(9, 'Gouda peyniri', '', 0, 'tr', 1),
(9, 'Formaggio Gouda', '', 0, 'it', 1),
(9, 'Queso Gouda', '', 0, 'es', 1),
(9, 'Queijo Gouda', '', 0, 'pt-pt', 1),
(9, 'ゴウダチーズ', 'Gouda', 0, 'ja', 1),
(9, '豪达奶酪', 'Gouda', 0, 'zh-hans', 1),
(9, 'Gouda पनीर', 'Gouda', 0, 'hi', 1),
(9, 'جودة الجبن', 'Gouda', 0, 'ar', 1),

(9, 'Fromage Reblochon', '', 0, 'fr', 2),
(9, 'Reblochon cheese', '', 0, 'en', 2),
(9, 'Reblochon', '', 0, 'de', 2),
(9, 'Reblochon peynir', '', 0, 'tr', 2),
(9, 'Reblochon formaggio', '', 0, 'it', 2),
(9, 'Queso Reblochon', '', 0, 'es', 2),
(9, 'Queijo Reblochon', '', 0, 'pt-pt', 2),
(9, 'ルブロションチーズ', 'Reblochon', 0, 'ja', 2),
(9, 'Reblochon奶酪', 'Reblochon', 0, 'zh-hans', 2),
(9, 'Reblochon पनीर', 'Reblochon', 0, 'hi', 2),
(9, 'Reblochon الجبن', 'Reblochon', 0, 'ar', 2),
;
DROP TRIGGER after_term_data_insert;
DROP TRIGGER after_term_data_delete;

... I'd be glad to know how;-)

avpaderno’s picture

Version: 6.x-1.1 » 6.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)
Issue tags: -language 18nnodeimport taxonomy terms

I am closing this issue, as it has been open for a version no longer supported. The project doesn't have versions for supported Drupal releases.