feature request #5911
feature request #5914: provide drupal installation profile for multilingual sites
deploy spanisch translation with the cdm_dataportal module
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())
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 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 for which a patch exists, has been confirmed and will be incorporated into 7.x-3.x-dev.
Here a screenshot at the example of the flora of cuba and Spanish:
#2 Updated by Andreas Kohlbecker over 4 years ago
The inclusion of translations into the POT file seems to fail due to a couple of errors like these:
(only some examples)
The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there. At t($link_alt_text) in cdm_dataportal.module on line 2332. Read more at http://drupal.org/node/322732
Invalid menu 'title' definition found in cdm_dataportal_menu(). Title and description keys of the menu array should be literal strings. In cdm_dataportal.module on line 536. Read more at http://drupal.org/node/323101
The first two watchdog() parameters should be literal strings. There should be no variables, concatenation, constants or even a t() call there. At watchdog('content',$message,WATCHDOG_ERROR) in cdm_api/cdm_node.php on line 152. Read more at http://drupal.org/node/323101