Hi,

Thanks for the great module. I would very much appreciate if you could make the variables on the site multilingual. So I can show dutch service links on the dutch version and English links on the English version.

Thanks
Mark

Comments

TheCrow’s picture

If you mean phptemplate variables, you have some examples on template.php, you can mix these info using the API service_link_render_some(), passing as first param the list of dutch services... and so on

otherwise could you give more details? :)

splash112’s picture

Hi TheCrow,

No meant something more like this:
Variables in a hook_init like this can be set differently for every language. Now just copied all, which might be overkill... I think "service_links_show" should be a good one to start, then a user can select for every language which links to show.

/**
 * Implementation of hook_init().
 */
function service_links_init() {
  global $conf;
  $add_conf['i18n_variables'] = array(
    service_links_weight,  	
    service_links_fs_fix_count, 
    service_links_dsb_type,
    service_links_dsb_related,
    service_links_dsb_style,
    service_links_gpo_type,
    service_links_gpo_counter,
    service_links_block_not_node_front,
    service_links_category_types,	
    service_links_in_links,
    service_links_node_types,
    service_links_show,
    service_links_block_not_node_style,
    service_links_short_links_type,
    service_links_domain_redirect,
    service_links_tw_data_count,
    service_links_tw_data_via,
    service_links_fl_layout,
    service_links_fl_width,
    service_links_fl_font,
    service_links_fl_show_faces,
    service_links_fl_colorscheme,
    service_links_fl_action,
    service_links_fl_locale,
    service_links_fs_type,
    service_links_weight_in_node,
    service_links_new_window,
    service_links_append_to_url,
    service_links_short_links_use,
    service_links_category_vocs,
    service_links_hide_for_author,
    service_links_in_node,
    service_links_style,
    service_links_hide_if_unpublished,
    service_links_path_icons,
    service_links_label_in_node,
    service_links_block_style,
    service_links_check_icons,
    service_links_override_title,
    service_links_override_title_text,
   );
  if ($conf['i18n_variables']) {
    $conf['i18n_variables'] = array_merge($conf['i18n_variables'], $add_conf['i18n_variables']);
  }
  else {
    $conf['i18n_variables'] = $add_conf['i18n_variables'];
  }
}
TheCrow’s picture

Status: Active » Needs work

this is the same that define an hook_locale?

splash112’s picture

No, as far as I understand hook_locale does something with strings...

The above code makes the variables, which can hold anything, multilingual. Which means they can have a different version for every active language in ones site.

One of the variables here holds the information on which service links are enabled. When one makes that variable multilingual, one can select German service links for when the site is in German mode and English service links for when the site is in English mode.

Nothing will change when the site is just in 1 language or when nobody changes the settings in other languages.

TheCrow’s picture

Thank you very much for the explaination, i'll add this on the next commit :)

gdl’s picture

There aren't any code changes necessary to support i18n_variables, and I don't believe there's anything keeping one from setting any of the service_links variables as multilingual variables right now.

The i18n_variable documentation for the Drupal 6 version of the i18n collection of modules describes how to do make any variable an i18_variable on a per-site basis by altering the settings.php file for a given site and then setting the desired variables for each language.

Best,
-G