Project

General

Profile

feature request #5911

feature request #5914: provide drupal installation profile for multilingual sites

deploy spanisch translation with the cdm_dataportal module

Added by Andreas Kohlbecker about 4 years ago. Updated 5 months ago.

Status:
Closed
Priority:
New
Category:
cdm-dataportal
Target version:
Start date:
06/24/2016
Due date:
06/24/2016
% Done:

100%

Severity:
normal
Tags:

Description

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:

picture027-2.png View (106 KB) Andreas Kohlbecker, 02/25/2020 03:15 PM


Subtasks

bug #5912: translatable dynamic strings conform to drupal policyClosedAndreas Kohlbecker

History

#1 Updated by Andreas Kohlbecker about 4 years ago

  • Status changed from New to In Progress

#2 Updated by Andreas Kohlbecker about 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

#3 Updated by Andreas Kohlbecker about 4 years ago

  • Status changed from In Progress to Closed
  • Resolution set to fixed
  • % Done set to 100

done by e5bbcdb r28474 adding spanish translation for the cdm_dataportal and sub-modules

#4 Updated by Andreas Kohlbecker over 3 years ago

  • Tags set to i18n
  • Description updated (diff)

#5 Updated by Andreas Kohlbecker 5 months ago

#6 Updated by Andreas Kohlbecker 5 months ago

  • Private changed from Yes to No

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)