Hi folks,

I'm using variable module to get my module strings editable by the user. At the same time this strings are going to be multilingual. To get my custom variables in the language realm I need to use this snipped:

  $controller = variable_realm_controller('language');
  $translatable_variables = $controller->getEnabledVariables();
  $available_variables = $controller->getAvailableVariables();
  $variables = variable_get_info();
  foreach($variables as $key => $var) {
    if($var['group'] == 'hsjd_custom' &&
      $var['localize'] == TRUE &&
      in_array($key, $available_variables) &&
      !in_array($key, $translatable_variables)) {
      $translatable_variables[] = $key;
    }
  }
  $controller->setRealmVariable('list', array_unique($translatable_variables));

My feature requests is to get this into a api function. This one can get as parameter the variable key or the group name and a realm and do this.

what do you think about?

thanks

Comments

quiron created an issue.

yonailo’s picture

+1 to support this !

earthangelconsulting’s picture

+1 from me too!