Project

General

Profile

feature request #5911

Updated by Andreas Kohlbecker over 7 years ago

For the flora of cuba a spanisch translation of the site has been created #5665 


 


 This translation should be exported into an PO file as translation for the cdm_dataportal module. `*.po` files should be copied to a "translations" sub-folder in the module folder, so they are automatically imported by Drupal when installing the module. 


  


  **On Using the translations**  


  


 Translations are automatically imported during the installation of the module for all the languages already set up on the site (see [locale_batch_by_component()](https://api.drupal.org/api/drupal/includes!locale.inc/function/locale_batch_by_component/7.x)) 


 


 If you are translating a custom module, you need to reinstall it in order to apply translation. When you don't want to do that (e.g. you don't want to lost all permissions and db tables on uninstall) you can run a drush command to force translations loading:  


  


 ~~~ 
 
 drush php-eval "locale_system_update(array('yourmodule_name'));drush_backend_batch_process();" 
 
 ~~~ 

  

  **Exporting existing translations or creating templates**  


  


 The [Translation template extractor](https://www.drupal.org/project/potx) is the perfect tool for this task: 


 


 After installation of the module you can go to `admin/config/regional/translate/extract` select the cdm_dataportal module check theses options new the bottom of the page: 

 

 * (x) Template file for Spanish translations  

  

 * [x] Include translations  


  


 This feature will in the next release also be available from drush. See the issue [Support language dependent content and translations export in Drush command](https://www.drupal.org/node/2175955) for which a patch exists, has been confirmed and will be incorporated into 7.x-3.x-dev. 
 

Back