So it's in English now, I guess
When I set out to make a webpage, I had the intention of writing it all in Spanish. I thought I could make great content in Spanish and serve as a bit of alternative space when every single thing is in English, specially when it comes to computers!
After much thought, I concluded that the great beauty of the internet lies in its universal availability. Having a webpage only in Spanish would not allow people from all over the world to read what I write. In the end I decided to write everything in English and then, if I feel it could be of use, I'll translate specific blog posts to Spanish. Maybe there'll be some posts that are only in Spanish.
Making it bilingual would be great. But it quickly becomes apparent how much effort that would take. I just wouldn't have enough time to translate every post. So if there's happens to be a post you'd like to translate, feel free to contact me! I would be happy to host it on this page and give the correct credit to you. You can find my email my "about" page.
Now then, there's a small bit of trouble with this. I really don't know how to structure a website when some pages can be in some language but not in another, and sometimes in both. I want people to be able to visit the website and read always in their preferred language. Some ideas quickly came to mind:
- Use geolocation based on IP
Next came geolocation. So I thought of a fun idea. I take the IP address of the
visitor and either lookup
whois information for the country code or consult
an API. However, most APIs are either commercial products (€€€) or simply
unreliable. That leaves us with
whois. I tested running
whois lookups for
some random IP address and they all seemed to have country code information.
Now I would just have to relate country codes to languages, which is pretty
easy thanks to ISO 639 and ISO 3166, which detail language and territory codes,
respectively. Fun fact: these codes are utilized to especify locales, like
en_US for United States English and
es_ES for Spanish Spanish (did I just
write Spanish Spanish?).
Now, while the geolocation one is fun and I'll do it just to try it out, there's just a problem. Most of the visitors to my site will be bots, so this would just be wasted time. I'd have to filter bots from actual human beings. And I really don't know if there's some simple way to do it. I mean, if they use captchas for that, I don't think there's actually a simpler way. If there was one, they wouldn't be using captchas.
So, in the end, I have to settle for some way to show if some post is in
Spanish or not. So I'll probably just style the index so that it's quickly
apparent what languages a post is in, and in the header there's also two links
about page. It's not optimal imo, but it is what it is.
Also, the URLs are gonna make me mad. I hate GET request args, they look really ugly. But I also love the consistency of URLs, so I would like to either always or never show the language the article is in in the URL.
So I feel my options are these:
https://jxpp.eu/blog/blog_post?l=es https://jxpp.eu/blog/blog_post/es https://jxpp.eu/blog/blog_post_es
Where omitting the language specifier gets you the post in English by default or in Spanish if it's not available in English.
I still haven't decided. But I have to decide before I write anything actually worthwhile. Someday someone might actually want to link to a blog post of mine, and I can't have URL structure changing every day.
You might have learned today that I worry too much about too little.