0

I'm looking for a solution which can alter/change a language name based on the domain I'm on.

Here I can configure one name, which is used everywhere, but can't be configured for each domain: /admin/config/regional/language

I got a site with multiple domains. Every domain has a set of languages: en, nl and fr etc.

Each domain has different labels for those languages. For example: domain 1: en: English domain 2: en: International

Any suggestions?

Altering every form, every view output, just feels wrong.

2

You are looking for url/domain language negociation + url/path language negociation, right ? You need both of domain+path in /admin/config/regional/language/detection/url to determine wich language to display.

I think you have to implement a new LanguageNegociation plugin in a module which do this. Have a look at :

core/modules/language/src/Plugin/LanguageNegotiation/LanguageNegotiationUrl.php

You should be able to get your own detector (quiet looking like LanguageNegotiationUrl with both domain+path) by extending LanguageNegotiationMethodBase.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.