When a user views a page and then switches the language, then the following actions should be performed:
- If there is a translation for the page that he is viewing now, go to this page.
- If there is no translated version of this page, go to the main page.
So, for example, the user browses the page /about-us, then switches to German, then he should be redirected to /uber-uns, if there is a translation /about-usinto German.
I currently have such a structure,
CREATE TABLE `pages` (
`id` INT NOT NULL PRIMARY KEY AUTO_INCREMENT
`language` varchar(3),
`urlSegment` varchar(250),
`content` TEXT
) DEFAULT CHARSET=UTF8;
What relationships / columns should be added to achieve this?
source
share