Hi, I need to make the title translatable in code, specifically in a hook_update_n() function in my site deployment module. I'm trying to get information on the best way to accomplish this, thanks!
Hi, I need to make the title translatable in code, specifically in a hook_update_n() function in my site deployment module. I'm trying to get information on the best way to accomplish this, thanks!
Comments
Comment #1
alberto56 commentedHere is how I deployed this:
First, on my dev site, use the GUI to manually replace the title with a translatable title.
Then, export the node type as a feature.
Then revert the feature on the target sites, for example using:
/**
* Revert fields
*/
function mysite_deploy_update_7088() {
features_revert(array('mysite_feature' => array('node')));
features_revert(array('mysite_feature' => array('field_instance')));
features_revert(array('mysite_feature' => array('field_base')));
}
Now calling
drush updbon the target site will make the title translatable (in my tests anyway).Comment #3
SandraVdv commentedYou can do the following in your code (I did it in hook_install after creating a vocabulary programmatically):
Comment #4
deivamagalhaes commentedFor me, this creates the fields but does not initialize their values. I'm trying to replace name and description fields for a taxonomy vocabulary with existing terms.