Drupal Internationalization + Domain Access - Multilingual Variables for each Domain

There are a lot of modules for Drupal. One of them, Domain Access, enables multiple different domains on a single Drupal site and allows setting different variable values for each domain. Another of them, Internationalization, allows different variable values for each language. What was missing was a mechanism to handle that variables consistently and then allowing to mix these two 'variable realms' setting specific values for specific combinations of Domain and Language.

That is possible now with Domain Variable module which, building on the Variable module API, the Domain Access module and the Internationalization module provides support for all possible combinations of languages and domains for your variables. We are going to see how we can set up different variable values for each domain and for each language or for each combination of domain and language.

Multilingual domain variables - Variable modules

Screenshot - Settings form with domains and languages

Screenshot - Drupal Variable modules

We are going to need some basic modules of the Variable collection and the Variable Admin module just to be able to see some more details.

Multilingual domain variables - Enable modules

Screenshot - Modules from Drupal Domain Access package.

First of all we need to download and install the modules from Variable, Domain Access and Internationalization packages. Enable Domain+i18n variables integration and it will take care of all the dependencies. The Variable Admin module is needed only if you want to see some additional pages at the end.

Multilingual domain variables - Select domain variables

Screenshot - Selecting domain dependent variables

We can select the variables to be edited for each domain. This feature is provided by the Variable Domain module in combination with the Variable Realm API. Once you select the variables you can set a different value for them for each of your domains.

Multilingual domain variables - Select translatable variables

Using the Internationalization module we select the variables that we want to be multilingual. Note we are selecting some new variables but also one variable that we selected before to be editable for each domain, Site name. What will happen with these variables? Read on.

Multilingual domain variables - Here's your settings form

Drupal Screenshot - Settings forms with mixed realms

And here is the settings form on which we can set values to selected variables for each realm and for each language. The 'Realm selectors' at the top allow choosing any combination of Domain x Language. Some variables will only change per Language, some per Domain but the one we have selected for both can get a value for each Domain x Language combination. This form is auto-generated by the Variable realm module.

Multilingual domain variables - Metadata for mixed realms

Screenshot - Drupal Variable administration for mixed realms

For the Language + Domain realm we can see also which variables are defined (the ones that are set for both of the realms) and all the possible key combinations. For each key combination we can set a different value for the variables.

Multilingual domain variables - Variable realm metadata

Screenshot - Drupal Variable realm metadata

We also can see, for each enabled Variable realm, all the key combinations, which variables are defined, etc..

Multilingual domain variables - Variable realm administration

Screenshot - Variable realm administration overview

This is what we see with Variable Admin module that we don't really need for this experiment but for administration / development purposes. Variable administration if enabled provides way more information about variables and defined variable realms thatn what you can see on your settings forms.

Multilingual domain variables - Edit variables for a realm.

Screenshot - Drupal Variable administration, edit realm variables

We can also see the advanced Variable realm settings form, which is completely autogenerated (depending on the variables you have selected before) and allows edition of variables for a single realm. Ever wanted to edit all your multilingual variables together?

Update 2015-03-13: As mentioned on the comments, you need to disable the 'Domain Settings' module for the variables to show on settings forms.



For those still on D6 the solution is to use Domain i18n (http://drupal.org/project/domain_i18n)


Nice article! I'm gonna test it soon on my new project.

Virginia Hiering

Hi Jose! I truly appreciate your presentation... I am getting there finally.
question, after I followed all the steps, I got all exactly as presented except for the Domain + Language link.

what did you set up or how did you make that link show up there?
I missed something.

thank you


For that one to show up you need to select one or more variables for both realms (Domain and Language).

Leiv Hendrickx

i followed your instructions, but i just cant get the links to show up in /admin/config/system/site-information

I have a 4 domains site and each of them share 3 languages (so EN - FR and IT should be available on all domains).

are there any domain or i18n modules that should NOT be activated ?


There are possibly many modules that should not be activated, both packages contain a lot of them, you just don't activate modules unless you know what they are for.

Anyway, this is the kind of question to be answered in the module's issue tracker.


For those who are stuck on these same issue, de-activate domain settings module.


This fixed a similar problem for me - thanks!

Virginia Hiering

Thank you Jose! for all the clear instructions and sharing.
i followed all through and so far so good for a beginner that i am : )
question: i wanted for a start to have de.domain.com with 3 languages (de/sp/en), ve.domain.com (sp), defualt-domain.com (en). after following all your instructions i am ending up with 3 languages for each domain. the default and de.- will end up eventually with more languages. can i at this point delete variables like for ex. to keep ve.- with only (sp) ? i am hoping it will not be a biggy to add other languages as i expand for the future- i will appreciate any detailed respond. thank you again


So I have everything set up, as in your "Multilingual domain variables - Variable modules" screen. The only problem is that the links for changing the current domain do nothing, I have to change the actual URL to be on the "other" site.

Any idea what could be wrong?


Hi, this is great, thank you so much.
I was having the same problem - i.e. no language or domain variables being show on the main Site Information page: just to re-iterate the comment above from @Thomas and suggest it be added to your article: you need to disable the 'Domain Settings' module for the variables to show.


Right, added to the article, thanks.

Elisabeth Escribano

Hi Jose,

Thanks so much for this post, it really gave me a lot of insight in an issue I was fighting against.

One thing though... I had to disable the "Visibility of domain-specific settings on forms" for the form I needed to change the settings for. If the Domain specific settings is present then the other options seem to be overkill therefore they don't show.


thank you. can you help with this: I have 4 languages and 2 domains.
I set up all that you say in article. But on the page : Configuration - System -Information
in field Site name (that has "This is a multilingual domain variable.") I cannot type differetn site names for domains - only 2 different variables are using there - from the Domain settings "Name of the domain". But for other 2 languages is using default language site name and i cannot change cause it does not save.
but the slogan is translating correcta


I had a same problem. This is solution https://www.drupal.org/node/1856862 PS: Nice article Jose.


Hi, I have followed your instructions, and have been able to change the site slogan, etc., with different values in different domains/languages combinations. But the variable site_name resists all attemps. I try to change the value, and after post submission, still the old value. How could I reset the default values or something, there seems to be some corrupted data in my database or I don't understand why I only have problems with this specific variable. Thanks!

Rajiv Charan Tej K

Hi Jose,
We are developing a Multilingual Site which has two versions, English and French. We created several variable groups. Previously, we used to select the corresponding language and set the value for a variable in a group. It worked. Recently, we ended in a situation where when we select a language and tried to set a value to a variable, it is not getting saved. Further, a message shows "These are global default variables. To edit variables for a specific realm go to Variable Realms". We are providing some roles the permissions to edit those variables. Since some roles find it difficult to go to the realm and edit the variables, is there any way to get back the previous functionality. Am I missing something here. Please reply, we are in a critical position regarding this.


When mixing domain and language you cannot just set variables per language because there will be a value for each language and for each domain. This is where variable module UI is the last resource for administering variables but it is not aimed at translators with restricted permissions. On the other side "Domain Variable" will provide the UI for domains but not for languages.

So I'm afraid for domain+language the API is there but not the user friendly UI to handle both at the same time with more reasonable permissions. You may need to build some custom pages for that.

I cannot tell you more without knowing about your specific set up but anyway you better post to the module's issue tracker.

Rajiv Charan Tej K

But, we are not using the Domain Variable Module.


Then I'm afraid you are posting in the wrong place because this is about all these modules used together. Please find the right issue tracker in drupal.org.

User login