Project

General

Profile

feature request #5914

Updated by Andreas Kohlbecker over 7 years ago

requires steps: 


  


  **1. install the required modules**  

   

  **IMPORTANT*: The translations supplied with the cdm_dataportal module will only be imported during the module installation if the according languages are set up *before** installing the module!!!! 


 


 1. enable language and i18n & i10N modules (see #5913 for details) 

 

 1. enable all languages provided with the cdm_dataportal module. 

 

 1. import the translations:   

   

 ~~~ 
 
 drush l10n-update-refresh 
 
 drush l10n-update --languages=... 
 
 ~~~ 
 
 1. enable the cdm_dataportal module 


 


 Alternatively we could provide easy to use functions that allow portal maintainers to activate languages and to automatically import the according translations.  


   


  **2. setup the language switcher**  


  


 1. place 'Language switcher' block in reqion 'navigation bar' and set the block title to '<none>' 

 

 1. add the following css rules to the 'CDM DataPortal base theme' 'User defined styles': 

 

 ~~~ 
 
 #block-locale-language { 
   
   margin-top: -2.8em; 
   
   float: right; 
 
 } 

 

 ul.language-switcher-locale-session { 
   
   padding-right: 5px; 
 
 } 
 
 ul.language-switcher-locale-session li { 
  
  display: inline; 
 
 } 
 
 ul.language-switcher-locale-session li a:link,  
  
 ul.language-switcher-locale-session li a:visited { 
  
  color: white; 
 
 } 
 
 ~~~ 

  

  **3. Configure content types**  


  


 This is recommended for the content types _article_ and _Basic page_: 


 


 1. in admin/structure/types/manage/{content_type} :  

    

   a. Publishing options > Multilingual support: (x)Enabled, with translation  

    

   a. submit form 

   

   a. Multilingual settings > Extended language options: [[x]|Set current language as default for new content & [x]] Require language (Do not allow Language Neutral).  

  

 1. admin/structure/types/manage/{content_type}/display : 

   

   a. set _Language_ to _Hidden_ 

 

 1. go to `/node/1/translate` and click _add translation_ or directly go to `/node/add/page?translation=1&target=es}}. This will create {{{node/2` as spanish translation of `node/1`  


   


  **5. Site set up**  


  


 1. go to `/admin/config/system/site-information?variable_realm_key_language=es` and set the spanish _Default front page: [node/2]_  

  

 1. if you need to tranlate the site name, go to the same page as above and set the _Site name_ 

 

 1. multilingual front page variable : `admin/config/regional/i18n/variable` _Site information_ > _[x] Default front page_ 


  


  **6. Set up menus**  


  


 1. in `admin/structure/menu/manage/main-menu/edit` Multilingual options >> Translation mode set _(x) Fixed Language._ and choose Language _English_ 

 

 1. got to `admin/config/regional/translate/i18n_string` check _[[x]|Menu_ and _[x]] Clean up left over strings_ and submit the form 

 

 1. Now a new Menu items can be added. The language of the    menu item is determined by the node language it is pointing to.  



   



  **7. Set permissions**  


  


 Add permissions to @CDM admin@: 


 


 ~~~ 
 
 administer content translations  
  
 administer languages 

 

 translate content                
                
 translate interface              
              
 translate user-defined strings  
  
 ~~~ 



 



 ---- 


  


  **Creating Profiles**  


  


 * [How to Create a Drupal Installation Profile with Profiler and Profiler Builder](https://www.drupal.org/node/1852008) 

   

   *    [Profiler](https://www.drupal.org/project/profiler) 

 

 * [Creating a Multilingual Install Profile for Drupal](https://evolvingweb.ca/blog/creating-multilingual-install-profile-drupal) 

 

 * drush make 

   

   * [Managing Drush make files for an installation profile](https://www.drupal.org/node/1476014) 

   

   * [Drush Make theory for happy profile development](https://www.drupal.org/node/1006620) 




  




  **Examples and Templates**  



  



 The drupal module [l10n_install](https://www.drupal.org/project/l10n_install) could serve as template for our own installation profile. Source code for Drupal 7 is found here: http://cgit.drupalcode.org/l10n_install/tree/?h=7.x-1.x 


 


Back