Differences between get() and getI18n()

GaboX is completely multilingual in a transparent manner. You use it the same way for a site monolingual or multilingual

The table gen_i18n allows you to store any item translation based on the languages enabled :

CREATE TABLE `gen_i18n` ( 
`id_i18n` mediumint(8) UNSIGNED NOT NULL, 
`module` varchar(25) NOT NULL DEFAULT 'common', 
`field_name` varchar(30) NOT NULL DEFAULT 'lib', 
`id_element` mediumint(8) UNSIGNED NOT NULL, 
`id_locales` mediumint(8) UNSIGNED NOT NULL, 
`lib` mediumtext, 
`is_published` tinyint(1) NOT NULL DEFAULT '0', 
`level` tinyint(1) NOT NULL DEFAULT '1', 
`source` tinytext, 
`id_url` mediumint(8) UNSIGNED DEFAULT NULL 
) ENGINE=MyISAM DEFAULT CHARSET=utf8; 

For example, for each collector ($this->collector) you can use the data in strict content in the table of your collector or go to look for the translated version if it exists.

If no translated version is not found, then the data strict to the table of your collector you will be returned


print_r( $this->collector['product']->getOne(1) ); 

Array 
( 
[0] = Array 
( 
[id_produits] = 1 
[lib] = moisturizer for the body 
) 

[1] = Array 
( 
[id_produits] = 2 
[lib] = face Cream 
) 

) 

The translated version can be called via getOneI18n for a specific record or getI18n for multiple records


print_r( $this->collector['product']->getOneI18n(1) ); 

Array 
( 
[0] = Array 
( 
[id_produits] = 1 
[lib] = Crema hidratante para el cuerpo 
) 

[1] = Array 
( 
[id_produits] = 2 
[lib] = Crema para la cara 
) 

) 

Note that the methods get() are not cached unlike the methods getI18n.

Please do not hesitate to consult our documentation on the automatic translation.