Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
hello
providing a code snipet with support for the default i18n settings in the array, and also another sample for pathauto.
the difference here is that they are split into two blocks, by using array_push function to inject the new variables in the existing array.
by not combining everything in the same code chunk, it is more easy to add new variables suggested by modules in code snipets, or disable existing ones without necessitating a rewrite of the code.
/**
* Multilingual settings
*
* This is a collection of variables that can be set up for each language when i18n is enabled.
* These are the basic ones for Drupal core, but you can add your own here.
*/
//$conf['i18n_variables'] = array(
if (!is_array($conf['i18n_variables'])) $conf['i18n_variables'] = array(
// Site name, slogan, mission, etc..
'site_name',
'site_slogan',
'site_mission',
'site_footer',
'anonymous',
// Different front page for each language
'site_frontpage',
// Primary and secondary links
'menu_primary_links_source',
'menu_secondary_links_source',
// Contact form information
'contact_form_information',
// For theme variables, read more below
'theme_settings',
'theme_garland_settings'
);
/**
* Multilingual settings - Pathauto
*
* Variables for Pathauto usage.
*/
if (is_array($conf['i18n_variables'])) array_push($conf['i18n_variables'],
// pathauto
'pathauto_node_pattern', // General pattern for nodes
'pathauto_node_blog_pattern', // Pattern for blog nodes
'pathauto_node_forum_pattern', // Pattern for forum nodes
'pathauto_node_poll_pattern', // Pattern for poll nodes
'pathauto_node_story_pattern', // Pattern for story nodes
'pathauto_node_page_pattern', // Pattern for page nodes
'pathauto_node_book_pattern' // Pattern for book nodes
);
posting the same code for pathauto module
Comments
Comment #1
lpalgarvio CreditAttribution: lpalgarvio commentedpathauto issue here:
http://drupal.org/node/945662
Comment #2
lpalgarvio CreditAttribution: lpalgarvio commentednote: Dave Reid, a co-maintainer of Pathauto, has just stated that these variables do not apply to pathauto:
http://drupal.org/node/945662#comment-3601712
the method is still valid for other variables though
Comment #3
adraskoy CreditAttribution: adraskoy commentedIt would also be nice to see examples showing how to include variables that are part of fieldsets, or mention if this is even possible. For example, in the Signup Status module there are variables such as:
signup_status_mailer_1[update][email][subject]
It's not at all clear how to get these to be multilingual.
Comment #4
lpalgarvio CreditAttribution: lpalgarvio commentedComment #5
Jose Reyero CreditAttribution: Jose Reyero commentedThis should go into the handbook.