Toggle navigation
TechnoWikis.com
Email or Username
Password
Remember
Login
Register
|
I forgot my password
All Activity
Questions
Hot!
Pending
Ask a Question
Privacy Policy
Contact
Multilingual sites with Drupal
Home
Tutorials
Development
CMS
Multilingual sites with Drupal
+4
votes
122
views
Multilingual sites with Drupal
asked
Jun 24, 2019
in
CMS
by
backtothefuture
(
360k
points)
reopened
Jun 24, 2019
|
122
views
answer
Please
log in
or
register
to answer this question.
1
Answer
+5
votes
Best answer
First of all, if we want our site to be available in several languages, the most logical option is to add more languages ​​and then configure them so they can be detected.
Adding languages
Drupal
by default has the support for languages ​​in its core, but it is not completely activated by default.
Let's see how to activate it.
1-
To integrate the languages ​​with our site, activate the kernel module.
We go to
Configuration
Ã
Regional and Language
to see the following options:
2-
We click on
Languages
and we will see that we only have
English
activated in our list for now:
3-
For our purposes we will work with predefined languages.
Therefore, we choose the language of the list and click on the
Add language
button:
4-
After this
Drupal
will redirect you to the list of main languages ​​and your new language will have already been added to the list, now to add more languages ​​we repeat the previous process, in this example we add:
Arabic, German
and
Polish
.
The above table shows the names of the languages ​​we add, their code, their address, when we talk about address we refer to the way they are read, from left to right or vice versa.
Here we can choose which languages ​​to activate, sort or delete them from the list.
Detecting languages
Now that we have the languages, we realize that if we navigate through our site everything remains the same, because despite having added languages ​​we still need to tell
Drupal
how to interpret them, let's see:
We navigate to
Configuration
Ã
Regional and Language
>
Languages
>
Detection and selection
and we will see the following available options:
URL
If we activate this option, users can browse URLs in the following way: example.com/de/news/ or example / deutsch / news.
This is a common configuration for multilanguage sites.
Session
We will use this option if we want to save the preference of the languages ​​in the user's session.
User
In this option, users can specify in the profile of their account which language is their preference.
Browser
If we activate this option Drupal will verify the language preference of our browser and will use it on our site.
Already described the different options we use one to implement the multilanguage option on our site.
For our purpose, we will keep the URL option and for this we will use the prefix of the route, since it is the simplest way of configuration.
Let's see how we do this:
First we mark in the URL options and press
Save settings
.
Now we click on
Configure
in that method and we will see the options
Path prefix
and
Domain
.
We will use the default option that is
Path prefix
.
Now we change the URL in our browser to include the prefix of the route.
For example, problems
German
, example.com/de.
In this way we can use the prefix for each of the languages ​​we add.
Switching between languages
We certainly do not want users to be manually changing the languages ​​by the URL so we create a block in Drupal so that we place it somewhere on our site to facilitate this task.
To create the block, navigate to
Structure
à Blocks
and look for the user interface block:
Language switcher
.
We position it in the place we want and we save the settings for the block, after activated it would look like this:
For example, we select that our site is in German and our login would look like this:
Drupal gives us the opportunity to not only create robust and versatile websites, but also has the goodness to make the same multilanguage a feature that will stand out on its own from other websites on the network.
answered
Jun 24, 2019
by
stackoverflow
(
2.2m
points)
edited
Jun 24, 2019
ask related question
comment
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Add comment
Cancel
Related questions
+3
votes
1
answer
Installing Drupal under Windows
asked
Jun 23, 2019
in
CMS
by
backtothefuture
(
360k
points)
|
83
views
+4
votes
1
answer
Drupal - Custom types types
asked
Jun 23, 2019
in
CMS
by
backtothefuture
(
360k
points)
|
73
views
+4
votes
1
answer
How to set up multilingual text suggestions Windows 10
asked
Oct 2, 2019
in
Windows 10
by
backtothefuture
(
360k
points)
|
86
views
All categories
Tutorials
5.5k
Microsoft
1.4k
Android
1.3k
Security
96
Linux / Unix
423
Internet
631
Virtualization
84
Apple
501
Networks
57
Other Devices
144
Other Applications
121
Hardware
10
Development
49
HTML5 / CSS3
12
Web Servers
9
JavaScript
12
Other languages
2
PHP
8
CMS
4
Python
1
WebServers
1
Digital Marketing
47
Databases
14
Graphic Design
30
Guides
116
Linux/Unix
101
Otherapps
32
OtherApplications
7
GraphicDesign
2
OtherDevices
111
Networking
4
Manzana
57
Play Station
136
Gaming
37
Help
506
Social Networks
29
Android Tutorial
522
iPhone Tutorial
243
News
9
Social
6
Android Application
37
Phone
2
Telephone
2
Android Application
1
Most popular questions within the last 30 days
Samsung Galaxy S21, S21 Plus and S21 Ultra does not recognize USB
How to put photos to my contacts on my Samsung Galaxy S21, S21 Plus and S21 Ultra cell phone
Tricks Samsung Galaxy S21, S21 Plus and S21 Ultra
Activate wireless or reversible charging Samsung Galaxy S21, S21 Plus and S21 Ultra
Create USB Bootable Windows Server 2022
Backup Active Directory Windows Server 2022 Active Directory
Install and configure Windows Server 2022 File Server
How to Record a FaceTime Call on iPhone
Where are NPCs 43 and 44 in Fortnite - are Idyll and Cuddle King positions available?
How to deliver the love potion to Slurpy Swamp or Shanty Town in Fortnite
The Wild Hearts event is coming to Fortnite today: Cups, Battles, and help Poiscaille find a date
The best PCIe 4.0 motherboards
Install Windows 10 without Microsoft account 2021
Na'Vi vs. Vitality on CS: GO for BLAST Premier Global Final 2020 breaks spectator record
Reset Samsung Galaxy A32, A42, A52 and A72 | 5G Hard reset
Please leave a comment about whether the solution works or not (with device model)
[X]Close
6,895
questions
6,992
answers
277
comments
2
users