Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate "Our Values" tab on the homepage instead of having both languages #224

Closed
danielstreif opened this issue Dec 18, 2019 · 1 comment · Fixed by #226
Closed

Translate "Our Values" tab on the homepage instead of having both languages #224

danielstreif opened this issue Dec 18, 2019 · 1 comment · Fixed by #226
Assignees

Comments

@danielstreif
Copy link
Collaborator

danielstreif commented Dec 18, 2019

@pheeria @jarjan Simply using the i18n json doesn't work since the tab information is described in home.js. Any idea how to work around this? Here the code snippet:

const ourValues = () => ({
  badge: "Über Uns",
  title: "Unsere Werte / Our Values",
  text: "Dafür steht Die Lernwerkstatt.",
  link: "/values",
  image: "img/home/notebook.png"
});
@pheeria
Copy link
Member

pheeria commented Dec 19, 2019

The easiest, although not the cleanest, solution would be reading incoming cookies.
You can access them under req.cookies, and our language cookie is called locale. So, because ourValues is a function, you could pass req.cookies.locale to it and conditionally decide what text to return in each case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants