Alheimsins / bigfive-web

Website for taking personality tests
MIT License
213 stars 86 forks source link

How to remove a few languages? #162

Closed jfrcom closed 5 years ago

jfrcom commented 5 years ago

Hello,

is it possible to remove a few languages? I don't want to offer that much languages. I would appreciate your help! Thanks!

zrrrzzt commented 5 years ago

I don't think we're going to add configurable options to limit languages for bigfive-web or the questions module. You can however create a filter yourself if you want to.

In pages/index.js you can add something like this from line 8

const preferredLanguages = ['en', 'de', 'no'] // List of languages codes you want to use
const useThisLanguage = lang => preferredLanguages.includes(lang)
const languageList = languages.filter(useThisLanguage).map(code => ({ code, name: ISO6391.getName(code) }))
jfrcom commented 5 years ago

Hello, it is working perfectly! Thank's a lot! But I still got one question. Is it possible to change the answers or the questions? I can change it and on my local machine it does work but when I deploy it, it doesn't. I think it is because it is downloading the node_modules again.

Thank's!

Edit: In the test.js are still all the languages. How can I change it there?

zrrrzzt commented 5 years ago

All questions comes from this module b5-johnson-120-ipip-neo-pi-r If you want to change them (like do a better/complete translation) please fork the repo and do a PR and we will merge it and everybody will win :-) If you don't have a dev environment on your local machine it is possible to do almost everything via GitHub's website.

When it comes to test.js you can do something like the code example I gave you but the variable might have different names. Take a look at the code and see if you can figure it out :-)