I'm working on integration of custom content panes (exportable) with i18n module. I've implemented building of translation strings and there is possibility to translate custom content pane's title and body using Translate Interface.
But I can't find the way how to inject this translation into rendering of this content type in ctools_custom_content_type_render()
. I've tried to replace title and body in pane settings using hook_panels_pane_prerender()
but it didn't work because of full reload of content in ctools_custom_content_type_render()
.
Is there any way I can do this without patching the ctools module. Or I should implement this feature as patch for ctools module and introduce 18n_string support in the ctools_custom_content_type_render()
function? Like similar task was implemented for nodes in ctools_node_content_type_render()
:
// Support node translation
if (module_exists('translation')) {
if ($translations = module_invoke('translation', 'node_get_translations', $nid)) {
if (isset($translations[$GLOBALS['language']->language])) {
$nid = $translations[$GLOBALS['language']->language]->nid;
}
}
}
Thanks,
Artem
Comment | File | Size | Author |
---|---|---|---|
#4 | ctools-how_to_change_content_of_the_custom-1840178-4.patch | 760 bytes | Andrew Answer |
#1 | ctools-custom_i18n.patch | 754 bytes | berdyshev |
Comments
Comment #1
berdyshev CreditAttribution: berdyshev commentedI've patched ctools module for now with attached patch and implemented contrib module for content translation
Comment #1.0
berdyshev CreditAttribution: berdyshev commentedUpdated issue summary.
Comment #3
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 6 year old patch to custom.inc does not apply to the latest ctools 7.x-1.x-dev so it will need a reroll.
Comment #4
Andrew Answer CreditAttribution: Andrew Answer as a volunteer commentedPatch rerolled.
Comment #5
MustangGB CreditAttribution: MustangGB commented