Stefan
Stefan5d ago

Making some tiny diversity

I have two domains, lungustefan.ro and lungustefan.com I'd want to make lungustefan.ro to have text in romanian and if your IP country ≠ Romania/Moldova you to be asked if you want to switch to the english version. Likewise, if someone from Romania or Moldova visits the .com site, they will be asked if they want to switch to the Romanian version. Can anyone provide any tips on that? Or make a PR with an version here (if you make a PR please keep all text the same this would be the english version then I'd just translate it to romania as text and you'd provide tips for the script. Furthermore, I can also just upload the script to the s3 storage if you provide it so we don't clutter the code, PRs auto make a test version via vercel tho that's admin only afaik.) https://github.com/lungustefan/website-beta Asset list: Scripts: https://s3.lungustefan.ro/scripts/modal.js https://s3.lungustefan.ro/scripts/australia.js - no hate Style: https://s3.lungustefan.ro/style/main.css Images: https://s3.lungustefan.ro/assets/pfp.avif https://s3.lungustefan.ro/assets/background.avif https://s3.lungustefan.ro/assets/he.avif Provided the above list for redundancy and you not needing to go digging for them.
5 Replies
Stefan
StefanOP5d ago
If you want to help feel free to shoot me a friend request to discuss more details there
smartest guys in the guninvalid
that depends how you choose to run your website i believe nginx can do this pretty easily, apache may be able to as well but basically you would detect the country based on the incoming IP address and provide hte user a different experience based on that
Stefan
StefanOP5d ago
I use webhosts to whom i dont have acess so ill go via scripts + i dont want auto redirects id want the user say if they want to or not
smartest guys in the guninvalid
yea you can do that i can't help you with your particular webhost but the idea is the same, detect based on ip address alternatively you could do what a lot of other websites do and just have a toggle somewhere on the page usually top right to change the language
Stefan
StefanOP3d ago
I used the CloudFlare Geolocation Header and a worker to save it it seems to work great atm

Did you find this page helpful?