BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

Any page not preceded by '/contenttype' will switch website to default language #197

Closed COOLak closed 5 years ago

COOLak commented 5 years ago

I couldn't find a way to make pages not preceded by '/entry', '/page', or any other contenttype translatable, except for homepage. E.g. I have a custom 404 page that takes content from 'blocks/404-not-found'. That block is in two languages, so the 404 page gets displayed in the respective language if user types 'website.com/lang/entry/non-existing-page' or 'lang.website.com/entry/non-existing-page' (in the subdomain approach). But if they type 'website.com/lang/non-existing-page' or 'lang.website.com/non-existing-page' (in the subdomain approach), then it will be displayed only in the default language. Moreover, the whole website will switch to the default language in this case.

COOLak commented 5 years ago

I was able to solve this by adding this to routing.yml:

pagebinding: path: /{slug} host: "{_locale}.domain.com"
defaults: _controller: controller.frontend:record contenttypeslug: page contenttype: pages requirements: _locale: "en|de"

So I removed [BUG] prefix as it's not a bug but rather lack of documentation and something that should be by default.