Hi,

I couldn't find the answer by searchin d.o or google but maybe there is an easy answer that anyone knows of here. My features contain t strings and I would like to include in my features several translation files for those strings.

How can I include .po files in my features?

Thanks in advance!

Comments

pvanerk’s picture

Hi,

Did you already figure out how to do it? Would like to know how you fixed it.

The following post says how to include translations for modules but couldn't get it working for features though.

http://drupal.org/node/220341

pmunch’s picture

According to this post : http://drupal.org/node/782286#comment-3529126, basic pb seems to be that Features does not invoke locale update hook.

As patching Features module was not an option for me, I had the following workaround :

Create a my_feature_i18n submodule, containing :

  • translations : subdir containing po files
  • my_feature_i18n.info: regular info file, no dependencies
  • my_feature_i18n.module: empty file
  • my_feature_i18n.install: file with the code below
function my_feature_i18n_install() {
	module_invoke('locale', 'system_update', array("my_feature_i18n"));
}

Then just activate module to have po files imported (didn't try, but it should work even without the install file).

@Maintainers: It would be much appreciated if the patch mentionned above (or any other solution that fixes the issue) should be applied to the next release (afaik not in the current dev version yet). Thanks !