top | item 5045377

A Strategy for Internationalization and Node.js

70 points| jeresig | 13 years ago |ejohn.org

17 comments

order
[+] jahewson|13 years ago|reply
Languages are not countries. This website described in this article has the flag of the USA followed by "English", which as a British person I find both alienating and historically bizarre.

Likewise, you shouldn't be serving up content to Latin-Americans with the Spanish flag on it! How about the German flag for German-speaking Austrians? Or the Chinese flag for Mandarin speakers in Taiwan?

[+] crazygringo|13 years ago|reply
Why are British people so bothered by this? Why is anybody bothered by it?

I'm an American and have used plenty of (European) websites and product manuals where English is identified by a British flag. I have no problem with that. And plenty of (American) websites and product manuals where English is identified by an American flag. Which makes sense to me. Why is that such a problem to you?

It's true that languages are not countries, but languages almost always do exist in country-specific versions. British English is not American English. Brazilian Portuguese is not Portuguese from Portugal. Spanish in Mexico is different from Spanish in Argentina.

Is doesn't seem that unreasonable to use the flag of the country-specific version of the language being translated. If you're doing Spanish, you have to choose which Spanish in the first place anyways. The Portuguese can deal with a Brazilian flag if they hired a Brazilian translator. And for super-huge sites, you'll probably have different sections for USA and Britain anyways, since they'll have different pricing, different products, etc.

[+] jeresig|13 years ago|reply
A couple quick points: 1) If anyone ever comes up with a location-agnostic language icon for English, I'll implement it in a heartbeat. Using the Japanese flag for Japanese seems very safe. 2) Based upon the traffic to my site so far, all of my English-speaking audience is from the US. 3) The only time you'd be seeing the "US" flag (which does represent en-US, in my case) is when you're on the Japanese version of the site.
[+] jiggy2011|13 years ago|reply
Flags provide quickly recognisable iconography, much easier for me as a brit to recognise a union flag in a long list than the word "English".

But yes there are dilemmas, for example most Portuguese speakers live in Brazil.

[+] maxerickson|13 years ago|reply
Isn't it just a phrase? Like "USA English"?
[+] yuchi|13 years ago|reply
I was thinking to a similar project, once I saw the poor quality of modules out there. Very happy to see someone like you working out the problem.
[+] smagch|13 years ago|reply
There are javascript's i18n libraries by Alex Sexton.

https://github.com/SlexAxton/Jed https://github.com/SlexAxton/messageformat.js

[+] jeresig|13 years ago|reply
They are great libraries! Alex replied to my post and I replied with:

"I’m very familiar with your work (on both Jed and messageformat) – I hope to have a need for them some day! In my personal application I have no need for gender (there are no user accounts or socialization) and only very limited pluralization requirements (which can be mitigated with just basic one/other string replacement). Perhaps as the application grows something like that might be useful. We’re looking at possibly using your work for some upcoming i18n work at Khan Academy, we’ll see how that progresses!"

[+] advisedwang|13 years ago|reply
Is there something wrong with the content negotiation header "Accept-Language"? My understanding was most browsers set it to the system language?

HTTP provides a mechanism, why does nobody use it?

[+] jahewson|13 years ago|reply
Yes, it's broken in most browsers. For example my system language is set to en-gb which is British English, but my browser reports en-us which is American English. Most websites don't distinguish between these two languages though.

The main reason that Accept-Language is problematic is that it forces the user into using the system language, so a Sweedish person in London at an Internet cafe ends up with websites in English, so there must always be an easy way to change the website language within the browser.

But a browser-wide setting would just annoy bilingual people who want content is different languages depending on context.

[+] STHayden|13 years ago|reply
Most SEO people will end up telling you that sub domains endup splitting your page rank up since they are considered different domains. We ended up keeping our different languages under different sub folders. so:

whatever.com/

whatever.com/es/

whatever.com/de/

[+] jzwinck|13 years ago|reply
Why "ja." for Japanese when the ISO country code is JP?
[+] daxhuiberts|13 years ago|reply
There is a difference between language codes and country codes. "ja" is the language code for japanese (ISO 639-1), "jp" is the country code for japan (ISO 3166-1 alpha-2).