Context:
We're having different front pages (nodes) per language. They have to be technically different, because one is a page with certain paragraphs for a Special Offer and the other one is from a different content type (can't be the same entity here, still both should be the special case "front")
Problem:
Form System > Basic site settings allows to set different variables in UI:
- Site name
- Slogan
- Default front page
- Default 403
- Default 404
and shows a "Translate system information" tab. But there only
- Site name
- Slogan
can be translated.
This was a huge problem for us, so I simply tried to edit de/system.site.yml directly:
page:
403: ''
404: /search404
front: /node/28
imported the config and hey, it works like a charm, just like we knew in Drupal 7. /de now deliveres a different page than /en. But that should be managable for site owners in the UI directly and not only for developers.
Something like this is also described here for example:
https://drupal.stackexchange.com/questions/188923/setting-the-default-fr...
Proposed solution
Expose all Basic site settings for translation in UI. Front page is a very special case and we should not assume it's always the identically same entity targeted!
Thank you!
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | core-3097497-translate-path-email-d11.patch | 2.01 KB | remco hoeneveld |
| #18 | translate-path-email.patch | 1.61 KB | ruuds |
| translation form.PNG | 28.39 KB | anybody | |
| full form.PNG | 50.75 KB | anybody |
Comments
Comment #2
anybodyComment #3
anybodyComment #4
anybodyShould we better change the issue title to "Make all Basic site settings translatable in UI?"
Comment #5
anybodyI just found https://drupal.stackexchange.com/questions/222750/different-front-page-p... and guess this issue might be a very typical example of a requirement for #2275865: Per language settings (vs translated settings) are not directly supported?
Comment #7
jas1988 commentedIt worked by directly changing in files it should be available in UI !
Comment #8
anybodyComment #10
lordzik commentedHello,
i'm trying to understand how to set different "default page" per language but i need some really basic information about this :(
This was a huge problem for us, so I simply tried to edit de/system.site.yml directly
Can you explain exactly WHERE you put this file and how you import it? Does it work in Drupal 8.9.7?
btw how is this possible that such fundamental thing like different default page per language is still not available in /admin/config/system/site-information/translate/_langcode_/edit ??!
Comment #11
jas1988 commented@lordzik you need to put system.site.yml in your language folder of config directory and then import it, for example my sites first language is not english but we have seperate front-page for english language and separate for default language.
config_......../sync/language/en/system.site.yml
name: EnglishSiteName
slogan: ''
mail: example@en.com
page:
403: ''
404: ''
front: /example-en-front-page
Default language system.site.yml is found at below structure :
config_......../sync/system.site.yml
Site is in Drupal 8.9
Comment #12
simgui8 commentedHere is a useful link to a suggestion from berdir:
https://drupal.stackexchange.com/questions/222750/different-front-page-p...
@see the 4 years later update
Works for me
Comment #13
lordzik commented@jas1988
I created a file language/en/system.site.yml - but how can i import it? Should i do that in en/admin/config/development/configuration ? If yes, then something is wrong because all i see is this:
"There are no configuration changes to import." :(
Comment #18
ruuds commentedAdding a form_element_class for the path and email schema type makes the fields translatable. See the attached patch.
Comment #21
remco hoeneveld commentedReroll for drupal 11.
Comment #22
anybody@ruuds thanks - maybe you could create a MR instead to push this forward?