Two-letter or three-letter ISO language codes - World Wide ...

文章推薦指數: 80 %
投票人數:10人

(And for some languages there were even two three-letter alternatives to choose from.) People were sometimes confused about which ISO code they should use in a ... Intendedaudience: HTMLcoders(usingeditorsorscripting),scriptdevelopers(PHP,JSP,etc.),CSScoders,schemadevelopers(DTDs,XMLSchema,RelaxNG,etc.),XSLTdevelopers,Webprojectmanagers,andanyonewhoneedsadviceonusinglanguagetagsinmarkupandstylesheets. Question ShouldIusetwo-letterorthree-letterISOlanguagecodesinlanguagetags? TheInternetandtheWebuseslanguagetagstoindicatethenaturallanguageoftextinprotocolsandformats,suchasHTML,XHTML,XML,HTTP,and others.Inthepast,thelanguagetagvaluesweredefinedbyRFC3066TagsfortheIdentificationof Languages(anditspredecessorRFC1766)andtheybeganwitheitheraISO639-1two-letterlanguagecodeorISO639-2three-lettercode. Forsomelanguagestherewerebothtwo-letterand three-letteralternativesintheISOcodes.(Andforsomelanguagestherewereeventwothree-letteralternativestochoosefrom.)PeopleweresometimesconfusedaboutwhichISOcodetheyshoulduseinalanguagetag. Answer Theanswerisneither! ThecurrentIETFspecificationdescribinghowtocreatelanguagetagsisreferredtoasBCP47.ThisnolongerrefersyoutotheISOcodelists.Insteadyoushouldlookforthe appropriatesubtagsinthenewIANALanguageSubtagRegistry.Thisregistry containsonlyonesubtagperlanguage,sothereisnolongeranyambiguity. AlthoughyounowneedtolookintheIANALanguageSubtagRegistryratherthantheISOcodelists,thelanguagetagsyouhavebeenusing sofardon'tneedtochange(aslongasyoufollowedthe'shortestcode'rule).Thisisjustachangeinhowyouaccessthem. TheIANALanguageSubtagRegistrystilluses,andkeepsuptodatewith,codesfromtheISOstandards,buttheregistrymaintainerstakecarethatthereisjustonesubtagforanylanguage:eitheratwo-letterorathree-lettersubtag. Formoreinformationabouthowtousethenewlanguagetagsyntaxandtheregistry,seethearticlesLanguageTagsinHTMLandXMLandChoosingaLanguageTag. Furtherreading Gettingstarted?LanguageontheWeb Tutorial,WorkingwithlanguageinHTML Relatedlinks,AuthoringHTML&CSS Language Choosinglanguagevalues Relatedlinks,AuthoringXML Language Choosinglanguagevalues Relatedlinks,AuthoringSVG Language Choosinglanguagevalues



請為這篇文章評分?