Translator stack?

Agent is good for language detection and conditional display but Joe’s Geo Target stack might be a better option for targeting, as with Agent and IP you’d have to know all the IP ranges you are planning to serve different content to.

@Albertkinng do you have different translations already available ready to go or were you hoping for automatic translation?

1 Like

I have had the same question. Since looking at the IP is a kind of tracking, you might even need a consent for this. So I went a different route. I am looking at the language the browser is set to and added some rules in htaccess.

So when 'Accept-Language' header starts with 'de' then a german page will be used. In all other settings, the english page will be shown.

2 Likes

Not sure if this will be of interest to you or not. I was approached by a local law firm about a month ago- they were looking to have their existing site revamped into two languages (Spanish and English - and not relying on translate). I almost turned them down, but this project was released while I was pondering their request. For $70, I purchased it and mocked a homepage up for them. They LOVED it. I went on to build a 15 page site for them- they have complete control over the content of most of the pages (in English and Spanish). They are currently building out their site - once finished, I will transfer the site to my hosting plan (with DreamHost) and replace their current site.

Now - I’m hoping to pick up more dual-language sites.

1 Like

I just want to show my page in spanish when people are browsing from specific countries like Puerto Rico, Dominican Republic, Mexico etc… I’m not planning to create an specific topic for different markets it will be the same content always. Agent and Geo sounds good. Which one will do the job I need? Any ideas?

Show me how to achieve that. Sounds interesting

Answering your question I have translations already done but automatic translation will be great. Again, I don’t mind which way I manage to show the content in Spanish I just want people get the page in their language as soon they enter the page.

Really? That would mean you would need consent to display anything on any page? If that’s a rule you would need consent to get consent.

I’m no expert on GDPR and the even strict rules Germany seems to be applying, but the way the Internet works is by IP address. The only way a web server knows where to send the pages and parts that make up the page to your browser is by IP address. The only way the data gets routed to your browser through countless routers and networks all over the world is via IP address.

So now you are saying that “looking at the IP” not storing or tracking, but just looking requires consent? How do you get the consent then? Don’t you need an IP address to get permission to get the IP address?

Sounds like a catch 22. You need consent to get consent.

Sure makes me glad that I don’t have to worry about that stuff here in the US.

1 Like

You could add something like this to your .htaccess file:

RewriteCond %{HTTP:Accept-Language} ^es [NC]
RewriteRule ^$ /es/ [L,R=301]

This redirects vistors with browser language set to spanish (first line) to the pages to the subfolder /es/ (second line).

There are a couple of way, like the Joe’s stack, a little bit of JavaScript, .htaccess or PHP. They all check the browser Accept-Language header.

Please note, some browser may send multiple language codes, in order of preference of the user.

My Agents stacks can auto detect language settings from the user’s browser and then allows you to serve up the content for that language.

1 Like

The problem is more: Where does the check for a region takes place? You will have to send the IP address to a service to get the location. What does the service do with this personal data you are sending to him? If this service does not save and store the IP address it should be fine.

If you use a service right on your server, and do not store the IP address, no consent is needed.

The solution I proposed, which uses Agent, does that very thing. It checks the language of the browser (not the location) and then serves up the page in the language of the visitor. In my case, I’m just using two languages, but theoretically, you could deploy three or more. Joe’s Agent stack will get the job done for you. Of course, you’ll have to have two sets of content for it to work (which is where the project file I mentioned shines).

And, in some cases, the region won’t matter anyway. I’m located near a big city in Georgia - where the vast majority of the population speaks English as a first language. But, the area also has a huge number of Hispanic-speaking people, many of whom do not speak (much) English. For this reason, Agent is perfect - it determines the language of the visitor’s browser and then serves up the correct language automatically. If, by chance, a person’s browser is set to something other than Spanish or English (French, for example), the site reverts to English since that is how I set it.

That’s 50% true. in Puerto Rico (where I’m from) everything is set in spanish, in Old San Juan and tourist spots they have everything set up as USA so, visitors can enjoy their wifi and web needs flawlessly. The markets I want to show my webpage are in the hispanic caribbean local areas so the location will help dramatically.

back in the day I remember a stack that let you have a google translator tab in a corner, so you can manually select the language you need. Also, if I need to create everything in spanish as the only option then it will be easier having a a pop up window or a flash page with two buttons. ‘select your language and continue’ don’t you think??

I think a lot of us use a Google Translator button on our sites. Several developers make good ones. You can see one of my implementations here - lower right corner. I also have a Disclaimer (just above, in the footer). https://www.tricountyradiology.com/

I have a Google translate stack. It’s free. But the translations are garbage. If you want to do it right, don’t use that.

3 Likes

Joe is right - Google Translate does a fair job. In the case of my client, they felt that respecting their client base, which is 90% Hispanic, doing it right means providing a site in Spanish. I suggest following his advice: buy his Agent stack and do it right. :slight_smile:

1 Like

I will try the free alternative for now and see how it goes.

how did you managed to have a few languages options? let me know how you did that

I also have the issue of automatic translation (within the European Union there are 20 different languages) and was looking to make use of the DeepL APIs to accomplish the task.
Having a stack taking care of this would be great

2 Likes