Based on other discussions on this site and elsewhere, using flags to identify languages is the path to madness.

Nevertheless, I need an easy way to identify the language of individual content items on my site. I was thinking a bracketed 3 letter prefix might do the trick:

[ENG] - English
[FRE] - French
[FRA] - French (better?)
[ITA] - Italian
[SPA] - Spanish
[ESP] - Spanish (better?)
[GER] - German
[JPN] - Japanese
[CHN-S] - Chinese Simplified
[CHN-T] - Chinese Traditional

Apart from the special case for Chinese's two distinct systems, would I run into any problems sticking to a 3 character prefix system?

  • Where are you going to be using these codes? Just for your internal database, or in URLs? Dec 10, 2010 at 2:34
  • In a list of articles, they'd appear before the article title... [PFX] title title title
    – Drew
    Dec 10, 2010 at 2:45
  • IS 693-2T codes are preferable to 693-2B for most purposes, including this. Dec 6, 2011 at 13:35

3 Answers 3


I don't think reinventing the wheel is the right path.

There are a lot of standards currently on use. I think if you wanna markup your elements correctly, start from the basis: there is a global HTML attribute named lang for this purpose.

<html lang='de-de'>
<html lang='en-us'>

for an element only

<html lang='pt-br'>
<p>Também chamado de <abbr lang='en-us' title='Search Engine Optimization'>SEO</abbr>...</p>

Follow some references for your convenience:


I'm still not sure if you intend to use this in URL path, in title, or in a select lang widget.

However, I think keeping some existing convention is the safe path as most people should be used to them. Also, I think flags (countries flags) would be a good choice for a widget.

  • Thank you for the detailed response. I suppose I should have been a bit clearer - the intended beneficiary of this feature would only be the site users. When they see new content, they'd like to know right away what language it's in (my non-Eng users often use English titles so that's not an instant tipoff). I'm not interested in SEO, so using HTML tags - while semantically correct - wouldn't solve the problem. Nevertheless, thank you for the links. I've learned a few new things!
    – Drew
    Dec 10, 2010 at 23:48
  • Oh, now I see what you mean... OK, let's go to some edit in my response. And it was cool to share some quality links ;) Dec 11, 2010 at 21:21

You are abbreviating language names in English, not in that language. German speakers will be looking for an abbreviation of "Deutsch", not "German". Why not use the standard two-letter abbreviations for languages?


I see no problems with this for anyone using a modern browser. You might want to add some metadata/microdata to the text though, to help browsers and search engines interpret what your codes mean. I know I saw some questions on one of the stack exchange sites about it the other day, but I can't find them at the moment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.