you got me :) - currently there is a missing i18n translation implementation so its not possible to provide a language translate at this point. But there is a possible way - try to create a profile per language and switch them before the element pre_render runs. Example:
function HOOK_element_info_alter(&$type){
if (isset($type['secureshare']['#pre_render'])) {
array_unshift($type['secureshare']['#pre_render'], 'MYMODULE_secureshare_pre_render');
}
}
function MYMODULE_secureshare_pre_render($element){
$language = 'de';
if ($language === 'de'){
$element['#secureshare_profile'] = 'maschinenameofyourprofile';
}
return $element;
}
sorry but a other way currently not exist.
Edit:
you only need this if you want multiple languages. If you only want english you can simple set the text in the default profile.
currently its not really planned because nobody provides a patch for this and i have not enough time for this. (i dont need this feature in a project)
sorry
no! you should never use php code in a node or a formatter. Its not so hard to write a small module for your project. You should to lern this because you need this ever and ever (for example you want to change fields of a form.. then you need hook_form_alter) - Read this here: https://drupal.org/developing/modules/7
Comments
Comment #1
blackice2999 commentedHi,
you got me :) - currently there is a missing i18n translation implementation so its not possible to provide a language translate at this point. But there is a possible way - try to create a profile per language and switch them before the element pre_render runs. Example:
sorry but a other way currently not exist.
Edit:
you only need this if you want multiple languages. If you only want english you can simple set the text in the default profile.
Comment #2
bavarian commentedin which file of the module to insert that extra code?
Comment #3
blackice2999 commentedHi bavarian,
this could be done in a own module (see Drupal Documentation for this)
Comment #4
bavarian commentedSo ... the code is not intended for any file of this module?
When to expect that next major upgrade that "next bigger release" that brings i18n-implementation?
Comment #5
blackice2999 commentedHi bavarian,
currently its not really planned because nobody provides a patch for this and i have not enough time for this. (i dont need this feature in a project)
sorry
Comment #6
bavarian commentedok ...
one last question: could the php.code you mentioned be added to a node, instead of an own module?
Comment #7
blackice2999 commentedHi,
no! you should never use php code in a node or a formatter. Its not so hard to write a small module for your project. You should to lern this because you need this ever and ever (for example you want to change fields of a form.. then you need hook_form_alter) - Read this here: https://drupal.org/developing/modules/7
Comment #8
anni commented