Project

General

Profile

CdmDataportalMultilingual » History » Version 14

Katja Luther, 04/08/2022 11:37 AM

1 1 Andreas Kohlbecker
# Multilingual set up of the Data Portal
2
3 9 Katja Luther
{{toc}}
4
5
{{child_pages(depth=1)}}
6
7 7 Andreas Kohlbecker
## Providing translations in an additional language for the dataportal module
8 1 Andreas Kohlbecker
9 6 Andreas Kohlbecker
see #5911
10 1 Andreas Kohlbecker
11 11 Katja Luther
## Configuration of Dataportal drupal site for multilanguage support
12 6 Andreas Kohlbecker
13
### 1) Install the required modules 
14
15 10 Katja Luther
see #5913 for further details, with the following command the modules are downloaded and installed (first download and then install would be drush dl ... and afterwards drush en ...)
16 5 Andreas Kohlbecker
17 1 Andreas Kohlbecker
~~~
18 4 Andreas Kohlbecker
drush -l {site-url} en languageicons i18n i18n_menu i18n_node i18n_string i18n_translation i18n_variable l10n_update
19 1 Andreas Kohlbecker
~~~
20 10 Katja Luther
21 1 Andreas Kohlbecker
Afterwards the modules should be available in the dataportal where they can be activated:
22
![](Screenshot 2022-04-07 151821.png)
23 11 Katja Luther
24
and the additional language needs to be added:
25
26
Home » Administration » Configuration » Regional and language » Languages 
27
28
-> Add Language
29 1 Andreas Kohlbecker
30 12 Katja Luther
Define which language should be the default language.
31 13 Katja Luther
![](Screenshot 2022-04-07 152247.png)
32 12 Katja Luther
33
--------
34 14 Katja Luther
The files (for example cdm_dataportal.es-po) for translations can be found in portal code under modul/cdm_dataportal/translations/
35 1 Andreas Kohlbecker
36 14 Katja Luther
In this folder there is also a note on automatic installation of translations (README):
37 2 Andreas Kohlbecker
38 1 Andreas Kohlbecker
~~~
39
The translations can be named as $langcode.po or with names ending with $langcode.po.
40
41
Translations are only automatically imported during the installation of the module for
42
all the languages already set up on the site,
43
see https://api.drupal.org/api/drupal/includes!locale.inc/function/locale_batch_by_component/8.x for details.
44
45
If the module is already enabled you need to disable and re-enable it. Alternatively you can use the following drush command:
46
47 5 Andreas Kohlbecker
drush php-eval "locale_system_update(array('yourmodule_name'));drush_backend_batch_process();"
48 1 Andreas Kohlbecker
~~~
49
50 6 Andreas Kohlbecker
### 2) Multilingual menus
51 1 Andreas Kohlbecker
52 6 Andreas Kohlbecker
...
53
54 1 Andreas Kohlbecker
### 3) Download and install Drupal-Core Translations
55 7 Andreas Kohlbecker
56
* go to https://localize.drupal.org/download and download the Drual 7 translation package for desired language
57 8 Andreas Kohlbecker
* Import the language via the settings page at `admin/config/regional/translate/import`. Make sure you have selected the correct target language before clicking on "Import"