The Features module adds support for taxonomy by itself. But that doesn't include the "Multilanguage options" setting added by the "Taxonomy translation" (i18n_taxonomy) sub module.

Although the multilanguage options form field value of "i18n_mode" is saved to a feature module by the internal taxonomy support of Features, there is a chance that rebuilding the feature does not work, especially using drush and installation profiles. Reason is, that it depends whether i18n_taxonomy has been enabled before the feature module is loaded to the database cache. If the two modules have not been enabled in that order, there will be no error message, but the "Multilanguage options" setting (i18n_mode) has not been rebuilt from the feature module and is left with the default value. In my tests I had it both ways, regarding on total number and type of enabled modules.

To have the modules enabled in correct order all the time when rebuilding features, a module dependency to the i18n_taxonomy module has to be placed into the feature module whenever a "taxonomy" component is part of that feature module.

This can be achieved by using the Features hook - hook_features_pipe_COMPONENT_alter() within the i18n_taxonomy module. The hook ist only invoked when features and i18n_taxonomy are enabled and a "taxonomy" component has been added to the feature. The hook then just adds the module dependency to i18n_taxonomy into the feature module. In the Features admin form you then see this as an auto dependency to "Taxonomy translation".

I havn't checked the other Internationalization sub modules for their cooperation with Features, so there may more depenencies or helper code be necessary to have a complete Features integration for i18n.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

meichr’s picture

Title: Add support for features to Taxonomy translation sub module » Add Features support to Taxonomy translation sub module
meichr’s picture

Status: Active » Needs review
FileSize
948 bytes

Here is a patch which adds the Features hook adding the missing dependency. Please review the patch.

Jose Reyero’s picture

Status: Needs review » Needs work

Just adding the dependency without checking whether there's actually some multilingual data there doesn't make too much sense to me. (?)

vbouchet’s picture

It seems it also removing other dependencies.

My features has multiple modules dependencies in .info, adding this patch add the missing i18n taxonomy dependency but also remove other dependencies.

vbouchet’s picture

Status: Needs work » Needs review
FileSize
857 bytes

Please find a patch which adds i18n_vocabulary as a dependency if any exported vocabulary has a non-default i18n_mode.