Tag content with international language codes - GOV.UK
文章推薦指數: 80 %
Use the World Wide Web Consortium (W3C) guidance to: show you how to annotate language on the web, for both HTML and XML formats; declare the ... Skiptomaincontent CookiesonGOV.UK Weusesomeessentialcookiestomakethiswebsitework. We’dliketosetadditionalcookiestounderstandhowyouuseGOV.UK,rememberyoursettingsandimprovegovernmentservices. Wealsousecookiessetbyothersitestohelpusdelivercontentfromtheirservices. Acceptadditionalcookies Rejectadditionalcookies Viewcookies Youcanchangeyourcookiesettingsatanytime. Hidethismessage Coronavirus(COVID-19) Latestupdatesandguidance Home Government Governmentefficiency,transparencyandaccountability Openstandardsforgovernment CabinetOffice CentralDigital&DataOffice Contents 1.Summaryofthestandard’suseforgovernment 2.Howthisstandardmeetsuserneeds 3.Howtousethestandard Printthispage ©Crowncopyright2020 ThispublicationislicensedunderthetermsoftheOpenGovernmentLicencev3.0exceptwhereotherwisestated.Toviewthislicence,visitnationalarchives.gov.uk/doc/open-government-licence/version/3orwritetotheInformationPolicyTeam,TheNationalArchives,Kew,LondonTW94DU,oremail:[email protected]. Wherewehaveidentifiedanythirdpartycopyrightinformationyouwillneedtoobtainpermissionfromthecopyrightholdersconcerned. Thispublicationisavailableathttps://www.gov.uk/government/publications/open-standards-for-government/language-tags UsetheISO639-1:2002languagecodesstandardtoaddconsistent,internationallyrecognisedlanguagecodestoyourdata. 1.Summaryofthestandard’suseforgovernment TheISO639-1standarduses2lettercodestorepresentthenamesofmorethan500internationallyrecognisedlanguages.Itdoesnotrepresentlanguagesthatareexclusivelyformachines.Usethisstandardtomakesureyoureferencelanguagesinaconsistentwayacrossyourdatasets. ThegovernmentchoosesstandardsusingtheopenstandardsapprovalprocessandtheOpenStandardsBoardhasfinalapproval.Readmoreabouttheprocessforlanguagecodes. 2.Howthisstandardmeetsuserneeds Usethisstandardforconsistentlanguagetagging.Forexample,whenusingcross-platformcharacterencodingtomakesuredifferentsystemscorrectlyidentifylanguages. Whensystemscanconsistentlyidentifywhichlanguagesyou’veuseditcanhelpuserswho: wanttotradewithUKbusinesses plantotraveltotheUKfromabroad liveintheUKbutdonotspeakEnglish ThegovernmentalsohasalegalrequirementtotranslateinformationintoWelsh.Thisstandardprovidesaconsistentwayoftaggingthisinformationsoit’seasiertofind. Usingthisstandardmeans: userscanfindinformationinthelanguagetheyneed servicesandcontenthaveconsistentlanguagetags screenreaderscanidentifywhichlanguagethecontentisin 3.Howtousethestandard Whenyou’republishingcontentinmultiplelanguagesyoumustusethisstandard’s2lettercodesinthetagsormetadata. YoumustuselanguagetagsintherelevantHTMLandXMLdocumentmetadata. Thisstandardsdoesnotcover: standardmethodsforattachinglanguagetagstootherformats,suchasJSON methodsofpresentingauserwithtext,inparticular,HTTPlanguagenegotiationortheURLsuffixschemecurrentlyusedbyGOV.UK UsetheWorldWideWebConsortium(W3C)guidanceto: showyouhowtoannotatelanguageontheweb,forbothHTMLandXMLformats declarethelanguageofawebpageoraportionofawebpageusingHTMLlangattribute declarethelanguageofabodyoftextusingthe‘xml:lang’attribute Youcanalsogetalistof: 2and3letterlanguagetagsontheInternetAssignedNumbersAuthority(IANA)website extendedlanguagetagswithscriptsubtagsinRFC5646,ifyouneedtoaddinformationtothelanguagetag tagsandtheircountrynamesontheUSlibraryofcongresswebsite Contents Printthispage Isthispageuseful? Maybe Yesthispageisuseful Nothispageisnotuseful Thankyouforyourfeedback Reportaproblemwiththispage Close HelpusimproveGOV.UK Don’tincludepersonalorfinancialinformationlikeyourNationalInsurancenumberorcreditcarddetails. Whatwereyoudoing? Whatwentwrong? Send Close HelpusimproveGOV.UK TohelpusimproveGOV.UK,we’dliketoknowmoreaboutyourvisittoday.We’llsendyoualinktoafeedbackform.Itwilltakeonly2minutestofillin.Don’tworrywewon’tsendyouspamorshareyouremailaddresswithanyone. Emailaddress Sendmethesurvey
延伸文章資訊
- 1W3C confirms: WebAssembly becomes the fourth language ...
Following HTML, CSS, and JavaScript, WebAssembly becomes the fourth language for the Web which al...
- 28 Language information and text direction
Inheritance of language codes
- 3HTML ISO Language Codes - W3docs
The HTML lang attribute declares the language of a web page or only a part of a web page. It is u...
- 4Language tags in HTML and XML - World Wide Web ...
These codes come from, and are kept up to date with, ISO 639 language codes. Because RFC 3066 did...
- 5HTML ISO Language Code Reference - W3Schools
ISO 639-1 defines abbreviations for languages: See also: Reference for Country Codes. Language, I...