Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
etc...

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

share|improve this question
    
Where are you going to be using these codes? Just for your internal database, or in URLs? –  Mark Henderson Dec 10 '10 at 2:34
    
In a list of articles, they'd appear before the article title... [PFX] title title title –  Andrew Heath Dec 10 '10 at 2:45
    
IS 693-2T codes are preferable to 693-2B for most purposes, including this. –  Peter Taylor Dec 6 '11 at 13:35

3 Answers 3

up vote 3 down vote accepted

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:

EDIT

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.

share|improve this answer
    
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! –  Andrew Heath Dec 10 '10 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 ;) –  Dave Dec 11 '10 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?

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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