

A Strategy for Internationalization and Node.js - jeresig
http://ejohn.org/blog/a-strategy-for-i18n-and-node/

======
jahewson
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
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.

~~~
jahewson
Cultural imperialism is not acceptable. It is arrogance, and we British are
acutely aware of that given the legacy of Empire.

You're failing to understand the magnitude of the insult which occurs when you
conflate a flag - which is a transient political statement, with a language -
which is cultural and fundamental to one's identity. Instead of a drop-down
menu of languages, the developer ends up creating a drop-down menu of
political allegiances.

Do you think that my friend's mother who fled the Iranian revolution wants to
stare at the flag of the Islamic Republic just because she wants to view sites
in Farsi? No. She has relatives who died because of what that flag represents.
Furthermore your assertion about country-specificity doesn't work: she speaks
the Iranian-specific form of Farsi.

Political statements really matter, people live and die for flags. Right now
there are riots in Ireland over the British flag
[http://www.cbsnews.com/8301-202_162-57563606/police-
attacked...](http://www.cbsnews.com/8301-202_162-57563606/police-attacked-
again-in-40th-day-of-northern-ireland-flag-riots/) Would you suggest that we
display the British flag to the Irish to represent "English"? They don't have
a country-specific form of English either.

How about we show the British flag in Zimbabwe, where it is the first
language? It's probably a crime... Maybe the French flag in Quebec? Oops. How
about the Cuban flag for Cuban-Americans who fled the revolution? The list
goes on, and on ...

So really, really, don't mix up political symbols with languages. For many
people, it's a matter of life and death. You're not going to have a
specialised version of your website for every country on Earth.

------
yuchi
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
There are javascript's i18n libraries by Alex Sexton.

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

~~~
jeresig
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
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
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.

~~~
jeresig
And this is the reason why I don't force anyone into viewing a particular
version of the site -- I only use it for displaying an opt-out notice guiding
them to the version that I think they may prefer.

------
STHayden
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
Why "ja." for Japanese when the ISO country code is JP?

~~~
daxhuiberts
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).

~~~
jzwinck
Wow, thanks for that. I knew about ISO 3166 but not 639 (and somehow just
assumed Japanese would match Japan). This leads to the rather surprising
result that TLDs use .jp for Japan yet subdomains use .ja for Japanese, e.g.
ja.example.co.jp. I imagine most laypeople would not well understand the
distinction and think "Oh why can't those IT people ever make things easy?"

Well, never mind anyway, because it's google.co.jp, but google.com.sg. IT
people really are annoying! ;-)

