How can i implement buttons per active language (need english ones).

Comments

blackice2999’s picture

Hi,

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.

bavarian’s picture

Issue summary: View changes

in which file of the module to insert that extra code?

blackice2999’s picture

Hi bavarian,

this could be done in a own module (see Drupal Documentation for this)

bavarian’s picture

So ... 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?

blackice2999’s picture

Hi 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

bavarian’s picture

ok ...

one last question: could the php.code you mentioned be added to a node, instead of an own module?

blackice2999’s picture

Hi,

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

anni’s picture

Status: Active » Closed (outdated)